summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/linux/linux-netbook-2.6.33.2/linux-2.6.34-ondemand-fix-6-7.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/linux/linux-netbook-2.6.33.2/linux-2.6.34-ondemand-fix-6-7.patch')
-rw-r--r--meta/recipes-kernel/linux/linux-netbook-2.6.33.2/linux-2.6.34-ondemand-fix-6-7.patch122
1 files changed, 122 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-netbook-2.6.33.2/linux-2.6.34-ondemand-fix-6-7.patch b/meta/recipes-kernel/linux/linux-netbook-2.6.33.2/linux-2.6.34-ondemand-fix-6-7.patch
new file mode 100644
index 0000000000..fb30105929
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-netbook-2.6.33.2/linux-2.6.34-ondemand-fix-6-7.patch
@@ -0,0 +1,122 @@
1>From c4dd11703034f2ecbc3180603663fab14c292d7c Mon Sep 17 00:00:00 2001
2From: Arjan van de Ven <arjan@linux.intel.com>
3Date: Sun, 18 Apr 2010 10:57:43 -0700
4Subject: [PATCH 6/7] sched: introduce get_cpu_iowait_time_us()
5Patch-mainline: in -mm tree as of 19 Apr 2010
6
7For the ondemand cpufreq governor, it is desired that the iowait
8time is microaccounted in a similar way as idle time is.
9
10This patch introduces the infrastructure to account and expose
11this information via the get_cpu_iowait_time_us() function.
12
13Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
14---
15 include/linux/tick.h | 4 ++++
16 kernel/time/tick-sched.c | 28 ++++++++++++++++++++++++++++
17 kernel/time/timer_list.c | 1 +
18 3 files changed, 33 insertions(+), 0 deletions(-)
19
20diff --git a/include/linux/tick.h b/include/linux/tick.h
21index 0343eed..4aa3703 100644
22--- a/include/linux/tick.h
23+++ b/include/linux/tick.h
24@@ -42,6 +42,7 @@ enum tick_nohz_mode {
25 * @idle_waketime: Time when the idle was interrupted
26 * @idle_exittime: Time when the idle state was left
27 * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped
28+ * @iowait_sleeptime: Sum of the time slept in idle with sched tick stopped, with IO outstanding
29 * @sleep_length: Duration of the current idle sleep
30 * @do_timer_lst: CPU was the last one doing do_timer before going idle
31 */
32@@ -60,6 +61,7 @@ struct tick_sched {
33 ktime_t idle_waketime;
34 ktime_t idle_exittime;
35 ktime_t idle_sleeptime;
36+ ktime_t iowait_sleeptime;
37 ktime_t sleep_length;
38 unsigned long last_jiffies;
39 unsigned long next_jiffies;
40@@ -123,6 +125,7 @@ extern void tick_nohz_stop_sched_tick(int inidle);
41 extern void tick_nohz_restart_sched_tick(void);
42 extern ktime_t tick_nohz_get_sleep_length(void);
43 extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time);
44+extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time);
45 # else
46 static inline void tick_nohz_stop_sched_tick(int inidle) { }
47 static inline void tick_nohz_restart_sched_tick(void) { }
48@@ -133,6 +136,7 @@ static inline ktime_t tick_nohz_get_sleep_length(void)
49 return len;
50 }
51 static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; }
52+static inline u64 get_cpu_iowait(int cpu, u64 *unused) { return -1; }
53 # endif /* !NO_HZ */
54
55 #endif
56diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
57index 326f5f8..a6104a8 100644
58--- a/kernel/time/tick-sched.c
59+++ b/kernel/time/tick-sched.c
60@@ -161,6 +161,8 @@ update_ts_time_stats(struct tick_sched *ts, ktime_t now, u64 *last_update_time)
61 if (ts->idle_active) {
62 delta = ktime_sub(now, ts->idle_entrytime);
63 ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta);
64+ if (nr_iowait_cpu() > 0)
65+ ts->iowait_sleeptime = ktime_add(ts->iowait_sleeptime, delta);
66 ts->idle_entrytime = now;
67 }
68
69@@ -220,6 +222,32 @@ u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time)
70 }
71 EXPORT_SYMBOL_GPL(get_cpu_idle_time_us);
72
73+/*
74+ * get_cpu_iowait_time_us - get the total iowait time of a cpu
75+ * @cpu: CPU number to query
76+ * @last_update_time: variable to store update time in
77+ *
78+ * Return the cummulative iowait time (since boot) for a given
79+ * CPU, in microseconds.
80+ *
81+ * This time is measured via accounting rather than sampling,
82+ * and is as accurate as ktime_get() is.
83+ *
84+ * This function returns -1 if NOHZ is not enabled.
85+ */
86+u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time)
87+{
88+ struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
89+
90+ if (!tick_nohz_enabled)
91+ return -1;
92+
93+ update_ts_time_stats(ts, ktime_get(), last_update_time);
94+
95+ return ktime_to_us(ts->iowait_sleeptime);
96+}
97+EXPORT_SYMBOL_GPL(get_cpu_iowait_time_us);
98+
99 /**
100 * tick_nohz_stop_sched_tick - stop the idle tick from the idle task
101 *
102diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
103index 1a4a7dd..ab8f5e3 100644
104--- a/kernel/time/timer_list.c
105+++ b/kernel/time/timer_list.c
106@@ -176,6 +176,7 @@ static void print_cpu(struct seq_file *m, int cpu, u64 now)
107 P_ns(idle_waketime);
108 P_ns(idle_exittime);
109 P_ns(idle_sleeptime);
110+ P_ns(iowait_sleeptime);
111 P(last_jiffies);
112 P(next_jiffies);
113 P_ns(idle_expires);
114--
1151.6.2.5
116
117--
118To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
119the body of a message to majordomo@vger.kernel.org
120More majordomo info at http://vger.kernel.org/majordomo-info.html
121Please read the FAQ at http://www.tux.org/lkml/
122