public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Williams <peterw@aurema.com>
To: Albert Cahalan <albert@users.sf.net>
Cc: linux-kernel mailing list <linux-kernel@vger.kernel.org>,
	johnl@aurema.com
Subject: Re: [RFC][PATCH] O(1) Entitlement Based Scheduler
Date: Fri, 27 Feb 2004 10:24:37 +1100	[thread overview]
Message-ID: <403E8035.9020606@aurema.com> (raw)
In-Reply-To: <1077818221.2255.3.camel@cube>

Albert Cahalan wrote:
> On Thu, 2004-02-26 at 01:19, Peter Williams wrote:
> 
>>Albert Cahalan wrote:
>>
>>>John Lee writes:
> 
> 
>>>>The usage rates for each task are estimated using Kalman
>>>>filter techniques, the  estimates being similar to those
>>>>obtained by taking a running average over twice the filter
>>>>_response half life_ (see below). However, Kalman filter
>>>>values are cheaper to compute and don't require the
>>>>maintenance of historical usage data.
>>>
>>>
>>>Linux dearly needs this. Please separate out this part
>>>of the patch and send it in.
>>
>>This information can be determined from the SleepAVG: field in the 
>>/proc/<pid>/status and /proc/<tgid>/task/<pid>/status files by 
>>subtracting the value there from 100.
> 
> 
> This doesn't seem to be the case. For example, a fork()
> causes the value to be adjusted in both child and parent.

This would be the case with our patch as well as we make children 
inherit their parent's usage rate to partially reduce the effect of ramp 
up in the estimation of the child's CPU usage rate.

> 
> Also, perhaps the name is wrong, but I'd think SleepAVG
> has more to do with the average length of a sleep. It sure
> isn't documented. (time constant? type of decay?)

