From owner-freebsd-arch@FreeBSD.ORG Tue Sep 18 15:13:14 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 B081316A477 for ; Tue, 18 Sep 2007 15:13:14 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 2505813C4D3 for ; Tue, 18 Sep 2007 15:13:13 +0000 (UTC) (envelope-from andre@freebsd.org) Received: (qmail 43866 invoked from network); 18 Sep 2007 14:31:15 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 18 Sep 2007 14:31:15 -0000 Message-ID: <46EFE4BD.4030505@freebsd.org> Date: Tue, 18 Sep 2007 16:46:21 +0200 From: Andre Oppermann User-Agent: Thunderbird 1.5.0.13 (Windows/20070809) MIME-Version: 1.0 To: Jeff Roberson References: <20070917165657.B558@10.0.0.1> <46EF644E.9050207@elischer.org> <20070918012555.G558@10.0.0.1> In-Reply-To: <20070918012555.G558@10.0.0.1> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: arch@freebsd.org, Julian Elischer 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 15:13:14 -0000 Jeff Roberson wrote: > On Mon, 17 Sep 2007, Julian Elischer wrote: > >> 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? > > ticks is incremented each time hardclock() is called. That's it. > >> >> 2/ nothing that used to be accounted in seconds becomes accounted for >> in ticks? > > I scale back to seconds where it is required. Really I think ticks > would be the better metric in vm_glue.c but didn't want to make any > drastic changes. ticks is 2^31 on x86 and at HZ=1000 is wraps within a reasonable short uptime. You have to make sure that your code handles that correctly or you run into lots of strange effects which are almost impossible to reproduce. In TCP we've got bitten by that. -- Andre