Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 23 Apr 2002 15:36:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 23 Apr 2002 15:36:00 -0400 Received: from ns.suse.de ([213.95.15.193]:42763 "HELO Cantor.suse.de") by vger.kernel.org with SMTP id ; Tue, 23 Apr 2002 15:36:00 -0400 Date: Tue, 23 Apr 2002 21:35:59 +0200 From: Andi Kleen To: george anzinger Cc: Andi Kleen , Alan Cox , linux-kernel@vger.kernel.org Subject: Re: Why HZ on i386 is 100 ? Message-ID: <20020423213559.A24389@wotan.suse.de> In-Reply-To: <3CC4861C.F21859A6@mvista.com.suse.lists.linux.kernel> <3CC5B4D6.C982F311@mvista.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.22.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 23, 2002 at 12:24:06PM -0700, george anzinger wrote: > Andi Kleen wrote: > > > > Alan Cox writes: > > > > > > The problem is in accounting (or time slicing if you prefer) where we > > > > need to start a timer each time a task is context switched to, and stop > > > > it when the task is switched away. The overhead is purely in the set up > > > > and tear down. MOST of these never expire. > > > > > > Done properly on many platforms a variable tick is very very easy and also > > > very efficient to handle. X86 is a paticular problem case because the timer > > > is so expensive to fiddle with > > > > Depends. On modern x86 you can either use the local APIC timer or > > the mmtimers (ftp://download.intel.com/ial/home/sp/mmts097.pdf - > > should be in newer x86 chipsets). Both should be better than the > > 8254 timer and are also not expensive to work with. > > I just looked at the mmtimers. Looks like the right idea but a bit > overblown. I would prefer an interrupt generated by a compare to the > TSC all on board the cpu chip. This would eliminate the I/O overhead. That's the local APIC timer. Pretty much all modern x86 have it. But at least microsoft warns from using them for high precision tim ekeeping on their mmtimer page "due to inaccuracy and frequent silicon bugs" (and I guess they have the data for that) For scheduling and time accounting it seems to work reasonably though, even though I've had some problems with inaccuracies (e.g. when you instrument both 8254 and apic timer and log the TSCs there are sometimes drifts) The linux local APIC timer setup could be probably also improved, for example the 16 multiplier is a bit dubious and the calibration does not look very robust. > When can we expect to see this in a real cpu? mmtimers? They are in the chipset, not in the CPU. They are in some modern Intel and AMD chipsets already for example and Microsoft is pushing them too so I guess they will be soon in all new chipsets. -Andi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/