From owner-freebsd-net@FreeBSD.ORG Sun May 11 09:15:55 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 022F737B401 for ; Sun, 11 May 2003 09:15:55 -0700 (PDT) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7ED0F43FEC for ; Sun, 11 May 2003 09:15:54 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.8p1/8.12.3) with ESMTP id h4BGFgQg064330; Sun, 11 May 2003 09:15:42 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.8p1/8.12.3/Submit) id h4BGFga3064329; Sun, 11 May 2003 09:15:42 -0700 (PDT) (envelope-from rizzo) Date: Sun, 11 May 2003 09:15:42 -0700 From: Luigi Rizzo To: Don Bowman Message-ID: <20030511091542.A59848@xorpc.icir.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from don@sandvine.com on Sun, May 11, 2003 at 12:05:23PM -0400 cc: freebsd-net@freebsd.org Subject: Re: polling(4) and idle time/cpu usage percentages X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2003 16:15:55 -0000 On Sun, May 11, 2003 at 12:05:23PM -0400, Don Bowman wrote: > From: Kevin Day [mailto:toasty@dragondata.com] > > At 10:44 AM 5/11/2003, you wrote: > > >I tried the hack, as below. The other thing that makes idle > > >wildly inaccurate is the symmetric multi-threading on the xeon > > >(aka hyperthreading). > > > > Smack me if I'm wrong, but you can't compile the kernel with > > DEVICE_POLLING > > active at the same time as SMP. Without SMP you don't get any of the > > advantages/effects of HTT. > > > > (or has polling been made to play nice with SMP in -current?) > > DEVICE_POLLING actually works fine with SMP, there was just > some question as to whether it was the best way to make use > of the SMP. I just removed the #error in kern_poll.c in the > #ifdef SMP case. Interesting! Well, let's see: The polling code (including the code that schedules the cpu between kernel and userland) is written upon the assumption that only one polling loop is active. Now, because polling can occur in the idle loop or right after hardclock, and there are multiple concurrent idle_loops in the SMP cases, and the locking is just not there. Probably, the reason it works for you is that likely there is only one instance of hardclock handler, _and_ the idle_loop code is different for the UP and SMP cases, and I only provided polling hooks for the former. So you are limited to doing polling only in the assigned fraction of CPU, and the CPU(s) will not use any extra CPU for polling even if available. cheers luigi > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"