All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: gradual timeofday overhaul
@ 2004-10-21  8:32 Perez-Gonzalez, Inaky
  2004-10-21 21:17 ` George Anzinger
  0 siblings, 1 reply; 17+ messages in thread
From: Perez-Gonzalez, Inaky @ 2004-10-21  8:32 UTC (permalink / raw)
  To: root, George Anzinger; +Cc: Brown, Len, Tim Schmielau, john stultz, lkml


> From: Richard B. Johnson
>
> You need that hardware interrupt for more than time-keeping.
> Without a hardware-interrupt, to force a new time-slice,
> 
>  	for(;;)
>             ;
> 
> ... would allow a user to grab the CPU forever ...

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.

Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own (and my fault)

^ permalink raw reply	[flat|nested] 17+ messages in thread
* RE: gradual timeofday overhaul
@ 2004-10-22  0:29 Perez-Gonzalez, Inaky
  0 siblings, 0 replies; 17+ messages in thread
From: Perez-Gonzalez, Inaky @ 2004-10-22  0:29 UTC (permalink / raw)
  To: george; +Cc: root, Brown, Len, Tim Schmielau, john stultz, lkml

> From: George Anzinger [mailto:george@mvista.com]
>
> > 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?
> 
> ???  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.

As I said, I was talking out of my ass [aka, I didn't know and was just 
guesstimating for the heck of it], so I am happily proven wrong--thanks to
Chris and you--I guess I didn't take into account voluntary yielding of
the CPU by a task; I was more guiding myself for kicked out by a timer
making a task runnable, or a timeslice expiring, etc...which now are 
more or less guided by the tick [and then of course, we have IRQs,
but that's another matter]

> ...
> 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.

Once my logic is proven wrong, then it makes full sense :]

Thanks for the heads up.

Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own (and my fault)

^ permalink raw reply	[flat|nested] 17+ messages in thread
* RE: gradual timeofday overhaul
@ 2004-10-21 21:32 Perez-Gonzalez, Inaky
  2004-10-21 22:36 ` Chris Friesen
  2004-10-22  0:21 ` George Anzinger
  0 siblings, 2 replies; 17+ messages in thread
From: Perez-Gonzalez, Inaky @ 2004-10-21 21:32 UTC (permalink / raw)
  To: george; +Cc: root, Brown, Len, Tim Schmielau, john stultz, lkml

> 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.

- 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].

> 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].

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? 

Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own (and my fault)

^ permalink raw reply	[flat|nested] 17+ messages in thread
* process start time set wrongly at boot for kernel 2.6.9
@ 2004-10-19 18:21 Jerome Borsboom
  2004-10-19 20:11 ` john stultz
  0 siblings, 1 reply; 17+ messages in thread
From: Jerome Borsboom @ 2004-10-19 18:21 UTC (permalink / raw)
  To: linux-kernel

Starting with kernel 2.6.9 the process start time is set wrongly for 
processes that get started early in the boot process. Below is a dump from 
my 'ps' command. Note the start time for processes 1-12. After process 12 
the start time is set right.

Jerome


USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1  1372  500 ?        S    20:59   0:00 init [3] 
root         2  0.0  0.0     0    0 ?        SN   20:59   0:00 [ksoftirqd/0]
root         3  0.0  0.0     0    0 ?        S<   20:59   0:00 [events/0]
root         4  0.0  0.0     0    0 ?        S<   20:59   0:00 [khelper]
root         5  0.0  0.0     0    0 ?        S<   20:59   0:00 [kblockd/0]
root         6  0.0  0.0     0    0 ?        S    20:59   0:00 [pdflush]
root         7  0.0  0.0     0    0 ?        S    20:59   0:00 [pdflush]
root         9  0.0  0.0     0    0 ?        S<   20:59   0:00 [aio/0]
root         8  0.0  0.0     0    0 ?        S    20:59   0:00 [kswapd0]
root        10  0.0  0.0     0    0 ?        S    20:59   0:00 [kseriod]
root        11  0.0  0.0     0    0 ?        S    20:59   0:00 [scsi_eh_0]
root        12  0.0  0.0     0    0 ?        S    20:59   0:00 [ahc_dv_0]
root        13  0.0  0.0     0    0 ?        S    19:48   0:00 [scsi_eh_1]
root        14  0.0  0.0     0    0 ?        S    19:48   0:00 [ahc_dv_1]
root        15  0.0  0.0     0    0 ?        S    19:48   0:00 [scsi_eh_2]
root        16  0.0  0.0     0    0 ?        S    19:48   0:00 [ahc_dv_2]
root        17  0.0  0.0     0    0 ?        S    19:49   0:00 [kjournald]
root        43  0.0  0.0     0    0 ?        S    19:49   0:00 [kjournald]
root        44  0.0  0.0     0    0 ?        S    19:49   0:00 [kjournald]
root        45  0.0  0.0     0    0 ?        S    19:49   0:00 [kjournald]
root        46  0.0  0.0     0    0 ?        S    19:49   0:00 [kjournald]
root        47  0.0  0.0     0    0 ?        S    19:49   0:00 [kjournald]
root        48  0.0  0.0     0    0 ?        S    19:49   0:00 [kjournald]
root       122  0.0  0.2  1420  552 ?        Ss   19:49   0:00 /sbin/syslogd -m 0
root       124  0.0  0.1  1376  452 ?        Ss   19:49   0:00 /sbin/klogd
root       131  0.0  0.3  1640  776 ?        Ss   19:49   0:00 /sbin/apcupsd
root       139  0.0  0.9  2444 2444 ?        SLs  19:49   0:00 /usr/bin/ntpd
ldap       148  0.0  1.8 50084 4696 ?        Ssl  19:49   0:00 /usr/sbin/slapd -4 -u ldap -h ldap:/// ldapi:///
nscd       153  0.0  0.6 10208 1640 ?        Ssl  19:49   0:00 /usr/sbin/nscd
root       162  0.0  0.5  3156 1392 ?        Ss   19:49   0:00 /usr/sbin/sshd
root       168  0.0  0.9  5396 2436 ?        Ss   19:49   0:00 sendmail: accepting connections 
smmsp      173  0.0  0.8  5176 2144 ?        Ss   19:49   0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
root       177  0.0  0.2  1372  564 ?        Ss   19:49   0:00 /usr/sbin/cron

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2004-10-26  4:21 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-21  8:32 gradual timeofday overhaul 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
  -- strict thread matches above, loose matches on Subject: below --
2004-10-22  0:29 Perez-Gonzalez, Inaky
2004-10-21 21:32 Perez-Gonzalez, Inaky
2004-10-21 22:36 ` Chris Friesen
2004-10-22  0:21 ` George Anzinger
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.