Re: scheduler starvation running irman with 2.5.64bk2

Mike Galbraith (efault@gmx.de)
Mon, 10 Mar 2003 05:42:04 +0100


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-27991-1047271318-0001-2
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

At 09:50 PM 3/8/2003 -0500, rwhron@earthlink.net wrote:
>irman triggers some odd behavior with 2.5.64bk2 on uniprocessor
>K6/2 475. "ps aux" hasn't returned for a couple hours, though
>irman appears to be doing it's thing. I haven't tried irman on smp.

OK, can you do the following to determine whether we're both seeing the
_same_ problem?

1.) build the attached rtnice utility (don't remember who wrote/posted this)
2.) login on vt1 and set the shell SCHED_RR via rtnice -n 1 -p <pid_of_sh>
-d RR
3.) login on vt2 and renice that shell to -10
4.) login on another vt as a normal user, and start irman
5.) try login/out on another vt, or ps or _whatever_ (doesn't matter)
until box is starving
6.) on vt2, try to do ps (it should hang despite -10 priority)
7.) on vt1, try to do ps (it should work just fine)

cc to Ingo since stock .64 doesn't show this problem, and .64-combo and
.64-B2 do.

-Mike
--=_courier-27991-1047271318-0001-2
Content-Type: text/plain; name="rtnice.c"; x-mac-type=42494E41; x-mac-creator=74747874; charset=iso-8859-1
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="rtnice.c"

I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDx1bmlzdGQuaD4KI2luY2x1ZGUgPGdldG9wdC5o
PgojaW5jbHVkZSA8c3RyaW5nLmg+CiNpbmNsdWRlIDxzeXMvdHlwZXMuaD4KI2luY2x1ZGUgPHNj
aGVkLmg+CiNpbmNsdWRlIDxzeXMvdGltZS5oPgoKLyoKICogR3Jvc3MgaGFjaywganVzdCBpbiBj
YXNlIGdsaWJjIGlzbid0IHVwIHRvIGRhdGUgeWV0LgogKiAoaXQgd2Fzbid0IHdoZW4gU0NIRURf
SURMRSB3YXMgYWRkZWQgdG8gdGhlIGtlcm5lbCkKICovCiN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