Re: [RFC][PATCH 2/2] quicklist shouldn't be proportional to # of CPUs

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Peter Zijlstra <peterz@...>
Cc: <kosaki.motohiro@...>, Andrew Morton <akpm@...>, David Miller <davem@...>, <linux-kernel@...>, <linux-mm@...>, <cl@...>, <tokunaga.keiich@...>, travis <travis@...>
Date: Thursday, August 21, 2008 - 6:04 am

Hi Peter,

Thank you good point out!


Hm, interesting.
I think following patch fill your point, right?

but I worry about it works on sparc64...


Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>

---
 mm/quicklist.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Index: b/mm/quicklist.c
===================================================================
--- a/mm/quicklist.c
+++ b/mm/quicklist.c
@@ -26,7 +26,10 @@ DEFINE_PER_CPU(struct quicklist, quickli
 static unsigned long max_pages(unsigned long min_pages)
 {
 	unsigned long node_free_pages, max;
-	struct zone *zones = NODE_DATA(numa_node_id())->node_zones;
+	int node = numa_node_id();
+	struct zone *zones = NODE_DATA(node)->node_zones;
+	int num_cpus_on_node;
+	node_to_cpumask_ptr(cpumask_on_node, node);
 
 	node_free_pages =
 #ifdef CONFIG_ZONE_DMA
@@ -38,6 +41,10 @@ static unsigned long max_pages(unsigned 
 		zone_page_state(&zones[ZONE_NORMAL], NR_FREE_PAGES);
 
 	max = node_free_pages / FRACTION_OF_NODE_MEM;
+
+	num_cpus_on_node = cpus_weight_nr(*cpumask_on_node);
+	max /= num_cpus_on_node;
+
 	return max(max, min_pages);
 }
 


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC][PATCH 0/2] Quicklist is slighly problematic., KOSAKI Motohiro, (Wed Aug 20, 7:05 am)
Re: [RFC][PATCH 0/2] Quicklist is slighly problematic., Andrew Morton, (Wed Aug 20, 2:31 pm)
Re: [RFC][PATCH 0/2] Quicklist is slighly problematic., Robin Holt, (Wed Aug 20, 10:42 pm)
Re: [RFC][PATCH 0/2] Quicklist is slighly problematic., Christoph Lameter, (Thu Aug 21, 9:07 am)
Re: [RFC][PATCH 0/2] Quicklist is slighly problematic., Christoph Lameter, (Thu Aug 21, 9:18 am)
Re: [RFC][PATCH 0/2] Quicklist is slighly problematic., Christoph Lameter, (Wed Aug 20, 10:10 am)
Re: [RFC][PATCH 0/2] Quicklist is slighly problematic., Robin Holt, (Wed Aug 20, 10:13 pm)
Re: [RFC][PATCH 0/2] Quicklist is slighly problematic., David Miller, (Wed Aug 20, 11:08 pm)
Re: [RFC][PATCH 0/2] Quicklist is slighly problematic., Christoph Lameter, (Thu Aug 21, 9:10 am)
Re: [RFC][PATCH 0/2] Quicklist is slighly problematic., Robin Holt, (Wed Aug 20, 10:16 pm)
Re: [RFC][PATCH 0/2] Quicklist is slighly problematic., KOSAKI Motohiro, (Wed Aug 20, 10:49 am)
Re: [RFC][PATCH 0/2] Quicklist is slighly problematic., Christoph Lameter, (Wed Aug 20, 11:26 am)
Re: [RFC][PATCH 2/2] quicklist shouldn't be proportional to ..., KOSAKI Motohiro, (Thu Aug 21, 6:04 am)
Re: [RFC][PATCH 2/2] quicklist shouldn't be proportional to ..., Christoph Lameter, (Wed Aug 20, 11:27 am)
[RFC][PATCH 1/2] Show quicklist at meminfo, KOSAKI Motohiro, (Wed Aug 20, 7:07 am)
Re: [RFC][PATCH 1/2] Show quicklist at meminfo, Andrew Morton, (Wed Aug 20, 2:35 pm)
Re: [RFC][PATCH 1/2] Show quicklist at meminfo, KOSAKI Motohiro, (Thu Aug 21, 3:36 am)
Re: [RFC][PATCH 1/2] Show quicklist at meminfo, KOSAKI Motohiro, (Thu Aug 21, 9:05 pm)
Re: [RFC][PATCH 1/2] Show quicklist at meminfo, Andrew Morton, (Fri Aug 22, 12:28 am)
Re: [RFC][PATCH 1/2] Show quicklist at meminfo, KOSAKI Motohiro, (Sat Aug 23, 4:24 am)
Re: [RFC][PATCH 1/2] Show quicklist at meminfo, Andrew Morton, (Sun Aug 24, 1:29 am)
Re: [RFC][PATCH 1/2] Show quicklist at meminfo, Robin Holt, (Fri Aug 22, 9:23 am)
Re: [RFC][PATCH 1/2] Show quicklist at meminfo, Christoph Lameter, (Fri Aug 22, 9:56 am)