/[pkg-src]/trunk/kernel26-magellan/patches-2.6.16-r6/0006-2.6.16-sched-add-above-background-load-function.patch |
Annotation of /trunk/kernel26-magellan/patches-2.6.16-r6/0006-2.6.16-sched-add-above-background-load-function.patch
Parent Directory | Revision Log
Revision 70 -
(hide annotations)
(download)
Thu May 11 19:09:22 2006 UTC (18 years, 4 months ago) by niro
File size: 4002 byte(s)
Thu May 11 19:09:22 2006 UTC (18 years, 4 months ago) by niro
File size: 4002 byte(s)
import
1 | niro | 70 | From akpm@osdl.org Tue Mar 14 12:58:59 2006 |
2 | Return-Path: <akpm@osdl.org> | ||
3 | X-Original-To: kernel@kolivas.org | ||
4 | Delivered-To: kernel@kolivas.org | ||
5 | Received: from bhhdoa.org.au (bhhdoa.org.au [65.98.99.88]) | ||
6 | by mail.kolivas.org (Postfix) with ESMTP id 92693C60BB | ||
7 | for <kernel@kolivas.org>; Tue, 14 Mar 2006 13:01:34 +1100 (EST) | ||
8 | Received: from smtp.osdl.org (smtp.osdl.org [65.172.181.4]) | ||
9 | by bhhdoa.org.au (Postfix) with ESMTP id 27D0B5172C | ||
10 | for <kernel@kolivas.org>; Tue, 14 Mar 2006 11:50:11 +1100 (EST) | ||
11 | Received: from shell0.pdx.osdl.net (fw.osdl.org [65.172.181.6]) | ||
12 | by smtp.osdl.org (8.12.8/8.12.8) with ESMTP id k2E21NDZ010803 | ||
13 | (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); | ||
14 | Mon, 13 Mar 2006 18:01:24 -0800 | ||
15 | Received: from localhost.localdomain (shell0.pdx.osdl.net [10.9.0.31]) | ||
16 | by shell0.pdx.osdl.net (8.13.1/8.11.6) with ESMTP id k2E21NZ2004594; | ||
17 | Mon, 13 Mar 2006 18:01:23 -0800 | ||
18 | Message-Id: <200603140201.k2E21NZ2004594@shell0.pdx.osdl.net> | ||
19 | Subject: + sched-add-above-background-load-function.patch added to -mm tree | ||
20 | To: kernel@kolivas.org, | ||
21 | mingo@elte.hu, | ||
22 | pwil3058@bigpond.net.au, | ||
23 | mm-commits@vger.kernel.org | ||
24 | From: akpm@osdl.org | ||
25 | Date: Mon, 13 Mar 2006 17:58:59 -0800 | ||
26 | X-Spam-Status: No, hits=1.584 required=5 tests=MAILTO_TO_SPAM_ADDR,NO_REAL_NAME | ||
27 | X-Spam-Level: * | ||
28 | X-Spam-Checker-Version: SpamAssassin 2.63-osdl_revision__1.68__ | ||
29 | X-MIMEDefang-Filter: osdl$Revision: 1.1 $ | ||
30 | X-Scanned-By: MIMEDefang 2.36 | ||
31 | X-DSPAM-Result: Whitelisted | ||
32 | X-DSPAM-Confidence: 0.9997 | ||
33 | X-DSPAM-Probability: 0.0000 | ||
34 | X-DSPAM-Signature: 4416240067813302711738 | ||
35 | X-DSPAM-Factors: 27, | ||
36 | detect+patch, 0.00010, | ||
37 | X-Spam-Status*MAILTO+TO, 0.00010, | ||
38 | X-Spam-Status*ADDR+NO, 0.00010, | ||
39 | niced, 0.00010, | ||
40 | sched+add, 0.00010, | ||
41 | sched+add, 0.00010, | ||
42 | sched+extern, 0.00010, | ||
43 | Subject*load, 0.00010, | ||
44 | is+sched, 0.00010, | ||
45 | sched+cleanup, 0.00010, | ||
46 | au+Signed, 0.00010, | ||
47 | X-Spam-Status*tests+MAILTO, 0.00010, | ||
48 | sched+implement, 0.00010, | ||
49 | smpnice+patch, 0.00010, | ||
50 | To*org+mingo, 0.00010, | ||
51 | noninteractive+use, 0.00010, | ||
52 | load+per, 0.00010, | ||
53 | alter+uninterruptible, 0.00010, | ||
54 | puN+include, 0.00010, | ||
55 | blkdev, 0.00010, | ||
56 | To*au+mm, 0.00010, | ||
57 | akpm+include, 0.00010, | ||
58 | in+sched, 0.00010, | ||
59 | type+patch, 0.00010, | ||
60 | X-Spam-Status*TO, 0.00010, | ||
61 | activated+patch, 0.00010, | ||
62 | X-Spam-Status*ADDR, 0.00010 | ||
63 | X-Length: 4732 | ||
64 | X-KMail-EncryptionState: N | ||
65 | X-KMail-SignatureState: N | ||
66 | X-KMail-MDN-Sent: | ||
67 | Content-Type: | ||
68 | X-UID: 9775 | ||
69 | |||
70 | |||
71 | The patch titled | ||
72 | |||
73 | sched: add above background load function | ||
74 | |||
75 | has been added to the -mm tree. Its filename is | ||
76 | |||
77 | sched-add-above-background-load-function.patch | ||
78 | |||
79 | See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find | ||
80 | out what to do about this | ||
81 | |||
82 | |||
83 | From: Con Kolivas <kernel@kolivas.org> | ||
84 | |||
85 | Add an above_background_load() function which can be used by other | ||
86 | subsystems to detect if there is anything besides niced tasks running. | ||
87 | Place it in sched.h to allow it to be compiled out if not used. | ||
88 | |||
89 | Signed-off-by: Con Kolivas <kernel@kolivas.org> | ||
90 | Acked-by: Ingo Molnar <mingo@elte.hu> | ||
91 | Cc: Peter Williams <pwil3058@bigpond.net.au> | ||
92 | Signed-off-by: Andrew Morton <akpm@osdl.org> | ||
93 | include/linux/sched.h | 16 ++++++++++++++++ | ||
94 | 1 files changed, 16 insertions(+) | ||
95 | |||
96 | Index: linux-2.6.16-ck1/include/linux/sched.h | ||
97 | =================================================================== | ||
98 | --- linux-2.6.16-ck1.orig/include/linux/sched.h 2006-03-20 20:46:46.000000000 +1100 | ||
99 | +++ linux-2.6.16-ck1/include/linux/sched.h 2006-03-20 20:46:47.000000000 +1100 | ||
100 | @@ -643,6 +643,22 @@ extern unsigned int max_cache_size; | ||
101 | |||
102 | #endif /* CONFIG_SMP */ | ||
103 | |||
104 | +/* | ||
105 | + * A runqueue laden with a single nice 0 task scores a weighted_cpuload of | ||
106 | + * SCHED_LOAD_SCALE. This function returns 1 if any cpu is laden with a | ||
107 | + * task of nice 0 or enough lower priority tasks to bring up the | ||
108 | + * weighted_cpuload | ||
109 | + */ | ||
110 | +static inline int above_background_load(void) | ||
111 | +{ | ||
112 | + unsigned long cpu; | ||
113 | + | ||
114 | + for_each_online_cpu(cpu) { | ||
115 | + if (weighted_cpuload(cpu) >= SCHED_LOAD_SCALE) | ||
116 | + return 1; | ||
117 | + } | ||
118 | + return 0; | ||
119 | +} | ||
120 | |||
121 | struct io_context; /* See blkdev.h */ | ||
122 | void exit_io_context(void); |