public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kernel thread scheduling question
@ 2004-03-30  4:13 Ben Greear
  2004-03-30  5:17 ` Nick Piggin
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Greear @ 2004-03-30  4:13 UTC (permalink / raw)
  To: linux-kernel

I have a kernel thread that I would like to have run at least
every 1-2 miliseconds.

I think I would be happy if there were a way to have the
process yield/schedule() at least once per ms with the
understanding that it would get to wake again 1-2ms later.
Is there a way to do such a thing without hacking up the
scheduler code?

I have tried 2.6.4 with pre-empt, and setting the thread priority
to -18, but I still see cases where the process is starved for 20+
milliseconds every 3-5 seconds or so.  Other than this single
process, there is not a big load on the system.

Any suggestions are welcome.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


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

* Re: kernel thread scheduling question
  2004-03-30  4:13 kernel thread scheduling question Ben Greear
@ 2004-03-30  5:17 ` Nick Piggin
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Piggin @ 2004-03-30  5:17 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-kernel

Ben Greear wrote:
> I have a kernel thread that I would like to have run at least
> every 1-2 miliseconds.
> 
> I think I would be happy if there were a way to have the
> process yield/schedule() at least once per ms with the
> understanding that it would get to wake again 1-2ms later.
> Is there a way to do such a thing without hacking up the
> scheduler code?
> 
> I have tried 2.6.4 with pre-empt, and setting the thread priority
> to -18, but I still see cases where the process is starved for 20+
> milliseconds every 3-5 seconds or so.  Other than this single
> process, there is not a big load on the system.
> 

Use realtime scheduling. sched_setscheduler (2) is a good
place to start.


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

end of thread, other threads:[~2004-03-30  5:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-30  4:13 kernel thread scheduling question Ben Greear
2004-03-30  5:17 ` Nick Piggin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox