Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 16 Jun 2002 13:03:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 16 Jun 2002 13:03:18 -0400 Received: from mx1.elte.hu ([157.181.1.137]:48278 "HELO mx1.elte.hu") by vger.kernel.org with SMTP id ; Sun, 16 Jun 2002 13:03:14 -0400 Date: Sun, 16 Jun 2002 19:00:43 +0200 (CEST) From: Ingo Molnar Reply-To: Ingo Molnar To: Alan Cox Cc: "David S. Miller" , , Subject: [patch] 2.4.19-pre10-ac2: O(1) scheduler merge, -A3. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="655623-1782464326-1024244390=:9633" Content-ID: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 33038 Lines: 569 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --655623-1782464326-1024244390=:9633 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: the attached patch, sched-2.4.19-pre10-ac2-A3, is a backport of the current 2.5 O(1) scheduler, against 2.4.19-pre10-ac2. The patch includes all the recent fixes. (It should not break any architecture that was working before on -ac. The most affected architecture is Sparc64, i added the bits without testing them. David?) The patch can also be downloaded from: http://redhat.com/~mingo/O(1)-scheduler/sched-2.4.19-pre10-ac2-A3 Changes relative to 2.4.19-pre10-ac2: Bugfixes: - rq-frozen fixes, which closes SMP races on x86 and Sparc64 as well. - O(1) scheduling sched_yield() fixes: do not starve CPU-intensive processes. - migration bugfix, do not fast-migrate the task incorrectly if the task is in the middle of load_balance(). - sync wakeup reintroduction - this should fix the pipe latency problems observed. Feature backports: - nr_uninterruptible optimization. (This is a fairly straightforward and risk-less feature, and since it also made the backport easier, i included it.) - sched_setaffinity() & sched_getaffinity() syscalls on x86. plus identity changes, comment updates, to bring sched.c in line with the 2.5 version. the patch was tested on x86 UP and SMP boxes. Ingo --655623-1782464326-1024244390=:9633 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="sched-2.4.19-pre10-ac2-A3" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="sched-2.4.19-pre10-ac2-A3" LS0tIGxpbnV4L2ZzL3BpcGUuYy5vcmlnCVN1biBKdW4gMTYgMTg6NDY6NDUg MjAwMg0KKysrIGxpbnV4L2ZzL3BpcGUuYwlTdW4gSnVuIDE2IDE4OjQ3OjE0 IDIwMDINCkBAIC0xMTUsNyArMTE1LDcgQEANCiAJCSAqIHdyaXRlcnMgc3lu Y2hyb25vdXNseSB0aGF0IHRoZXJlIGlzIG1vcmUNCiAJCSAqIHJvb20uDQog CQkgKi8NCi0JCXdha2VfdXBfaW50ZXJydXB0aWJsZShQSVBFX1dBSVQoKmlu b2RlKSk7DQorCQl3YWtlX3VwX2ludGVycnVwdGlibGVfc3luYyhQSVBFX1dB SVQoKmlub2RlKSk7DQogCQlpZiAoIVBJUEVfRU1QVFkoKmlub2RlKSkNCiAJ CQlCVUcoKTsNCiAJCWdvdG8gZG9fbW9yZV9yZWFkOw0KQEAgLTIxNSw3ICsy MTUsNyBAQA0KIAkJCSAqIGlzIGdvaW5nIHRvIGdpdmUgdXAgdGhpcyBDUFUs IHNvIGl0IGRvZXNudCBoYXZlDQogCQkJICogdG8gZG8gaWRsZSByZXNjaGVk dWxlcy4NCiAJCQkgKi8NCi0JCQl3YWtlX3VwX2ludGVycnVwdGlibGUoUElQ RV9XQUlUKCppbm9kZSkpOw0KKwkJCXdha2VfdXBfaW50ZXJydXB0aWJsZV9z eW5jKFBJUEVfV0FJVCgqaW5vZGUpKTsNCiAJCQlQSVBFX1dBSVRJTkdfV1JJ VEVSUygqaW5vZGUpKys7DQogCQkJcGlwZV93YWl0KGlub2RlKTsNCiAJCQlQ SVBFX1dBSVRJTkdfV1JJVEVSUygqaW5vZGUpLS07DQotLS0gbGludXgva2Vy bmV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mcgU1lNQk9MX05BTUUoc3lzX25pX3N5c2NhbGwp CS8qIHJlc2VydmVkIGZvciBzY2hlZF9zZXRhZmZpbml0eSAqLw0KLQkubG9u ZyBTWU1CT0xfTkFNRShzeXNfbmlfc3lzY2FsbCkJLyogcmVzZXJ2ZWQgZm9y IHNjaGVkX2dldGFmZmluaXR5ICovDQorCS5sb25nIFNZTUJPTF9OQU1FKHN5 c19zY2hlZF9zZXRhZmZpbml0eSkNCisJLmxvbmcgU1lNQk9MX05BTUUoc3lz X3NjaGVkX2dldGFmZmluaXR5KQ0KIA0KIAkucmVwdCBOUl9zeXNjYWxscy0o Li1zeXNfY2FsbF90YWJsZSkvNA0KIAkJLmxvbmcgU1lNQk9MX05BTUUoc3lz X25pX3N5c2NhbGwpDQo= --655623-1782464326-1024244390=:9633-- - 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/