diff options
author | Chandra Seetharaman <sekharan@us.ibm.com> | 2006-09-29 05:01:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-29 12:18:22 -0400 |
commit | 2d1d43f6a43b703587e759145f69467e7c6553a7 (patch) | |
tree | 8ceb1c78a54c6f44f177779b2b7bdbbc9e03048a | |
parent | 40c99aae23529f3d069ae08836ae46fadb3fd2bd (diff) |
[PATCH] call mm/page-writeback.c:set_ratelimit() when new pages are hot-added
ratelimit_pages in page-writeback.c is recalculated (in set_ratelimit())
every time a CPU is hot-added/removed. But this value is not recalculated
when new pages are hot-added.
This patch fixes that problem by calling set_ratelimit() when new pages
are hot-added.
[akpm@osdl.org: cleanups]
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/linux/writeback.h | 1 | ||||
-rw-r--r-- | mm/memory_hotplug.c | 2 | ||||
-rw-r--r-- | mm/page-writeback.c | 6 |
3 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 56a23a0e7f2e..9d4074ecd0cd 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -117,6 +117,7 @@ int sync_page_range(struct inode *inode, struct address_space *mapping, | |||
117 | int sync_page_range_nolock(struct inode *inode, struct address_space *mapping, | 117 | int sync_page_range_nolock(struct inode *inode, struct address_space *mapping, |
118 | loff_t pos, loff_t count); | 118 | loff_t pos, loff_t count); |
119 | void set_page_dirty_balance(struct page *page); | 119 | void set_page_dirty_balance(struct page *page); |
120 | void writeback_set_ratelimit(void); | ||
120 | 121 | ||
121 | /* pdflush.c */ | 122 | /* pdflush.c */ |
122 | extern int nr_pdflush_threads; /* Global so it can be exported to sysctl | 123 | extern int nr_pdflush_threads; /* Global so it can be exported to sysctl |
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 9576ed920c0a..2053bb165a21 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/compiler.h> | 13 | #include <linux/compiler.h> |
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/pagevec.h> | 15 | #include <linux/pagevec.h> |
16 | #include <linux/writeback.h> | ||
16 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
17 | #include <linux/sysctl.h> | 18 | #include <linux/sysctl.h> |
18 | #include <linux/cpu.h> | 19 | #include <linux/cpu.h> |
@@ -192,6 +193,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages) | |||
192 | if (need_zonelists_rebuild) | 193 | if (need_zonelists_rebuild) |
193 | build_all_zonelists(); | 194 | build_all_zonelists(); |
194 | vm_total_pages = nr_free_pagecache_pages(); | 195 | vm_total_pages = nr_free_pagecache_pages(); |
196 | writeback_set_ratelimit(); | ||
195 | return 0; | 197 | return 0; |
196 | } | 198 | } |
197 | 199 | ||
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index efd2705e4986..488b7088557c 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -501,7 +501,7 @@ void laptop_sync_completion(void) | |||
501 | * will write six megabyte chunks, max. | 501 | * will write six megabyte chunks, max. |
502 | */ | 502 | */ |
503 | 503 | ||
504 | static void set_ratelimit(void) | 504 | void writeback_set_ratelimit(void) |
505 | { | 505 | { |
506 | ratelimit_pages = vm_total_pages / (num_online_cpus() * 32); | 506 | ratelimit_pages = vm_total_pages / (num_online_cpus() * 32); |
507 | if (ratelimit_pages < 16) | 507 | if (ratelimit_pages < 16) |
@@ -513,7 +513,7 @@ static void set_ratelimit(void) | |||
513 | static int __cpuinit | 513 | static int __cpuinit |
514 | ratelimit_handler(struct notifier_block *self, unsigned long u, void *v) | 514 | ratelimit_handler(struct notifier_block *self, unsigned long u, void *v) |
515 | { | 515 | { |
516 | set_ratelimit(); | 516 | writeback_set_ratelimit(); |
517 | return 0; | 517 | return 0; |
518 | } | 518 | } |
519 | 519 | ||
@@ -546,7 +546,7 @@ void __init page_writeback_init(void) | |||
546 | vm_dirty_ratio = 1; | 546 | vm_dirty_ratio = 1; |
547 | } | 547 | } |
548 | mod_timer(&wb_timer, jiffies + dirty_writeback_interval); | 548 | mod_timer(&wb_timer, jiffies + dirty_writeback_interval); |
549 | set_ratelimit(); | 549 | writeback_set_ratelimit(); |
550 | register_cpu_notifier(&ratelimit_nb); | 550 | register_cpu_notifier(&ratelimit_nb); |
551 | } | 551 | } |
552 | 552 | ||