Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2456
b: refs/heads/master
c: 4ae7c03
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Jun 22, 2005
1 parent c765277 commit 00dc50f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 578c2fd6a7f378434655e5c480e23152a3994404
refs/heads/master: 4ae7c03943fca73f23bc0cdb938070f41b98101f
5 changes: 5 additions & 0 deletions trunk/include/linux/gfp.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,10 @@ extern void FASTCALL(free_cold_page(struct page *page));
#define free_page(addr) free_pages((addr),0)

void page_alloc_init(void);
#ifdef CONFIG_NUMA
void drain_remote_pages(void);
#else
static inline void drain_remote_pages(void) { };
#endif

#endif /* __LINUX_GFP_H */
35 changes: 33 additions & 2 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,36 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
return allocated;
}

#ifdef CONFIG_NUMA
/* Called from the slab reaper to drain remote pagesets */
void drain_remote_pages(void)
{
struct zone *zone;
int i;
unsigned long flags;

local_irq_save(flags);
for_each_zone(zone) {
struct per_cpu_pageset *pset;

/* Do not drain local pagesets */
if (zone->zone_pgdat->node_id == numa_node_id())
continue;

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

pcp = &pset->pcp[i];
if (pcp->count)
pcp->count -= free_pages_bulk(zone, pcp->count,
&pcp->list, 0);
}
}
local_irq_restore(flags);
}
#endif

#if defined(CONFIG_PM) || defined(CONFIG_HOTPLUG_CPU)
static void __drain_pages(unsigned int cpu)
{
Expand Down Expand Up @@ -1271,12 +1301,13 @@ void show_free_areas(void)
pageset = zone_pcp(zone, cpu);

for (temperature = 0; temperature < 2; temperature++)
printk("cpu %d %s: low %d, high %d, batch %d\n",
printk("cpu %d %s: low %d, high %d, batch %d used:%d\n",
cpu,
temperature ? "cold" : "hot",
pageset->pcp[temperature].low,
pageset->pcp[temperature].high,
pageset->pcp[temperature].batch);
pageset->pcp[temperature].batch,
pageset->pcp[temperature].count);
}
}

Expand Down
1 change: 1 addition & 0 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -2851,6 +2851,7 @@ static void cache_reap(void *unused)
}
check_irq_on();
up(&cache_chain_sem);
drain_remote_pages();
/* Setup the next iteration */
schedule_delayed_work(&__get_cpu_var(reap_work), REAPTIMEOUT_CPUC + smp_processor_id());
}
Expand Down

0 comments on commit 00dc50f

Please sign in to comment.