@@ -557,6 +557,7 @@ extern void page_frag_free(void *addr);
void page_alloc_init(void);
void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
void drain_all_pages(struct zone *zone);
+void drain_cpu_pages(unsigned int cpu, struct zone *zone);
void drain_local_pages(struct zone *zone);
void page_alloc_init_late(void);
@@ -2713,6 +2713,14 @@ static void drain_pages(unsigned int cpu)
}
}
+void drain_cpu_pages(unsigned int cpu, struct zone *zone)
+{
+ if (zone)
+ drain_pages_zone(cpu, zone);
+ else
+ drain_pages(cpu);
+}
+
/*
* Spill all of this CPU's per-cpu pages back into the buddy allocator.
*
@@ -2723,10 +2731,7 @@ void drain_local_pages(struct zone *zone)
{
int cpu = smp_processor_id();
- if (zone)
- drain_pages_zone(cpu, zone);
- else
- drain_pages(cpu);
+ drain_cpu_pages(cpu, zone);
}
static void drain_local_pages_wq(struct work_struct *work)