Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964827AbWAIPwq (ORCPT ); Mon, 9 Jan 2006 10:52:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964838AbWAIPwq (ORCPT ); Mon, 9 Jan 2006 10:52:46 -0500 Received: from mail.gmx.net ([213.165.64.21]:26322 "HELO mail.gmx.net") by vger.kernel.org with SMTP id S964827AbWAIPwp (ORCPT ); Mon, 9 Jan 2006 10:52:45 -0500 X-Authenticated: #14349625 Message-Id: <5.2.1.1.2.20060109162113.00ba9fd0@pop.gmx.net> X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Mon, 09 Jan 2006 16:52:17 +0100 To: Paolo Ornati From: Mike Galbraith Subject: Re: [SCHED] wrong priority calc - SIMPLE test case Cc: Linux Kernel Mailing List , Con Kolivas , Ingo Molnar , Nick Piggin , Peter Williams In-Reply-To: <5.2.1.1.2.20060109112238.00be96f8@pop.gmx.net> References: <5.2.1.1.2.20060102092903.00bde090@pop.gmx.net> <20060101123902.27a10798@localhost> <5.2.1.1.2.20051231162352.00bda610@pop.gmx.net> <5.2.1.1.2.20051231090255.00bede00@pop.gmx.net> <200512281027.00252.kernel@kolivas.org> <20051227190918.65c2abac@localhost> <20051227224846.6edcff88@localhost> <200512281027.00252.kernel@kolivas.org> <5.2.1.1.2.20051231090255.00bede00@pop.gmx.net> <5.2.1.1.2.20051231162352.00bda610@pop.gmx.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====================_34618609==_" X-Antivirus: avast! (VPS 0601-0, 01/02/2006), Outbound message X-Antivirus-Status: Clean X-Y-GMX-Trusted: 0 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 14197 Lines: 215 --=====================_34618609==_ Content-Type: text/plain; charset="us-ascii"; format=flowed At 12:11 PM 1/9/2006 +0100, Mike Galbraith wrote: >Care to try an experiment?... Oops. I guess I should send one that's not mixed p1 and p0. Sorry about that :-/ Anyway, if anyone wants to see a functional demonstration, just try this. Remove the TASK_NONINTERACTIVE in fs/pipe.c in both the stock kernel and this modified one so Davide Libenzi's excellent sleep pattern exploit (irman2) can work [1], and do the below all at the same time ... make -j4 bzImage irman2 thud 3 With the stock kernel, I got bored after a half an hour, and stopped the kernel build. It had produced 40 .o files. The modified kernel finished in 20 minutes vs the 8 minutes it took to produce the same 504 .o files if not under load. -Mike 1. it just so happens that Davide wrote irman2 using pipes... he could have done something else. if anyone doesn't think this is a fair test, just use Paolo's much simpler exploit instead. the result will be about the same. --=====================_34618609==_ Content-Type: application/octet-stream; name="sched_throttle" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="sched_throttle" LS0tIGxpbnV4LTIuNi4xNS9pbmNsdWRlL2xpbnV4L3NjaGVkLmgub3JnCVR1ZSBKYW4gIDMgMDk6 MjY6NTAgMjAwNgorKysgbGludXgtMi42LjE1L2luY2x1ZGUvbGludXgvc2NoZWQuaAlTYXQgSmFu ICA3IDE0OjQ1OjM3IDIwMDYKQEAgLTcwMSw4ICs3MDEsOCBAQAogCiAJdW5zaWduZWQgc2hvcnQg aW9wcmlvOwogCi0JdW5zaWduZWQgbG9uZyBzbGVlcF9hdmc7Ci0JdW5zaWduZWQgbG9uZyBsb25n IHRpbWVzdGFtcCwgbGFzdF9yYW47CisJdW5zaWduZWQgbG9uZyBzbGVlcF9hdmcsIHNsaWNlX2F2 ZzsKKwl1bnNpZ25lZCBsb25nIGxvbmcgdGltZXN0YW1wLCBsYXN0X3JhbiwgbGFzdF9zbGljZTsK IAl1bnNpZ25lZCBsb25nIGxvbmcgc2NoZWRfdGltZTsgLyogc2NoZWRfY2xvY2sgdGltZSBzcGVu dCBydW5uaW5nICovCiAJaW50IGFjdGl2YXRlZDsKIAotLS0gbGludXgtMi42LjE1L2tlcm5lbC9z Y2hlZC5jLm9yZwlTYXQgSmFuICA3IDE2OjIyOjEzIDIwMDYKKysrIGxpbnV4LTIuNi4xNS9rZXJu ZWwvc2No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BAQAogCQkJCXVubGlrZWx5 KHNpZ25hbF9wZW5kaW5nKHByZXYpKSkpCiAJCQlwcmV2LT5zdGF0ZSA9IFRBU0tfUlVOTklORzsK IAkJZWxzZSB7Ci0JCQlpZiAocHJldi0+c3RhdGUgPT0gVEFTS19VTklOVEVSUlVQVElCTEUpCisJ CQlpZiAocHJldi0+c3RhdGUgJiBUQVNLX1VOSU5URVJSVVBUSUJMRSkKIAkJCQlycS0+bnJfdW5p bnRlcnJ1cHRpYmxlKys7CiAJCQlkZWFjdGl2YXRlX3Rhc2socHJldiwgcnEpOwogCQl9CkBAIC0z MDk1LDYgKzMxMzMsMTMgQEAKIAlwcmV2LT5zbGVlcF9hdmcgLT0gcnVuX3RpbWU7CiAJaWYgKChs b25nKXByZXYtPnNsZWVwX2F2ZyA8PSAwKQogCQlwcmV2LT5zbGVlcF9hdmcgPSAwOworCWlmIChw cmV2LT5zdGF0ZSAmIChUQVNLX0lOVEVSUlVQVElCTEV8VEFTS19VTklOVEVSUlVQVElCTEUpICYm CisJCQlwcmV2LT5zbGVlcF9hdmcgPiBwcmV2LT5zbGljZV9hdmcgKyAoTlNfTUFYX1NMRUVQX0FW Ry8xMCkgJiYKKwkJCSFydF90YXNrKHByZXYpKQorCQlwcmV2LT5zdGF0ZSB8PSBUQVNLX05PTklO VEVSQUNUSVZFOworCWlmICghcnRfdGFzayhuZXh0KSAmJiAhKG5leHQtPnRpbWVfc2xpY2UgJSBE RUZfVElNRVNMSUNFKSkKKwkJbmV4dC0+bGFzdF9zbGljZSA9IG5vdzsKKwogCXByZXYtPnRpbWVz dGFtcCA9IHByZXYtPmxhc3RfcmFuID0gbm93OwogCiAJc2NoZWRfaW5mb19zd2l0Y2gocHJldiwg bmV4dCk7Cg== --=====================_34618609==_ Content-Type: text/plain; name="irman2.c"; x-mac-type="42494E41"; x-mac-creator="74747874" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="irman2.c" LyoKICogIGlybWFuIGJ5IERhdmlkZSBMaWJ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dyaXRlKHBpcGVzWzIgKiBpICsgMV0sICJzIiwgMSk7CgoJd2hpbGUg KC0tcnVuX3NlY3MpCgkJc2xlZXAoMSk7CglzaWduYWxfYWxsKFNJR0tJTEwpOwoJZXhpdCgwKTsK fQoK --=====================_34618609==_ Content-Type: text/plain; name="thud.c"; x-mac-type="42494E41"; x-mac-creator="74747874" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="thud.c" LyogdGh1ZC5jICovCgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPHN0ZGxpYi5oPgojaW5j bHVkZSA8dW5pc3RkLmg+CiNpbmNsdWRlIDxzeXMvdGltZS5oPgojaW5jbHVkZSA8dGltZS5oPgoj aW5jbHVkZSA8c2NoZWQuaD4KCi8qIFRoZXNlIGFyZSB1c2VkIGFzIHN0cmluZ3Mgc28gdGhhdCBz dHJjbXAgY2FuIGJlIHVzZWQgYXMgYSBkZWxheSBsb29wICovCmNoYXIgKnMxLCAqczI7CgovKiAy MDAwMCBpcyBmaW5lIG9uIG15IDMzM01IeiBDZWxlcm9uLiBBZGp1c3Qgc28gdGhhdCBzeXN0ZW0g dGltZSBpcyBub3QKICAgZXhjZXNzaXZlICovCiNkZWZpbmUgREVMQVkgMjAwMDAKCnZvaWQgYnVz eV93YWl0KGxvbmcgc2VjLCBsb25nIHVzZWMpCnsKICBzdHJ1Y3QgdGltZXZhbCB0djsKICBsb25n IGxvbmcgZW5kX3VzZWM7CiAgZ2V0dGltZW9mZGF5KCZ0diwwKTsKICBlbmRfdXNlYz0obG9uZyBs b25nKShzZWMrdHYudHZfc2VjKSoxMDAwMDAwICsgdHYudHZfdXNlYyt1c2VjOwogIHdoaWxlICgo KGxvbmcgbG9uZyl0di50dl9zZWMqMTAwMDAwMCArIHR2LnR2X3VzZWMpIDwgZW5kX3VzZWMpCiAg ewogICAgZ2V0dGltZW9mZGF5KCZ0diwwKTsKI2lmIDEgLyogTUlLRURJRElUICovCiAgICBzdHJj bXAoczEsczIpOyAvKiB5dWNrICovCiNlbHNlCiAgICBzY2hlZF95aWVsZCgpOwojZW5kaWYKICB9 Cn0KCmludCBtYWluKGludCBhcmdjLCBjaGFyKiphcmd2KQp7CiAgc3RydWN0IHRpbWVzcGVjIHN0 PXsxMCw1MDAwMDAwMH07CiAgaW50IG49REVMQVk7CiAgaW50IHBhcmVudD0xOwoKICBpZiAoYXJn YzwyKSB7ZnByaW50ZihzdGRlcnIsIlN5bnRheDogdGh1ZCA8Y2hpbGRyZW4+XG4iKTsgcmV0dXJu IDA7IH0KCiAgczE9bWFsbG9jKG4pOwogIHMyPW1hbGxvYyhuKTsKICBtZW1zZXQoczEsMzMsbik7 CiAgbWVtc2V0KHMyLDMzLG4pOwogIHMxW24tMV09MDsKICBzMltuLTFdPTA7CgogIG49YXRvaShh cmd2WzFdKTsKICBmcHJpbnRmKHN0ZGVyciwic3RhcnRpbmcgJWQgY2hpbGRyZW5cbiIsbik7CiAg Zm9yICg7IG4+MDsgbi0tKQogICAgaWYgKGZvcmsoKT09MCkgeyBzY2hlZF95aWVsZCgpOyBwYXJl bnQ9MDsgYnJlYWs7IH0KICB3aGlsZSAoMSkKICB7CiAgICBuYW5vc2xlZXAoJnN0LCAwKTsKICAg IGlmIChwYXJlbnQpIHByaW50ZigicnVubmluZy4uLiIpOwogICAgaWYgKHBhcmVudCkgZmZsdXNo KHN0ZG91dCk7CiAgICBidXN5X3dhaXQoNiwwKTsKICAgIGlmIChwYXJlbnQpIHByaW50ZigiZG9u ZVxuIik7CiAgfQogIHJldHVybiAwOwp9Cg== --=====================_34618609==_-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/