linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] call mm/page-writeback.c:set_ratelimit() when new pages are hot-added
@ 2006-08-28 22:23 Chandra Seetharaman
  2006-08-29  5:08 ` Dave Hansen
  2006-08-29  5:41 ` KAMEZAWA Hiroyuki
  0 siblings, 2 replies; 3+ messages in thread
From: Chandra Seetharaman @ 2006-08-28 22:23 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm

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.

Signed-Off-by: Chandra Seetharaman <sekharan@us.ibm.com>

--
Index: linux-2.6.17/mm/memory_hotplug.c
===================================================================
--- linux-2.6.17.orig/mm/memory_hotplug.c
+++ linux-2.6.17/mm/memory_hotplug.c
@@ -141,6 +141,7 @@ int online_pages(unsigned long pfn, unsi
 	unsigned long start_pfn;
 	struct zone *zone;
 	int need_zonelists_rebuild = 0;
+	extern void set_ratelimit(void);
 
 	/*
 	 * This doesn't need a lock to do pfn_to_page().
@@ -191,6 +192,7 @@ int online_pages(unsigned long pfn, unsi
 	if (need_zonelists_rebuild)
 		build_all_zonelists();
 	vm_total_pages = nr_free_pagecache_pages();
+	set_ratelimit();
 	return 0;
 }
 
Index: linux-2.6.17/mm/page-writeback.c
===================================================================
--- linux-2.6.17.orig/mm/page-writeback.c
+++ linux-2.6.17/mm/page-writeback.c
@@ -490,7 +490,7 @@ void laptop_sync_completion(void)
  * will write six megabyte chunks, max.
  */
 
-static void set_ratelimit(void)
+void set_ratelimit(void)
 {
 	ratelimit_pages = vm_total_pages / (num_online_cpus() * 32);
 	if (ratelimit_pages < 16)

-- 

----------------------------------------------------------------------
    Chandra Seetharaman               | Be careful what you choose....
              - sekharan@us.ibm.com   |      .......you may get it.
----------------------------------------------------------------------


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-29  5:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-28 22:23 [PATCH] call mm/page-writeback.c:set_ratelimit() when new pages are hot-added Chandra Seetharaman
2006-08-29  5:08 ` Dave Hansen
2006-08-29  5:41 ` KAMEZAWA Hiroyuki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox