Annotation of /trunk/kernel26-magellan/patches-2.6.29-r1/0302-2.6.29-powertop-fixes-2.patch
Parent Directory | Revision Log
Revision 759 -
(hide annotations)
(download)
Thu Apr 23 19:48:34 2009 UTC (15 years ago) by niro
File size: 4559 byte(s)
Thu Apr 23 19:48:34 2009 UTC (15 years ago) by niro
File size: 4559 byte(s)
-2.6.29-magellan-r1: - linux-2.6.29.1 - fbcondecor-0.9.6 - dropped squashfs; version 4.0 is upstream - unionfs-2.5.1 - linux-phc-0.3.1 - reiserfs4 re-diffed - dropped atl2; driver is upstream - tuxonice-3.0.1 - powertop fixes re-diffed
1 | niro | 759 | From e6f2ff1e4763212f1dcc945db76fb744b951ac53 Mon Sep 17 00:00:00 2001 |
2 | From: Josh Triplett <josh@freedesktop.org> | ||
3 | Date: Sun, 13 May 2007 15:21:39 -0700 | ||
4 | Subject: [PATCH] Lengthen and align background timers to decrease wakeups | ||
5 | |||
6 | This patch changes a few background timers in the Linux kernel to | ||
7 | 1) be aligned to full seconds so that multiple timers get handled in one | ||
8 | processor wakeup | ||
9 | 2) have longer timeouts for those timers that can use such longer timeouts | ||
10 | |||
11 | Some of these are a bit crude, but it's effective. | ||
12 | |||
13 | Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> | ||
14 | [Josh: Updates for 2.6.22-rc1] | ||
15 | Signed-off-by: Josh Triplett <josh@kernel.org> | ||
16 | --- | ||
17 | kernel/time/clocksource.c | 10 ++++++++-- | ||
18 | mm/page-writeback.c | 8 ++++---- | ||
19 | mm/slab.c | 6 +++--- | ||
20 | net/core/neighbour.c | 4 ++-- | ||
21 | 4 files changed, 17 insertions(+), 11 deletions(-) | ||
22 | |||
23 | diff -Naur linux-2.6.29/kernel/time/clocksource.c linux-2.6.29-magellan/kernel/time/clocksource.c | ||
24 | --- linux-2.6.29/kernel/time/clocksource.c 2009-03-24 00:12:14.000000000 +0100 | ||
25 | +++ linux-2.6.29-magellan/kernel/time/clocksource.c 2009-04-23 20:24:07.000000000 +0200 | ||
26 | @@ -79,11 +79,17 @@ | ||
27 | /* | ||
28 | * Interval: 0.5sec Threshold: 0.0625s | ||
29 | */ | ||
30 | -#define WATCHDOG_INTERVAL (HZ >> 1) | ||
31 | +#define WATCHDOG_INTERVAL (HZ*10) | ||
32 | #define WATCHDOG_THRESHOLD (NSEC_PER_SEC >> 4) | ||
33 | |||
34 | +static int secondtime; | ||
35 | + | ||
36 | static void clocksource_ratewd(struct clocksource *cs, int64_t delta) | ||
37 | { | ||
38 | + if (!secondtime) { | ||
39 | + secondtime = 1; | ||
40 | + return; | ||
41 | + }; | ||
42 | if (delta > -WATCHDOG_THRESHOLD && delta < WATCHDOG_THRESHOLD) | ||
43 | return; | ||
44 | |||
45 | @@ -150,7 +156,7 @@ | ||
46 | |||
47 | if (next_cpu >= nr_cpu_ids) | ||
48 | next_cpu = cpumask_first(cpu_online_mask); | ||
49 | - watchdog_timer.expires += WATCHDOG_INTERVAL; | ||
50 | + round_jiffies(watchdog_timer.expires + WATCHDOG_INTERVAL)); | ||
51 | add_timer_on(&watchdog_timer, next_cpu); | ||
52 | } | ||
53 | spin_unlock(&watchdog_lock); | ||
54 | diff -Naur linux-2.6.29/mm/page-writeback.c linux-2.6.29-magellan/mm/page-writeback.c | ||
55 | --- linux-2.6.29/mm/page-writeback.c 2009-04-23 20:25:15.000000000 +0200 | ||
56 | +++ linux-2.6.29-magellan/mm/page-writeback.c 2009-04-23 20:20:46.000000000 +0200 | ||
57 | @@ -94,7 +94,7 @@ | ||
58 | /* | ||
59 | * The interval between `kupdate'-style writebacks, in jiffies | ||
60 | */ | ||
61 | -int dirty_writeback_interval = 5 * HZ; | ||
62 | +int dirty_writeback_interval = 15 * HZ; | ||
63 | |||
64 | /* | ||
65 | * The longest number of jiffies for which data is allowed to remain dirty | ||
66 | @@ -773,7 +773,7 @@ | ||
67 | |||
68 | oldest_jif = jiffies - dirty_expire_interval; | ||
69 | start_jif = jiffies; | ||
70 | - next_jif = start_jif + dirty_writeback_interval; | ||
71 | + next_jif = round_jiffies(start_jif + dirty_writeback_interval); | ||
72 | nr_to_write = global_page_state(NR_FILE_DIRTY) + | ||
73 | global_page_state(NR_UNSTABLE_NFS) + | ||
74 | (inodes_stat.nr_inodes - inodes_stat.nr_unused); | ||
75 | @@ -791,7 +791,7 @@ | ||
76 | nr_to_write -= MAX_WRITEBACK_PAGES - wbc.nr_to_write; | ||
77 | } | ||
78 | if (time_before(next_jif, jiffies + HZ)) | ||
79 | - next_jif = jiffies + HZ; | ||
80 | + next_jif = round_jiffies(jiffies + HZ); | ||
81 | if (dirty_writeback_interval) | ||
82 | mod_timer(&wb_timer, next_jif); | ||
83 | } | ||
84 | @@ -813,7 +813,7 @@ | ||
85 | static void wb_timer_fn(unsigned long unused) | ||
86 | { | ||
87 | if (pdflush_operation(wb_kupdate, 0) < 0) | ||
88 | - mod_timer(&wb_timer, jiffies + HZ); /* delay 1 second */ | ||
89 | + mod_timer(&wb_timer, round_jiffies(jiffies + HZ)); /* delay 1 second */ | ||
90 | } | ||
91 | |||
92 | static void laptop_flush(unsigned long unused) | ||
93 | diff -Naur linux-2.6.29/mm/slab.c linux-2.6.29-magellan/mm/slab.c | ||
94 | --- linux-2.6.29/mm/slab.c 2009-03-24 00:12:14.000000000 +0100 | ||
95 | +++ linux-2.6.29-magellan/mm/slab.c 2009-04-23 20:20:46.000000000 +0200 | ||
96 | @@ -464,8 +464,8 @@ | ||
97 | * OTOH the cpuarrays can contain lots of objects, | ||
98 | * which could lock up otherwise freeable slabs. | ||
99 | */ | ||
100 | -#define REAPTIMEOUT_CPUC (2*HZ) | ||
101 | -#define REAPTIMEOUT_LIST3 (4*HZ) | ||
102 | +#define REAPTIMEOUT_CPUC (12*HZ) | ||
103 | +#define REAPTIMEOUT_LIST3 (20*HZ) | ||
104 | |||
105 | #if STATS | ||
106 | #define STATS_INC_ACTIVE(x) ((x)->num_active++) | ||
107 | @@ -944,7 +944,7 @@ | ||
108 | init_reap_node(cpu); | ||
109 | INIT_DELAYED_WORK(reap_work, cache_reap); | ||
110 | schedule_delayed_work_on(cpu, reap_work, | ||
111 | - __round_jiffies_relative(HZ, cpu)); | ||
112 | + __round_jiffies_relative(HZ*4, cpu)); | ||
113 | } | ||
114 | } | ||
115 | |||
116 | diff -Naur linux-2.6.29/net/core/neighbour.c linux-2.6.29-magellan/net/core/neighbour.c | ||
117 | --- linux-2.6.29/net/core/neighbour.c 2009-03-24 00:12:14.000000000 +0100 | ||
118 | +++ linux-2.6.29-magellan/net/core/neighbour.c 2009-04-23 20:20:46.000000000 +0200 | ||
119 | @@ -755,10 +755,10 @@ | ||
120 | if (!expire) | ||
121 | expire = 1; | ||
122 | |||
123 | - if (expire>HZ) | ||
124 | + if (expire>4*HZ) | ||
125 | mod_timer(&tbl->gc_timer, round_jiffies(now + expire)); | ||
126 | else | ||
127 | - mod_timer(&tbl->gc_timer, now + expire); | ||
128 | + mod_timer(&tbl->gc_timer, round_jiffies(now + 4*HZ)); | ||
129 | |||
130 | write_unlock(&tbl->lock); | ||
131 | } |