From akpm@osdl.org Tue Mar 14 12:58:59 2006 Return-Path: X-Original-To: kernel@kolivas.org Delivered-To: kernel@kolivas.org Received: from bhhdoa.org.au (bhhdoa.org.au [65.98.99.88]) by mail.kolivas.org (Postfix) with ESMTP id 92693C60BB for ; Tue, 14 Mar 2006 13:01:34 +1100 (EST) Received: from smtp.osdl.org (smtp.osdl.org [65.172.181.4]) by bhhdoa.org.au (Postfix) with ESMTP id 27D0B5172C for ; Tue, 14 Mar 2006 11:50:11 +1100 (EST) Received: from shell0.pdx.osdl.net (fw.osdl.org [65.172.181.6]) by smtp.osdl.org (8.12.8/8.12.8) with ESMTP id k2E21NDZ010803 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 13 Mar 2006 18:01:24 -0800 Received: from localhost.localdomain (shell0.pdx.osdl.net [10.9.0.31]) by shell0.pdx.osdl.net (8.13.1/8.11.6) with ESMTP id k2E21NZ2004594; Mon, 13 Mar 2006 18:01:23 -0800 Message-Id: <200603140201.k2E21NZ2004594@shell0.pdx.osdl.net> Subject: + sched-add-above-background-load-function.patch added to -mm tree To: kernel@kolivas.org, mingo@elte.hu, pwil3058@bigpond.net.au, mm-commits@vger.kernel.org From: akpm@osdl.org Date: Mon, 13 Mar 2006 17:58:59 -0800 X-Spam-Status: No, hits=1.584 required=5 tests=MAILTO_TO_SPAM_ADDR,NO_REAL_NAME X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 2.63-osdl_revision__1.68__ X-MIMEDefang-Filter: osdl$Revision: 1.1 $ X-Scanned-By: MIMEDefang 2.36 X-DSPAM-Result: Whitelisted X-DSPAM-Confidence: 0.9997 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 4416240067813302711738 X-DSPAM-Factors: 27, detect+patch, 0.00010, X-Spam-Status*MAILTO+TO, 0.00010, X-Spam-Status*ADDR+NO, 0.00010, niced, 0.00010, sched+add, 0.00010, sched+add, 0.00010, sched+extern, 0.00010, Subject*load, 0.00010, is+sched, 0.00010, sched+cleanup, 0.00010, au+Signed, 0.00010, X-Spam-Status*tests+MAILTO, 0.00010, sched+implement, 0.00010, smpnice+patch, 0.00010, To*org+mingo, 0.00010, noninteractive+use, 0.00010, load+per, 0.00010, alter+uninterruptible, 0.00010, puN+include, 0.00010, blkdev, 0.00010, To*au+mm, 0.00010, akpm+include, 0.00010, in+sched, 0.00010, type+patch, 0.00010, X-Spam-Status*TO, 0.00010, activated+patch, 0.00010, X-Spam-Status*ADDR, 0.00010 X-Length: 4732 X-KMail-EncryptionState: N X-KMail-SignatureState: N X-KMail-MDN-Sent: Content-Type: X-UID: 9775 The patch titled sched: add above background load function has been added to the -mm tree. Its filename is sched-add-above-background-load-function.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this From: Con Kolivas Add an above_background_load() function which can be used by other subsystems to detect if there is anything besides niced tasks running. Place it in sched.h to allow it to be compiled out if not used. Signed-off-by: Con Kolivas Acked-by: Ingo Molnar Cc: Peter Williams Signed-off-by: Andrew Morton include/linux/sched.h | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) Index: linux-2.6.16-ck1/include/linux/sched.h =================================================================== --- linux-2.6.16-ck1.orig/include/linux/sched.h 2006-03-20 20:46:46.000000000 +1100 +++ linux-2.6.16-ck1/include/linux/sched.h 2006-03-20 20:46:47.000000000 +1100 @@ -643,6 +643,22 @@ extern unsigned int max_cache_size; #endif /* CONFIG_SMP */ +/* + * A runqueue laden with a single nice 0 task scores a weighted_cpuload of + * SCHED_LOAD_SCALE. This function returns 1 if any cpu is laden with a + * task of nice 0 or enough lower priority tasks to bring up the + * weighted_cpuload + */ +static inline int above_background_load(void) +{ + unsigned long cpu; + + for_each_online_cpu(cpu) { + if (weighted_cpuload(cpu) >= SCHED_LOAD_SCALE) + return 1; + } + return 0; +} struct io_context; /* See blkdev.h */ void exit_io_context(void);