lkml.org 
[lkml]   [2004]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH][2.6-mm] split drain_local_pages
CPU hotplug core needs to pass a cpu parameter to drain_local_pages, it's
safe to call __drain_local_pages if the cpu being drained is offline. The
semantics for drain_local_pages do not change.

Index: linux-2.6.3-rc3-mm1/mm/page_alloc.c
===================================================================
RCS file: /home/cvsroot/linux-2.6.3-rc3-mm1/mm/page_alloc.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 page_alloc.c
--- linux-2.6.3-rc3-mm1/mm/page_alloc.c 16 Feb 2004 20:42:50 -0000 1.1.1.1
+++ linux-2.6.3-rc3-mm1/mm/page_alloc.c 16 Feb 2004 21:58:19 -0000
@@ -414,19 +414,19 @@ int is_head_of_free_region(struct page *
}

/*
- * Spill all of this CPU's per-cpu pages back into the buddy allocator.
+ * drain_local_pages helper, this is only safe to use when the cpu
+ * being drained isn't currently online.
*/
-void drain_local_pages(void)
+
+void __drain_local_pages(int cpu)
{
- unsigned long flags;
struct zone *zone;
int i;
-
- local_irq_save(flags);
+
for_each_zone(zone) {
struct per_cpu_pageset *pset;

- pset = &zone->pageset[smp_processor_id()];
+ pset = &zone->pageset[cpu];
for (i = 0; i < ARRAY_SIZE(pset->pcp); i++) {
struct per_cpu_pages *pcp;

@@ -435,7 +435,19 @@ void drain_local_pages(void)
&pcp->list, 0);
}
}
- local_irq_restore(flags);
+}
+
+/*
+ * Spill all of this CPU's per-cpu pages back into the buddy allocator.
+ */
+
+void drain_local_pages(void)
+{
+ unsigned long flags;
+
+ local_irq_save(flags);
+ __drain_local_pages(smp_processor_id());
+ local_irq_restore(flags);
}
#endif /* CONFIG_PM */

@@ -1574,7 +1586,7 @@ static int page_alloc_cpu_notify(struct
count = &per_cpu(nr_pagecache_local, cpu);
atomic_add(*count, &nr_pagecache);
*count = 0;
- drain_local_pages(cpu);
+ __drain_local_pages(cpu);
}
return NOTIFY_OK;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:01    [W:0.158 / U:0.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site