From owner-freebsd-arch@FreeBSD.ORG Tue Sep 18 08:23:25 2007 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D27D16A419 for ; Tue, 18 Sep 2007 08:23:25 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from webaccess-cl.virtdom.com (webaccess-cl.virtdom.com [216.240.101.25]) by mx1.freebsd.org (Postfix) with ESMTP id B34F113C467 for ; Tue, 18 Sep 2007 08:23:24 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from [192.168.1.103] (c-67-160-44-208.hsd1.wa.comcast.net [67.160.44.208]) (authenticated bits=0) by webaccess-cl.virtdom.com (8.13.6/8.13.6) with ESMTP id l8I8Mw5i049790 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Tue, 18 Sep 2007 04:22:59 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Tue, 18 Sep 2007 01:25:52 -0700 (PDT) From: Jeff Roberson X-X-Sender: jroberson@10.0.0.1 To: Kostik Belousov In-Reply-To: <20070918043335.GR79542@deviant.kiev.zoral.com.ua> Message-ID: <20070918012543.Y558@10.0.0.1> References: <20070917165657.B558@10.0.0.1> <20070918043335.GR79542@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: arch@freebsd.org Subject: Re: Changing p_swtime and td_slptime to ticks X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2007 08:23:25 -0000 On Tue, 18 Sep 2007, Kostik Belousov wrote: > On Mon, Sep 17, 2007 at 05:05:57PM -0700, Jeff Roberson wrote: >> Enclosed is a patch that fixes swapping with ULE. ULE has never properly >> set p_swtime and td_slptime which are used by the swapout/swapin code to >> select the appropriate thread to swap. >> >> In 4BSD these two variables are increment once per-second as schedcpu() >> iterates over all threads. ULE does not have a once per-second loop >> iterating over all threads. So I have changed p_swtime to p_swtick and >> td_slptime to td_slptick. These record the value of 'ticks' when the >> thread slept or was last swapped in or out. >> >> For backwards compatibility I leave the values in kinfo_proc with the >> legacy meaning by subtracting from ticks and dividing by hz. I perform a >> similar transformation in the swapout code to convert to seconds. This >> change does make it possible to use sub-second granular decisions in the >> swap code, however I'm not sure if that's really necessary. >> >> So that I did not disturb the 4BSD mechanism I kept the original >> td_slptime in the td_sched area. It should be possible to use td_slptick >> directly but especially this close to release I did not want to change >> 4BSD. >> >> Feedback and testing welcome. > > Purely cosmetic request: please make the ticks and hz variables in the > libkvm/kvm_proc.c static. Or, even better, move it into the struct __kvm. > Thanks, will do. Jeff