Prioritize apps for resource allocation

Registered by Sergey "Shnatsel" Davidoff on 2011-09-28

Nowadays we have all kinds of new shiny schedulers popping up now and then. They are told to increase performance under certain workloads. People seem to forget that schedulers work well only when they know which processes should be real-time and which are no way urgent, but usually nobody supplies that info to them. Remember music player hiccups during system updates? That’s exactly the issue - music player must play music in real time because it’s useless without that, and update-manager should never interrupt your workflow.

Solution? Simple: tell the scheduler who is who.

Blueprint information

Status:
Started
Approver:
None
Priority:
Undefined
Drafter:
Sergey "Shnatsel" Davidoff
Direction:
Approved
Assignee:
Sergey "Shnatsel" Davidoff
Definition:
New
Series goal:
None
Implementation:
Blocked
Milestone target:
None
Started by
Sergey "Shnatsel" Davidoff on 2012-04-20

Related branches

Sprints

Whiteboard

LoL, how can we implement that?? --gotwig

LoL, read the full specs before commenting!! --shnatsel

You should take a look at Verynice (http://thermal.cnde.iastate.edu/~sdh4/verynice/), a daemon for dynamically adjusting the nice levels of executables. Also, there's Ulatencyd (https://github.com/poelzi/ulatencyd/), a daemon that controls how the Linux kernel will spend it's resources on the running processes. It uses dynamic cgroups to give the kernel hints and limitations on processes. --blitux

Wow, thanks a lot for the info! Added to the performance spec and linked there from this one. Looks like I really suck at googling recently... ~shnatsel

Thanks shnatsel, I forgot to mention the sources. This https://wiki.archlinux.org/index.php/Maximizing_Performance article on Archlinux Wiki is very instructive about maximizing performance. I know the goal is the best user experience. You can get some valuable info there, though I guess not all tips can be applicable. ~blitux

I'm working on this, looks like ulatencyd is what we need. I've expanded its configs and proposed them upstream: https://github.com/poelzi/ulatencyd/pull/32 ~shnatsel

We're past the feature freeze and there isn't enough time to test the implications of such a big change to resource management. We should delay this to Luna +1 and concentrate on getting Luna out the door. ~DanRabbit.

I can't see why it's a big change personally. I've got the configs tested and ready for landing. I'll do one more round of testing on my Pentium III laptop just to be sure ulantencyd doesn't gobble up resources; if there will be ussues with it in beta, we can always revert it. --shnatsel

Custom configs have landed to testing PPA as "ulatencyd-configs-elementary" package. -
-shnatsel

One way would be to watch if the sound device is accessed. That could be done with "inotify". -- ikem

ulatencyd and custom configs are included in seeds and is be shipped in today's unstable ISO build.
I don't get what the sound device has to do with this blueprint... ~shnatsel

The video/music player needs high priority to work flawlessly. The easiest way to check if they are run is to see if something is accessing the sound card. -- ikem

They're routed through pulseaudio anyway, it's the only thing accessing the sound card. And there may be other things playing sounds, like IM clients with their notifications. I'm sure ulatencyd is sufficient. ~shnatsel

We're now blocked by bug 1034099 ~shnatsel

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.