All of lore.kernel.org
 help / color / mirror / Atom feed
* High Resolution Timer DOS
@ 2007-04-28 21:53 matthieu castet
  2007-04-28 22:13 ` Thomas Gleixner
  0 siblings, 1 reply; 7+ messages in thread
From: matthieu castet @ 2007-04-28 21:53 UTC (permalink / raw)
  To: Linux Kernel list

Hi,

some programs need to do some short of busyloop. It was often 
implemented as :

while (1) {
	if (can_do_stuff) {
		do_stuff();
	}
	else
		//sleep a very short of time
		usleep(1);
}

usleep(1) or equivalent where used instead of sched_yield, because of 
some priority issue. IIRC doing sched_yield, make the process appears 
like an interactive process, so it has better priority and get call more 
often.

But now if high res timer are enabled, these programs while cause 
something like a DOS : the context switch per second will be bigger than 
500 000 and the cpu usage will be very high.


I don't know if such problem are already know, but I believe a warning 
about such issues should be in the Kconfig description.


Matthieu

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

end of thread, other threads:[~2007-04-29 16:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-28 21:53 High Resolution Timer DOS matthieu castet
2007-04-28 22:13 ` Thomas Gleixner
2007-04-28 22:37   ` Lee Revell
2007-04-28 22:45     ` William Heimbigner
2007-04-29  7:17     ` Ingo Molnar
2007-04-29 16:08       ` matthieu castet
2007-04-29 16:42         ` Ingo Molnar

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.