From owner-freebsd-current@FreeBSD.ORG Thu Jan 3 16:55:07 2013 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8A6F27E4; Thu, 3 Jan 2013 16:55:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 21F17364; Thu, 3 Jan 2013 16:55:06 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r03GstDD010598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 4 Jan 2013 03:54:56 +1100 Date: Fri, 4 Jan 2013 03:54:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexander Motin Subject: Re: [RFC/RFT] calloutng In-Reply-To: <50E5ADE1.4020104@FreeBSD.org> Message-ID: <20130104034917.O1929@besplex.bde.org> References: <20121225232126.GA47692@alchemy.franken.de> <50DB4EFE.2020600@FreeBSD.org> <1356909223.54953.74.camel@revolution.hippie.lan> <20121231061735.GA5866@onelab2.iet.unipi.it> <50E16637.9070501@FreeBSD.org> <20130102105730.GA42542@onelab2.iet.unipi.it> <50E418EA.7030801@FreeBSD.org> <20130102122743.GA43241@onelab2.iet.unipi.it> <20130102162206.GA45701@onelab2.iet.unipi.it> <20130102170934.GA82219@kib.kiev.ua> <50E4A902.4050307@FreeBSD.org> <20130103232413.O947@besplex.bde.org> <50E5ADE1.4020104@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Zr21sKHG c=1 sm=1 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=mUAV9h2nInsA:10 a=5cdyoQTr-aBsL13Ni88A:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 X-Mailman-Approved-At: Thu, 03 Jan 2013 17:10:07 +0000 Cc: Davide Italiano , Ian Lepore , Marius Strobl , FreeBSD Current , Bruce Evans , freebsd-arch@FreeBSD.org, Konstantin Belousov X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 03 Jan 2013 16:55:07 -0000 On Thu, 3 Jan 2013, Alexander Motin wrote: > On 03.01.2013 16:45, Bruce Evans wrote: >> On Wed, 2 Jan 2013, Alexander Motin wrote: >>> More important for scheduling fairness thread's CPU percentage is also >>> based on hardclock() and hiding from it was trivial before, since all >>> sleep primitives were strictly aligned to hardclock(). Now it is >>> slightly less trivial, since this alignment was removed and user-level >>> APIs provide no easy way to enforce it. >> >> %cpu is actually based on statclock(), and not even used for scheduling. > > May be for SCHED_4BSD, but not for SCHED_ULE. In SCHED_ULE both %cpu and > thread priority based on the same ts_ticks counter, that is based on > hardclock() as time source. Interactivity calculation uses alike logic and > uses the same time source. Hmm. I missed this because it hacks on the 'ticks' global. It is clearer in intermediate versions which use the scheduler API sched_tick(), which is the hardclock analogue of sched_clock() for statclock. sched_tick() is now bogus since it is null for all schedulers. Bruce