User: Password:
|
|
Subscribe / Log in / New account

Very poor underlying assumptions.

Very poor underlying assumptions.

Posted Nov 19, 2010 5:43 UTC (Fri) by naptastic (guest, #60139)
Parent article: TTY-based group scheduling

The user should know better than doing "make -j10" while trying to watch video, unless they have an 11-core CPU.

The problem isn't that the scheduler allocates time fairly; the problem is that the operating system sets all 10 children of make and the video player to the same priority. This is not a sane default. The Operating System should have an idea how much priority an application needs, and an end-user who doesn't know about .bashrc files shouldn't have to think about it. Make and its children should be reniced to 15 (for example) and totem should be reniced to -15 (for example) without any user intervention. Audio and video applications should have high priorities; Firefox, Thunderbird, Solitaire and OpenOffice should have medium priorities; video encoding and compilation should have low priorities by default.

If assigning arbitrary numbers to applications by category so they sort themselves out correctly seems crazy, remember that System V init has been doing it for years: every init script has a 2-digit number, and those numbers determine the order in which scripts are run.

A quick look at top on my system (Ubuntu 10.10) shows only 4 tasks with priorities != 1, and only 2 tasks with nice values != 0. Nice values and priorities are a simple tool that can solve these problems (assuming desktop preemption) so why aren't we using them? Cgroups are a great tool (killer feature!) but it seems like swatting a mosquito with a laser-guided rocket-propelled grenade launcher.

(Someday I want to try swatting a mosquito with a laser-guided rocket-propelled grenade launcher.)


(Log in to post comments)

OT : Mosquito

Posted Nov 19, 2010 18:50 UTC (Fri) by holstein (guest, #6122) [Link]

Sorry, can't resist (hey, it's friday!):

apparently, someone DID build something that uses laser to kill mosquito (no grenade though):

http://blog.makezine.com/archive/2010/09/make_23_how_to_s...

Besides,more on topic, the nice thing about this cgroup utilisation is that it's more or less automatic: no need to chase down pid to renice. Maybe both could be used together somehow?

tty-based scheduler grouping vs scheduler priorities

Posted Nov 20, 2010 1:10 UTC (Sat) by giraffedata (subscriber, #1954) [Link]

I don't know that you can say make is a generally a low-priority thing. When I type 'make' and am waiting for it to finish (which I expect to be in less than a minute), there's not much I'd like to see get CPU time before my make.

The video player is a special case, and there's a name for what it requires: real time scheduling. It's special because its correct execution is tied to the passage of real time. Well, we have real time scheduling facilities in Linux. Why doesn't the movie player program use them?

So the example in the article is probably not the best example of how the CTTY-based scheduling policy for non-realtime processes is good.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds