From owner-freebsd-arch@FreeBSD.ORG Tue Sep 18 05:48:52 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 4F30A16A41A for ; Tue, 18 Sep 2007 05:48:52 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outI.internet-mail-service.net (outI.internet-mail-service.net [216.240.47.232]) by mx1.freebsd.org (Postfix) with ESMTP id 0C44613C45E for ; Tue, 18 Sep 2007 05:48:51 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Mon, 17 Sep 2007 22:38:22 -0700 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id DF7831263F4; Mon, 17 Sep 2007 22:38:21 -0700 (PDT) Message-ID: <46EF644E.9050207@elischer.org> Date: Mon, 17 Sep 2007 22:38:22 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Jeff Roberson References: <20070917165657.B558@10.0.0.1> In-Reply-To: <20070917165657.B558@10.0.0.1> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 05:48:52 -0000 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. I have not looked at in the depth required, but 2 points that I was unable to check to my satisfaction before I got called away for work.... 1/ the source of the ticks is a monotonically increasing count that never goes backwards or changes? 2/ nothing that used to be accounted in seconds becomes accounted for in ticks? > > 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. > > Thanks, > Jeff > > > ------------------------------------------------------------------------ > > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"