From owner-freebsd-net@FreeBSD.ORG Sat Sep 12 13:36:26 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6776F106566C for ; Sat, 12 Sep 2009 13:36:26 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 2D9DC8FC15 for ; Sat, 12 Sep 2009 13:36:25 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 022B1730DA; Sat, 12 Sep 2009 15:42:26 +0200 (CEST) Date: Sat, 12 Sep 2009 15:42:26 +0200 From: Luigi Rizzo To: rihad Message-ID: <20090912134226.GD46135@onelab2.iet.unipi.it> References: <4AAB4D56.30207@mail.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AAB4D56.30207@mail.ru> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org Subject: Re: [POLLING] strange interrupt/system load X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2009 13:36:26 -0000 On Sat, Sep 12, 2009 at 12:27:18PM +0500, rihad wrote: > The box experiences ~230 mbit/s traffic flow through it. I've doubled > some sysctls after reading polling(4): > kern.polling.each_burst=10 # was: 5 > kern.polling.burst_max=350 # was: 150 > > FreeBSD 7.2-RELEASE-p3 amd64 > HZ=1000 > > Now for the fun part. > > With kern.polling.idle_poll = 1 top shows: > CPU: 0.0% user, 0.0% nice, 26.9% system, 3.1% interrupt, 70.0% idle > ~8000 interrupts/s total according to systat -vmstat: > 1999 cpu0: time > 2000 cpu1: time > 1999 cpu2: time > 1999 cpu3: time > > With kern.polling.idle_poll = 0 top shows: > CPU: 0.0% user, 0.0% nice, 0.0% system, 13.9% interrupt, 86.0% idle > Still the same ~8000 clock interrupts/s. > > Under both scenarios polling is enabled on both em0 and em1 through > ifconfig. > > > 1) Why is the interrupt load relatively high with polling enabled? > 2) How come 13.9% interrupts are not also in the first scenario if their > total rate is the same (~8000)? Polling enabled means that at every tick (and in the idle loop if you also have idle_poll enabled) you are checking the status of the interface even if there is no traffic. The polling handler is probably accounted for as 'interrupt'. The load you see shoud not be too different to what you see without polling. Enabling idle_poll moves part of the work to the idle loop(s) which are accounted as 'system' time. What happens here is that part of the work is taken away from the polling handlers that run on each tick so you see a reduction on the interrupt time, whereas as Bruce said, one CPU is using 100% of its time (or 25% of the total work capacity) to run the idle_poll loop. cheers luigi