/[pkg-src]/trunk/kernel26-magellan/patches-2.6.16-r12/0005-2.6.16-sched-add-discrete-weighted-cpu-load-function.patch |
Annotation of /trunk/kernel26-magellan/patches-2.6.16-r12/0005-2.6.16-sched-add-discrete-weighted-cpu-load-function.patch
Parent Directory | Revision Log
Revision 72 -
(hide annotations)
(download)
Mon Jun 5 09:25:38 2006 UTC (18 years, 3 months ago) by niro
File size: 4755 byte(s)
Mon Jun 5 09:25:38 2006 UTC (18 years, 3 months ago) by niro
File size: 4755 byte(s)
ver bump to 2.6.16-r12: - updated to linux-2.6.16.19 - updated to ck11
1 | niro | 72 | From akpm@osdl.org Tue Mar 14 12:58:09 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 51798C60BB | ||
7 | for <kernel@kolivas.org>; Tue, 14 Mar 2006 13:24:22 +1100 (EST) | ||
8 | Received: from smtp.osdl.org (smtp.osdl.org [65.172.181.4]) | ||
9 | by bhhdoa.org.au (Postfix) with ESMTP id ED72351721 | ||
10 | for <kernel@kolivas.org>; Tue, 14 Mar 2006 11:49:21 +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 k2E20XDZ010745 | ||
13 | (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); | ||
14 | Mon, 13 Mar 2006 18:00:33 -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 k2E20Xmt004571; | ||
17 | Mon, 13 Mar 2006 18:00:33 -0800 | ||
18 | Message-Id: <200603140200.k2E20Xmt004571@shell0.pdx.osdl.net> | ||
19 | Subject: + sched-add-discrete-weighted-cpu-load-function.patch added to -mm tree | ||
20 | To: kernel@kolivas.org, | ||
21 | mingo@elte.hu, | ||
22 | mm-commits@vger.kernel.org | ||
23 | From: akpm@osdl.org | ||
24 | Date: Mon, 13 Mar 2006 17:58:09 -0800 | ||
25 | X-Spam-Status: No, hits=1.088 required=5 tests=NO_REAL_NAME | ||
26 | X-Spam-Level: * | ||
27 | X-Spam-Checker-Version: SpamAssassin 2.63-osdl_revision__1.68__ | ||
28 | X-MIMEDefang-Filter: osdl$Revision: 1.1 $ | ||
29 | X-Scanned-By: MIMEDefang 2.36 | ||
30 | X-DSPAM-Result: Whitelisted | ||
31 | X-DSPAM-Confidence: 0.9997 | ||
32 | X-DSPAM-Probability: 0.0000 | ||
33 | X-DSPAM-Signature: 4416295b68281074099396 | ||
34 | X-DSPAM-Factors: 27, | ||
35 | detect+patch, 0.00010, | ||
36 | hu+Signed, 0.00010, | ||
37 | cpus+and, 0.00010, | ||
38 | group+cpumask, 0.00010, | ||
39 | group+cpumask, 0.00010, | ||
40 | int+task, 0.00010, | ||
41 | sched+add, 0.00010, | ||
42 | sched+add, 0.00010, | ||
43 | on+runqueue, 0.00010, | ||
44 | sched+extern, 0.00010, | ||
45 | idlest, 0.00010, | ||
46 | Subject*load, 0.00010, | ||
47 | load+max, 0.00010, | ||
48 | load+max, 0.00010, | ||
49 | is+sched, 0.00010, | ||
50 | runqueue+find, 0.00010, | ||
51 | sched+cleanup, 0.00010, | ||
52 | cpus+allowed, 0.00010, | ||
53 | sched+implement, 0.00010, | ||
54 | smpnice+patch, 0.00010, | ||
55 | To*org+mingo, 0.00010, | ||
56 | Subject*load+function, 0.00010, | ||
57 | noninteractive+use, 0.00010, | ||
58 | load+per, 0.00010, | ||
59 | nr+uninterruptible, 0.00010, | ||
60 | alter+uninterruptible, 0.00010, | ||
61 | puN+include, 0.00010 | ||
62 | X-Length: 5468 | ||
63 | X-KMail-EncryptionState: N | ||
64 | X-KMail-SignatureState: N | ||
65 | X-KMail-MDN-Sent: | ||
66 | Content-Type: | ||
67 | X-UID: 9778 | ||
68 | |||
69 | |||
70 | The patch titled | ||
71 | |||
72 | sched: add discrete weighted cpu load function | ||
73 | |||
74 | has been added to the -mm tree. Its filename is | ||
75 | |||
76 | sched-add-discrete-weighted-cpu-load-function.patch | ||
77 | |||
78 | See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find | ||
79 | out what to do about this | ||
80 | |||
81 | |||
82 | From: Con Kolivas <kernel@kolivas.org> | ||
83 | |||
84 | When the type of weighting is known to be zero we can use a simpler version | ||
85 | of source_load with a weighted_cpuload() function. Export that function to | ||
86 | allow relative weighted cpu load to be used by other subsystems if desired. | ||
87 | |||
88 | Signed-off-by: Con Kolivas <kernel@kolivas.org> | ||
89 | Acked-by: Ingo Molnar <mingo@elte.hu> | ||
90 | Signed-off-by: Andrew Morton <akpm@osdl.org> | ||
91 | include/linux/sched.h | 1 + | ||
92 | kernel/sched.c | 10 ++++++++-- | ||
93 | 2 files changed, 9 insertions(+), 2 deletions(-) | ||
94 | |||
95 | Index: linux-2.6.16-ck1/include/linux/sched.h | ||
96 | =================================================================== | ||
97 | --- linux-2.6.16-ck1.orig/include/linux/sched.h 2006-03-20 20:46:46.000000000 +1100 | ||
98 | +++ linux-2.6.16-ck1/include/linux/sched.h 2006-03-20 20:46:46.000000000 +1100 | ||
99 | @@ -100,6 +100,7 @@ extern int nr_processes(void); | ||
100 | extern unsigned long nr_running(void); | ||
101 | extern unsigned long nr_uninterruptible(void); | ||
102 | extern unsigned long nr_iowait(void); | ||
103 | +extern unsigned long weighted_cpuload(const int cpu); | ||
104 | |||
105 | #include <linux/time.h> | ||
106 | #include <linux/param.h> | ||
107 | Index: linux-2.6.16-ck1/kernel/sched.c | ||
108 | =================================================================== | ||
109 | --- linux-2.6.16-ck1.orig/kernel/sched.c 2006-03-20 20:46:46.000000000 +1100 | ||
110 | +++ linux-2.6.16-ck1/kernel/sched.c 2006-03-20 20:46:46.000000000 +1100 | ||
111 | @@ -919,6 +919,12 @@ inline int task_curr(const task_t *p) | ||
112 | return cpu_curr(task_cpu(p)) == p; | ||
113 | } | ||
114 | |||
115 | +/* Used instead of source_load when we know the type == 0 */ | ||
116 | +unsigned long weighted_cpuload(const int cpu) | ||
117 | +{ | ||
118 | + return cpu_rq(cpu)->raw_weighted_load; | ||
119 | +} | ||
120 | + | ||
121 | #ifdef CONFIG_SMP | ||
122 | typedef struct { | ||
123 | struct list_head list; | ||
124 | @@ -1119,7 +1125,7 @@ find_idlest_cpu(struct sched_group *grou | ||
125 | cpus_and(tmp, group->cpumask, p->cpus_allowed); | ||
126 | |||
127 | for_each_cpu_mask(i, tmp) { | ||
128 | - load = source_load(i, 0); | ||
129 | + load = weighted_cpuload(i); | ||
130 | |||
131 | if (load < min_load || (load == min_load && i == this_cpu)) { | ||
132 | min_load = load; | ||
133 | @@ -2184,7 +2190,7 @@ static runqueue_t *find_busiest_queue(st | ||
134 | int i; | ||
135 | |||
136 | for_each_cpu_mask(i, group->cpumask) { | ||
137 | - load = source_load(i, 0); | ||
138 | + load = weighted_cpuload(i); | ||
139 | |||
140 | if (load > max_load) { | ||
141 | max_load = load; |