Re: [patch] SCHED_SOFTRR starve-free linux scheduling policy

Mike Galbraith (efault@gmx.de)
Mon, 14 Jul 2003 09:11:39 +0200


This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_courier-17121-1058166495-0001-2
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

At 02:51 PM 7/13/2003 -0700, Davide Libenzi wrote:

>This should (hopefully) avoid other tasks starvation exploits :
>
>http://www.xmailserver.org/linux-patches/softrr.html

Yes, that ~works. I couldn't starve root to death as a SCHED_SOFTRR user,
but the system was very sluggish, with keystrokes taking uncomfortably
long. I also had some sound skips due to inheritance. If I activate
xmms's gl visualization under load, it inherits SCHED_SOFTRR, says "oink"
in a very deep voice, and other xmms threads expire. Maybe tasks shouldn't
inherit SCHED_SOFTRR?

While testing, I spotted something pretty strange. It's not specific to
SCHED_SOFTRR, SCHED_RR causes it too. If I fire up xmms's gl visualization
with either policy, X stops getting enough sleep credit to stay at a usable
priority even when cpu usage is low. Fully repeatable weirdness. See
attached top snapshots.

-Mike
--=_courier-17121-1058166495-0001-2
Content-Type: application/octet-stream; name=xx
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="xx"

LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tIEFiYnkgTm9ybWFsIC0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLQp0b3AgLSAwNTo0NDoyMCB1cCAgMToyNywgIDQgdXNlcnMsICBsb2Fk
IGF2ZXJhZ2U6IDMuOTMsIDQuNzEsIDUuMDAKVGFza3M6ICA4MyB0b3RhbCwgICA0IHJ1bm5pbmcs
ICA3OSBzbGVlcGluZywgICAwIHN0b3BwZWQsICAgMCB6b21iaWUKQ3B1KHMpOiAgOTAuNSUgdXNl
ciwgICA5LjUlIHN5c3RlbSwgICAwLjAlIG5pY2UsICAgMC4wJSBpZGxlLCAgIDAuMCUgSU8td2Fp
dApNZW06ICAgIDEyNTcxMmsgd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gaW5pdAogICAgMiByb290ICAgICAgMzQgIDE5ICAgICAwICAgIDAgICAgMCBT
ICAwLjAgIDAuMCAgIDA6MDAuMDAga3NvZnRpcnFkLzAKICAgIDMgcm9vdCAgICAgICA1IC0xMCAg
ICAgMCAgICAwICAgIDAgUyAgMC4wICAwLjAgICAwOjAwLjI4IGV2ZW50cy8wCiAgICA0IHJvb3Qg
ICAgICAgNSAtMTAgICAgIDAgICAgMCAgICAwIFMgIDAuMCAgMC4wICAgMDowMC4yOSBrYmxvY2tk
LzAKICAgIDUgcm9vdCAgICAgIDE1ICAgMCAgICAgMCAgICAwICAgIDAgUyAgMC4wICAwLjAgICAw
OjAwLjIyIGthcG1kCiAgICA2IHJvb3QgICAgICAxNSAgIDAgICAgIDAgICAgMCAgICAwIFMgIDAu
MCAgMC4wICAgMDowMC4wMCBwZGZsdXNoCiAgICA3IHJvb3QgICAgICAxNSAgIDAgICAgIDAgICAg
MCAgICAwIFMgIDAuMCAgMC4wICAgMDowMC4zNSBwZGZsdXNoCiAgICA4IHJvb3QgICAgICAxNSAg
IDAgICAgIDAgICAgMCAgICAwIFMgIDAuMCAgMC4wICAgMDowMS4wMiBrc3dhcGQwCgo=
--=_courier-17121-1058166495-0001-2--