Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 30 Jun 2002 20:27:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 30 Jun 2002 20:27:08 -0400 Received: from mx2.elte.hu ([157.181.151.9]:15234 "HELO mx2.elte.hu") by vger.kernel.org with SMTP id ; Sun, 30 Jun 2002 20:27:03 -0400 Date: Mon, 1 Jul 2002 02:26:42 +0200 (CEST) From: Ingo Molnar Reply-To: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds Subject: [announce] [patch] batch/idle priority scheduling, SCHED_BATCH Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="655623-882628228-1025483202=:11969" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 39780 Lines: 676 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-882628228-1025483202=:11969 Content-Type: TEXT/PLAIN; charset=US-ASCII the attached patch adds a feature that was pretty high on the scheduler features wishlist: it implements the functionality of SCHED_IDLE, in a safe way. Another desired scheduler feature was batch scheduling, the cache-friendly handling of lowprio, batch-like, CPU-bound, 100% noninteractive tasks. The new SCHED_BATCH scheduler policy implements both features. the existing SCHED_IDLE patches floating around, despite their simplicity, had one major flaw that prevented their integration into the scheduler: if an unpriviledged SCHED_IDLE process uses normal kernel functionality, which happens to grab a critical kernel resource such as the root directory's semaphore, and schedules away still holding the semaphore, then there is no guarantee that the task will run again in any deterministic amount of time - keeping the critical resource potentially forever - deadlocking every other process that attempts to use that critical resource. This property, while being a source for soft lockups even during ordinary use, also makes SCHED_IDLE an easy DoS exploit. as the size of the patch suggests, the safe solution is not simple. The basic concept is the identification of user-space preemption via a special scheduler upcall: one safe point to delay a task's execution indefinitely is when the task is preempted in pure user-space mode - if this happens then the lowlevel kernel entry code calls the schedule_userspace() function, instead of schedule(). In every other case the task needs to stay in the 'normal' scheduler queues, to guarantee prompt processing of kernelspace code. Furthermore, such batch-mode tasks need to be scheduled if they get a signal delivered - otherwise it would not be possible to eg. kill them. other properties: SCHED_BATCH also triggers much longer, batch-like timeslices - the default SCHED_BATCH timeslice is 1.5 seconds. Nice values still have a meaning for SCHED_BATCH processes as well - they determine the relative percentage of idle CPU time allocated to SCHED_BATCH processes. If the SCHED_BATCH process is in kernel-mode then the nice value is used as the normal priority when preempting (or not preempting) other, non-SCHED_BATCH processes. put in another way: whenever a SCHED_BATCH process is in kernel-mode, it's "elevated" into the SCHED_NORMAL priority domain - which guarantees timely execution of kernel-space code. When the SCHED_BATCH process is executing user-space code then it can be put into the batch-queue, and can be delayed indefinitely. Timeslice distribution is a modified/simplified version of SCHED_NORMAL scheduling: SCHED_BATCH processes are scheduled in a roundrobin way, timeslices are distributed based on the nice value. SCHED_BATCH tasks that use up their timeslices get suspended until all other SCHED_BATCH tasks on that CPU exhaust their timeslices - at which point a new turn begins. SCHED_NORMAL, SCHED_RR and SCHED_FIFO tasks preempt SCHED_BATCH processes immediately. All this functionality is implemented in an O(1) way. (The interactivity estimator is active for SCHED_BATCH processes as well - this has an effect if the task is in kernelspace mode. This also makes sure that no artificial priority boost can be achieved by switching in/out of SCHED_BATCH mode.) on SMP there are per-CPU batch queues - which enables the use of hundreds or thousands of SCHED_BATCH processes, if desired. A new, independent load-balancer is used to distribute SCHED_BATCH processes: SCHED_BATCH processes will populate CPUs depending on the CPU's "10 seconds history of idleness". The more idle a CPU, the more SCHED_BATCH processes it will handle. The weighting is done in a way to make the global distribution of SCHED_BATCH timeslices fair. The load-balancer also honors caching properties and tries to reduce unnecessery bouncing of SCHED_BATCH processes. (The balancing, like in the SCHED_NORMAL case, is not intended to be 100% 'sharp' - some statistical fuzziness is allowed to keep overhead and complexity down.) (to see the SMP SCHED_BATCH load-balancer in action, start up multiple SCHED_BATCH processes on an SMP box - they populate all available CPUs evenly. Then start up a single CPU-intensive, non-SCHED_BATCH process - after a few seconds all SCHED_BATCH processes will migrate off to the remaining CPUs, and the SCHED_NORMAL task will get 100% CPU time of a single CPU.) (design sidenote: initially i tried to integrate SCHED_BATCH scheduling into the existing scheduler and SCHED_NORMAL balancer somehow, but gave up on this idea. While that worked for RT scheduling, SCHED_BATCH scheduling is quite different, and is 100% orthogonal to all the other scheduling domains. Eg. the balancing of non-SCHED_BATCH processes *must not* be influenced by the way SCHED_BATCH processes are distributed amongst CPUs. The distribution of timeslices must be completely separated as well. So since all the queues and state has to be separate, they can as well be in separate (and simplified) data structures.) i've also attached setbatch.c, which is a simple utility to change a given PID's scheduling policy to SCHED_BATCH. One straightforward way of using it is to change one shell to be SCHED_BATCH: ./setbatch $$ and start various commands from this SCHED_BATCH shell - all forked children inherit the SCHED_BATCH setting. the load generated by multiple SCHED_BATCH processes does not show up in the load average - this is the straightforward solution to not confuse load-average-sensitive applications such as sendmail. the runtime performance impact of SCHED_BATCH is fairly minimal. There is a (pretty light) branch and function call cost in the entry.S preemption codepath. Otherwise the SCHED_BATCH code triggers in slowpaths only: eg. when we would otherwise switch to the idle thread. the patch was tested on x86 systems. non-x86 systems should still work with the patch applied, but no SCHED_BATCH process will in fact be suspended. For batch-suspension to work the architecture needs to call schedule_userspace() instead of schedule(), when pure userspace code is preempted. the attached patch is against 2.5.24, it was tested on SMP and UP systems as well, but keep in mind that this is the first version of this patch, so some rough edges might be present. The patch can also be downloaded from my scheduler patches homepage: http://redhat.com/~mingo/O(1)-scheduler/batch-sched-2.5.24-A0 bug reports, success reports, comments, suggestions are welcome, Ingo --655623-882628228-1025483202=:11969 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="batch-sched-2.5.24-A0" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="batch-sched-2.5.24-A0" LS0tIGxpbnV4L2FyY2gvaTM4Ni9rZXJuZWwvZW50cnkuUy5vcmlnCUZyaSBK dW4gMjggMTg6NDM6NDkgMjAwMg0KKysrIGxpbnV4L2F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Ugc3dpdGNoaW5nIGFzIHdlbGw6DQorCSAqLw0KKwlhdG9t aWNfaW5jKCZpbml0X21tLm1tX2NvdW50KTsNCisJZW50ZXJfbGF6eV90bGIo JmluaXRfbW0sIGN1cnJlbnQsIHNtcF9wcm9jZXNzb3JfaWQoKSk7DQorfQ0K Kw0KLS0tIGxpbnV4L2tlcm5lbC9leGl0LmMub3JpZwlGcmkgSnVuIDI4IDE5 OjM1OjA2IDIwMDINCisrKyBsaW51eC9rZXJuZWwvZXhpdC5jCU1vbiBKdWwg IDEgMDE6MjI6MzIgMjAwMg0KQEAgLTE4Miw3ICsxODIsNyBAQA0KIAljdXJy ZW50LT5leGl0X3NpZ25hbCA9IFNJR0NITEQ7DQogDQogCWN1cnJlbnQtPnB0 cmFjZSA9IDA7DQotCWlmICgoY3VycmVudC0+cG9saWN5ID09IFNDSEVEX09U SEVSKSAmJiAodGFza19uaWNlKGN1cnJlbnQpIDwgMCkpDQorCWlmICgoY3Vy cmVudC0+cG9saWN5ID09IFNDSEVEX05PUk1BTCkgJiYgKHRhc2tfbmljZShj dXJyZW50KSA8IDApKQ0KIAkJc2V0X3VzZXJfbmljZShjdXJyZW50LCAwKTsN CiAJLyogY3B1c19hbGxvd2VkPyAqLw0KIAkvKiBydF9wcmlvcml0eT8gKi8N Cg== --655623-882628228-1025483202=:11969 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="setbatch.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="setbatch.c" DQovKg0KICogU2V0IGEgZ2l2ZW4gUElEIHRvIGJlIGEgU0NIRURfQkFUQ0gg cHJvY2Vzcy4NCiAqIA0KICogQ29weXJpZ2h0IChDKSAyMDAyIEluZ28gTW9s bmFyDQogKi8NCiNpbmNsdWRlIDx0aW1lLmg+DQojaW5jbHVkZSA8c3RkaW8u aD4NCiNpbmNsdWRlIDxzY2hlZC5oPg0KI2luY2x1ZGUgPHN0ZGxpYi5oPg0K I2luY2x1ZGUgPHN5cy90eXBlcy5oPg0KI2luY2x1ZGUgPGxpbnV4L3VuaXN0 ZC5oPg0KDQppbnQgbWFpbiAoaW50IGFyZ2MsIGNoYXIgKiphcmd2KQ0Kew0K CWludCBwaWQsIHJldDsNCglzdHJ1Y3Qgc2NoZWRfcGFyYW0gcDsNCg0KCXAu c2NoZWRfcHJpb3JpdHkgPSAwOw0KDQoJaWYgKGFyZ2MgIT0gMikgew0KCQlw cmludGYoInVzYWdlOiBzZXRiYXRjaCA8cGlkPlxuIik7DQoJCWV4aXQoLTEp Ow0KCX0NCglwaWQgPSBhdG9sKGFyZ3ZbMV0pOw0KDQoJcmV0ID0gc2NoZWRf c2V0c2NoZWR1bGVyKHBpZCwgMywgJnApOw0KDQoJaWYgKHJldCkgew0KCQlw cmludGYoImNvdWxkIG5vdCBzZXQgcGlkICVkIHRvIFNDSEVEX0JBVENIOiBl cnIgJWQuXG4iLCBwaWQsIHJldCk7DQoJCXJldHVybiAtMTsNCgl9DQoJcHJp bnRmKCJwaWQgJWQgaXMgU0NIRURfQkFUQ0ggZnJvbSBub3cgb24uXG4iLCBw aWQpOw0KCXJldHVybiAwOw0KfQ0K --655623-882628228-1025483202=:11969-- - 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/