My reading of the code caused me to interpret it as a percentage sleep 
rate i.e. a value of 50 means the task is sleeping 50% of the time.  And 
this has made me realise that without our patches using (100 - SleepAVG) 
would not really give you CPU usage rate but would instead give 
RUNNABILITY rate (i.e. the proportion of time the task is spending on 
the cpu OR on a runqueue waiting for cpu access.

It also makes me realise that the SleepAVG our patch reports is NOT 
really a sleep rate it's a sleep OR waiting on a runqueue rate.

> 
> There's also a need for whole-process stats and cumulative
> (sum of exited children) stats. %CPU can go as high as 51200%.
> 
> 
>>Without our patch this value is a 
>>directly calculated estimated of the task's sleep rate which is 
>>available because it used by the O(1) scheduler's heuristics.  With our 
>>patches, it is calculated from our estimate of the task's usage because 
>>we dispensed with the sleep average calculations as they are no longer 
>>needed.  We decided to still report sleep average in the status file 
>>because we were reluctant to alter the contents of such files in case we 
>>broke user space programs.
> 
> 
> Generally this is a good move, though I don't expect anything
> to be using SleepAVG at the moment.

OK.

> 
> 
>>>Right now, Linux does not report the recent CPU usage
>>>of a process. The UNIX standard requires that "ps"
>>>report this; right now ps substitutes CPU usage over
>>>the whole lifetime of a process.
>>>
>>>Both per-task and per-process (tid and tgid) numbers
>>>are needed. Both percent and permill (1/1000) units
>>>get reported, so don't convert to integer percent.
>>
>>I think a modification to fs/proc/array.c to make this field a per 
>>million rather than a percent value would satisfy your needs.  It would 
>>be a very small change but there would be concerns about breaking 
>>programs that rely on it being a percentage.
> 
> 
> Nothing can rely on it existing at all, so a name change would
> solve the problem of apps getting confused.
> 
> BTW, permill is not per-million, it is per-thousand.
> Per-million or per-billion would be fine as long as
> it doesn't overflow.

OK.  Since SleepAVG does not seem to be entrenched in people's 
expectations and because of the fact that the value calculated from our 
usage rates are not really valid (see above), I propose that we change 
this field's name to CPUrate and report the CPU usage rate directly in 
permill (unless there are violent objections).

Peter
-- 
Dr Peter Williams, Chief Scientist                peterw@aurema.com
Aurema Pty Limited                                Tel:+61 2 9698 2322
PO Box 305, Strawberry Hills NSW 2012, Australia  Fax:+61 2 9699 9174
79 Myrtle Street, Chippendale NSW 2008, Australia http://www.aurema.com


  reply	other threads:[~2004-02-26 23:27 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-26  3:30 [RFC][PATCH] O(1) Entitlement Based Scheduler Albert Cahalan
2004-02-26  6:19 ` Peter Williams
2004-02-26 17:57   ` Albert Cahalan
2004-02-26 23:24     ` Peter Williams [this message]
2004-03-01  3:47       ` Peter Williams
     [not found] <1vuMd-5jx-5@gated-at.bofh.it>
     [not found] ` <1vuMd-5jx-7@gated-at.bofh.it>
     [not found]   ` <1vuMd-5jx-9@gated-at.bofh.it>
     [not found]     ` <1vuMd-5jx-11@gated-at.bofh.it>
     [not found]       ` <1vuMd-5jx-3@gated-at.bofh.it>
     [not found]         ` <1vvyx-6jy-13@gated-at.bofh.it>
     [not found]           ` <1vBE2-48V-21@gated-at.bofh.it>
2004-03-03 21:38             ` Bill Davidsen
     [not found] <fa.fi4j08o.17nchps@ifi.uio.no.suse.lists.linux.kernel>
     [not found] ` <fa.ctat17m.8mqa3c@ifi.uio.no.suse.lists.linux.kernel>
     [not found]   ` <yydjishqw10p.fsf@galizur.uio.no.suse.lists.linux.kernel>
     [not found]     ` <40426E1C.8010806@aurema.com.suse.lists.linux.kernel>
2004-03-03  2:48       ` Andi Kleen
2004-03-03  3:45         ` Peter Williams
2004-03-03 10:13           ` Andi Kleen
2004-03-03 23:46             ` Peter Williams
2004-03-03 15:57           ` Andi Kleen
2004-03-04  0:41             ` Peter Williams
2004-03-05  3:55               ` Andi Kleen
     [not found] <fa.ftul5bl.nlk3pr@ifi.uio.no>
     [not found] ` <fa.cvc8vnj.ahebjd@ifi.uio.no>
2004-03-01  9:18   ` Joachim B Haga
2004-03-01 10:18     ` Paul Wagland
2004-03-01 19:11       ` Mike Fedyk
     [not found] <fa.jgj0bdi.b3u6qk@ifi.uio.no>
2004-03-01  1:54 ` Andy Lutomirski
2004-03-01  2:54   ` Peter Williams
2004-03-01  3:46     ` Andy Lutomirski
2004-03-01  4:18       ` Peter Williams
2004-03-02 23:36   ` Peter Williams
     [not found] <894006121@toto.iv>
2004-03-01  0:00 ` Peter Chubb
2004-03-02  1:25   ` Peter Williams
     [not found] <fa.fi4j08o.17nchps@ifi.uio.no>
     [not found] ` <fa.ctat17m.8mqa3c@ifi.uio.no>
2004-02-29 11:58   ` Joachim B Haga
2004-02-29 20:39     ` Paul Jackson
2004-02-29 22:56     ` Peter Williams
     [not found] <1t8wp-qF-11@gated-at.bofh.it>
     [not found] ` <1th6J-az-13@gated-at.bofh.it>
     [not found]   ` <403E2929.2080705@tmr.com>
2004-02-27  3:44     ` Rik van Riel
2004-02-28 21:27       ` Bill Davidsen
2004-02-28 23:55         ` Peter Williams
2004-03-04 21:08           ` Timothy Miller
     [not found] <1tfy0-7ly-29@gated-at.bofh.it>
     [not found] ` <1thzJ-A5-13@gated-at.bofh.it>
     [not found]   ` <1tjrN-2m5-1@gated-at.bofh.it>
     [not found]     ` <1tjLa-2Ab-9@gated-at.bofh.it>
     [not found]       ` <1tlaf-3OY-11@gated-at.bofh.it>
     [not found]         ` <1tljX-3Wf-5@gated-at.bofh.it>
     [not found]           ` <1tznd-CP-35@gated-at.bofh.it>
     [not found]             ` <1tzQe-10s-25@gated-at.bofh.it>
2004-02-26 20:14               ` Bill Davidsen
     [not found] <fa.f12rt3d.c0s9rt@ifi.uio.no>
     [not found] ` <fa.ishajoq.q5g90m@ifi.uio.no>
2004-02-25 23:33   ` Junio C Hamano
2004-02-26  8:15     ` Catalin BOIE
  -- strict thread matches above, loose matches on Subject: below --
2004-02-25 14:35 John Lee
2004-02-25 17:09 ` Timothy Miller
2004-02-25 22:12   ` John Lee
2004-02-26  0:31     ` Timothy Miller
2004-02-26  2:04       ` John Lee
2004-02-26  2:18       ` Peter Williams
2004-02-26  2:42         ` Mike Fedyk
2004-02-26  4:10           ` Peter Williams
2004-02-26  4:19             ` Mike Fedyk
2004-02-26 19:23               ` Shailabh Nagar
2004-02-26 19:46                 ` Mike Fedyk
2004-02-26 20:42                   ` Shailabh Nagar
2004-02-26 16:10           ` Timothy Miller
2004-02-26 19:47             ` Mike Fedyk
2004-02-26 22:51             ` Peter Williams
2004-02-27 10:06               ` Helge Hafting
2004-02-27 11:04                 ` Peter Williams
2004-02-26 16:08         ` Timothy Miller
2004-02-26 16:51           ` Rik van Riel
2004-02-26 20:15           ` Peter Williams
2004-02-27 14:46             ` Timothy Miller
2004-02-28  5:00               ` Peter Williams
2004-03-04 21:18         ` Robert White
2004-03-04 23:15           ` Peter Williams
2004-02-26  2:48       ` Nuno Silva
2004-02-26  4:25         ` Peter Williams
2004-02-26 15:57           ` Rik van Riel
2004-02-26 19:28             ` Shailabh Nagar
2004-02-26 16:12         ` Timothy Miller
2004-02-25 22:51 ` Pavel Machek
2004-02-26  3:14   ` John Lee
2004-02-25 23:45 ` Rik van Riel
2004-02-26  7:18 ` John Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=403E8035.9020606@aurema.com \
    --to=peterw@aurema.com \
    --cc=albert@users.sf.net \
    --cc=johnl@aurema.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox