changing scheduling slice time

Patrick Wagstrom wagspat at iit.edu
Wed Dec 7 19:25:29 UTC 2005


So I've got a bit of an issue.  I've noticed that Ubuntu tends to force
a lot of context switches on the system, my breezy systems average about
2000 context switches a second (as reported by dstat) and around 1000
interrupts/s.  While this is good for creating a really responsive OS,
it's bad for some cases, at least I think so.

Specifically, the case I'm referring to is reading data from HDTV tuner
cards.  It appears that under Ubuntu, the large amount of context
switches don't allow programs to ever completely clear out the buffer.
Add in more tasks, the less likely it is to clear out the buffer.  This
isn't because of the load, more because the slices aren't long enough to
copy all of the data out of the buffer onto the disk.

When the system is under basically no load and the capture program is
the only thing running, it has no problem getting a perfect data stream.
However, if I start watching the stream at the same time as it's
recording, even if it never hits the disk, the increased task switching
and small time slice, causes the buffers to overfill.

As a reference, I performed a similar test under fedora core 4, which
averages to about 300 interrupts/s while idle and around 35 context
switches.  Even under heavy heavy load (copying lots of files, rendering
with pov-ray in the background, etc), it was able to keep up with no
problem.

So, can anyone tell me how to change the scheduling slice time in
Ubuntu?  I'd hate to have to abandon Ubuntu and set everything up again
with Fedora if it's just a matter of a kernel recompile or something
simple like that.

Thanks!

--Patrick
http://patrick.wagstrom.net/





More information about the ubuntu-users mailing list