From owner-freebsd-arch@FreeBSD.ORG Tue Sep 18 04:33:57 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 7BD2216A418 for ; Tue, 18 Sep 2007 04:33:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by mx1.freebsd.org (Postfix) with ESMTP id D0DA013C459 for ; Tue, 18 Sep 2007 04:33:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=deviant.kiev.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1IXUmJ-000Oqv-AT for arch@freebsd.org; Tue, 18 Sep 2007 07:33:47 +0300 Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.1/8.14.1) with ESMTP id l8I4Xa05086167; Tue, 18 Sep 2007 07:33:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.1/8.14.1/Submit) id l8I4XZ1w086166; Tue, 18 Sep 2007 07:33:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 18 Sep 2007 07:33:35 +0300 From: Kostik Belousov To: Jeff Roberson Message-ID: <20070918043335.GR79542@deviant.kiev.zoral.com.ua> References: <20070917165657.B558@10.0.0.1> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kAOhhqH5290wydqT" Content-Disposition: inline In-Reply-To: <20070917165657.B558@10.0.0.1> User-Agent: Mutt/1.4.2.3i X-Scanner-Signature: 362d5034abbfed611c52a2913ea5ff69 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 1485 [September 17 2007] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {received from trusted relay: not dialup} X-SpamTest-Method: none X-SpamTest-Method: Local Lists X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release 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 04:33:57 -0000 --kAOhhqH5290wydqT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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= =20 > set p_swtime and td_slptime which are used by the swapout/swapin code to= =20 > select the appropriate thread to swap. >=20 > In 4BSD these two variables are increment once per-second as schedcpu()= =20 > iterates over all threads. ULE does not have a once per-second loop=20 > iterating over all threads. So I have changed p_swtime to p_swtick and= =20 > td_slptime to td_slptick. These record the value of 'ticks' when the=20 > thread slept or was last swapped in or out. >=20 > For backwards compatibility I leave the values in kinfo_proc with the=20 > legacy meaning by subtracting from ticks and dividing by hz. I perform a= =20 > similar transformation in the swapout code to convert to seconds. This= =20 > change does make it possible to use sub-second granular decisions in the= =20 > swap code, however I'm not sure if that's really necessary. >=20 > So that I did not disturb the 4BSD mechanism I kept the original=20 > td_slptime in the td_sched area. It should be possible to use td_slptick= =20 > directly but especially this close to release I did not want to change=20 > 4BSD. >=20 > 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. --kAOhhqH5290wydqT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFG71UeC3+MBN1Mb4gRAhVLAJ4o2OWJfJJhUKRmIyGwrBArUvjO1wCguCF2 W1KjYYG1qcDbpc5l82GZBTE= =4GbX -----END PGP SIGNATURE----- --kAOhhqH5290wydqT--