From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 4 16:16:05 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9267A1065676; Fri, 4 Dec 2009 16:16:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 650358FC08; Fri, 4 Dec 2009 16:16:05 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 121D646B2A; Fri, 4 Dec 2009 11:16:05 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 2197C8A01F; Fri, 4 Dec 2009 11:16:04 -0500 (EST) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Fri, 4 Dec 2009 10:47:08 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Message-Id: <200912041047.08253.jhb@freebsd.org> Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 04 Dec 2009 11:16:04 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Ivan Voras Subject: Re: Request for information - timers, hz, interrupts X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 16:16:05 -0000 On Friday 04 December 2009 9:52:39 am Ivan Voras wrote: > For a long time, at least in the 6-stable timeframe, I was used to > seeing timer interrupts going at the frequency of 2*HZ, e.g. this is > from 6.4-RELEASE: > > kern.clockrate: { hz = 250, tick = 4000, profhz = 166, stathz = 33 } > debug.psm.hz: 20 > > cpu0: timer 6789885563 499 > cpu2: timer 6789885538 499 > cpu1: timer 6789885538 499 > cpu3: timer 6789885537 499 > > Then sometime in 7.x this changed to 4*HZ, which continues in 8.x, e.g. > from 7.2-RELEASE: > > kern.clockrate: { hz = 250, tick = 4000, profhz = 1000, stathz = 142 } > kern.hz: 250 > > cpu0: timer 1368329715 988 > cpu1: timer 1368324640 988 > cpu2: timer 1367642854 988 > cpu3: timer 1367642874 988 > > I'm not very worried about it (though maybe laptop users might be > because of potential power drainage) but would like to know the > explanation behind it. > > Presumably it has something to do with profhz but what and why? There > isn't an obvious correlation between profhz frequency in 6.x and HZ and > in 7.x. and HZ. It actually was changed to provide saner behavior when you use low hz values like 'hz=100'. Note that your stathz is now 142 instead of 33. The scheduler is likely far happier with that stathz. There is more detail in the commit log I believe (just look at the logs for local_apic.c in either svn or cvsweb). -- John Baldwin