From owner-freebsd-current@FreeBSD.ORG Wed Jan 2 18:31:44 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3972316A469 for ; Wed, 2 Jan 2008 18:31:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id E1F9213C4D1 for ; Wed, 2 Jan 2008 18:31:43 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 70AF849A44; Wed, 2 Jan 2008 13:31:43 -0500 (EST) Date: Wed, 2 Jan 2008 18:31:43 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Ed Maste In-Reply-To: <20080102160322.GA83957@sandvine.com> Message-ID: <20080102182732.N30578@fledge.watson.org> References: <20071228015651.X1565@odysseus.silby.com> <20071228095539.F45653@fledge.watson.org> <20071229180004.O6052@odysseus.silby.com> <477A627A.8010601@FreeBSD.org> <20080101222654.A8764@odysseus.silby.com> <20080102160322.GA83957@sandvine.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Mike Silbersack , "Bruce M. Simpson" , current@freebsd.org Subject: Re: [patch] Auto-setting hz to 100 inside QEMU/VMWare X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2008 18:31:44 -0000 On Wed, 2 Jan 2008, Ed Maste wrote: > On Tue, Jan 01, 2008 at 10:27:28PM -0600, Mike Silbersack wrote: > >> It looks like we're going to go with an alternate implementation that >> resides in the loader instead. The effect will be the same, and it should >> be committed within a few days. > > I've attached a proof of concept patch that does this in forth in the > loader. I've been using something similar for a while; this patch isi > cleaned up somewhat and I've added the kenv strings from Mike's patch. > > I've only tried it out with qemu so far. I'd appreciate reports of any > testing with other emulators, and comments from loader/forth gurus. With this patch, is one forced to use a HZ of 100 when running under a VM unless one modifies the loader scripts? There are times when I experiment with alternative HZ settings in VMs, and as such it would be nice to have an intentional way to turn off auto-setting of HZ, and/oor specify what the VM HZ should be, using loader.conf. I.e.: vmadjusthz_enable="NO" and vmadjusthz_hz="50" Allowing me to either manually disable the override of kern.hz, or to specify what the replacement value should be. One other variation I'd sort of been thinking about was using the loader to set a kernel environmental variable indicating that we're in a VM, but then letting the kernel decide what to do about it, per my previous suggestion to silby. That way we could define a kernel option in GENERIC the same way we do HZ: options VMHZ="100" The loader would make the decision as to which would be used, but the logic to implement the HZ change would be in the kernel. And loader.conf's kern.hz would still be able to override it... I just want to make sure that we retain all the current flexibility to modify HZ at boot-time while having the default be more sensible. Robert N M Watson Computer Laboratory University of Cambridge