linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: George Anzinger <george@mvista.com>
To: "Perez-Gonzalez, Inaky" <inaky.perez-gonzalez@intel.com>
Cc: root@chaos.analogic.com, "Brown, Len" <len.brown@intel.com>,
	Tim Schmielau <tim@physik3.uni-rostock.de>,
	john stultz <johnstul@us.ibm.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: gradual timeofday overhaul
Date: Thu, 21 Oct 2004 17:21:27 -0700	[thread overview]
Message-ID: <41785287.7080503@mvista.com> (raw)
In-Reply-To: <F989B1573A3A644BAB3920FBECA4D25A011F96DC@orsmsx407>

Perez-Gonzalez, Inaky wrote:
>>From: George Anzinger [mailto:george@mvista.com]
>>
>>Perez-Gonzalez, Inaky wrote:
>>
>>
>>>But you can also schedule, before switching to the new task,
>>>a local interrupt on the running processor to mark the end
>>>of the timeslice. When you enter the scheduler, you just need
>>>to remove that; devil is in the details, but it should be possible
>>>to do in a way that doesn't take too much overhead.
>>
>>Well, that is part of the accounting overhead the increases with context switch
>>rate.  You also need to include the time it takes to figure out which of the
>>time limits is closes (run time limit, profile time, slice time, etc).  Then,
> 
> 
> I know these are specific examples, but:
> 
> - profile time is a periodic thingie, so if you have it, forget about
>   having a tickless system. Periodic interrupt for this guy, get it 
>   out of the equation.

Not really.  It is only active if the task is running.  At the very least the 
scheduler needs to check to see if it is on and, if so, set up a timer for it.
> 
> - slice time vs runtime limit. I don't remember what is the granularity of
>   the runtime limit, but it could be expressed in slice terms. If not,
>   we are talking (along with any other times) of min() operations, which
>   are just a few cycles each [granted, they add up].

The main issue here is accumulating the run time which is accounting work that 
needs to happen on context switch (out in this case).
> 
> 
>>you also need to remove the timer when switching away.  No, it is not a lot, but
>>it is way more than the nothing we do when we can turn it all over to the
>>periodic tick.  The choice is load sensitive overhead vs flat overhead.
> 
> 
> This is just talking out of my ass, but I guess that for each invocation
> they will have more or less the same overhead in execution time, let's
> say T. For the periodic tick, the total overhead (in a second) is T*HZ;
> with tickless, it'd be T*number_of_context_switches_per_second, right?
> 
> Now, the ugly case would be if number_of_context_swiches_per_second > HZ.
> In HZ = 100, this could be happening, but in HZ=1000, in a single CPU
> ...well, that would be TOO weird [of course, a real-time app with a 
> 1ms period would do that, but it'd require at least an HZ of 10000 to
> work more or less ok and we'd be below the watermark].

???  Better look again.  Context switches can and do happen as often as 10 or so 
micro seconds (depends a lot on the cpu speed).  I admit this is with code that 
is just trying to measure the context switch time, but, often the system will 
change it mind just that fast.
> 
> So in most cases, and given the assumptions, we'd end up winning,
> beause number_of_context..., even if variable, is going to be bound
> on the upper side by HZ.
> 
> Well, you know way more than I do about this, so here is the question:
> what is the error in that line of reasoning? 

The expected number of context switches.  In some real world apps it gets rather 
high.  The cross over of your two curves _might_ be of interest to some (it is 
rather low by my measurements, done with the tickless patch that is still on 
sourceforge).  On the other hand, where I come from, a system which has 
increasing overhead with load is one that is going to overload.  We are always 
better off if we can figure a way to have fixed overhead.

As for the idle system ticks, I think the VST stuff we are working on is the 
right answer.

-- 
George Anzinger   george@mvista.com
High-res-timers:  http://sourceforge.net/projects/high-res-timers/


  parent reply	other threads:[~2004-10-22  0:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-21 21:32 gradual timeofday overhaul Perez-Gonzalez, Inaky
2004-10-21 22:36 ` Chris Friesen
2004-10-22  0:21 ` George Anzinger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-10-22  0:29 Perez-Gonzalez, Inaky
2004-10-21  8:32 Perez-Gonzalez, Inaky
2004-10-21 21:17 ` George Anzinger
2004-10-21 22:40   ` Chris Friesen
2004-10-25 23:12     ` George Anzinger
2004-10-25 23:51       ` Chris Friesen
2004-10-19 18:21 process start time set wrongly at boot for kernel 2.6.9 Jerome Borsboom
2004-10-19 20:11 ` john stultz
2004-10-20  0:42   ` Tim Schmielau
2004-10-20  0:59     ` john stultz
2004-10-20  3:05       ` gradual timeofday overhaul Tim Schmielau
2004-10-20  7:47         ` Len Brown
2004-10-20 15:09           ` George Anzinger
2004-10-20 15:59             ` Richard B. Johnson
2004-10-20 15:17           ` George Anzinger
2004-10-20 17:09           ` Lee Revell
2004-10-20 21:42             ` Len Brown
2004-10-20 18:13         ` john stultz

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=41785287.7080503@mvista.com \
    --to=george@mvista.com \
    --cc=inaky.perez-gonzalez@intel.com \
    --cc=johnstul@us.ibm.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.com \
    --cc=tim@physik3.uni-rostock.de \
    /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;
as well as URLs for NNTP newsgroup(s).