Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164367
b: refs/heads/master
c: 112067f
h: refs/heads/master
i:
  164365: 01afab4
  164363: c427721
  164359: 4be115d
  164351: 32bac53
v: v3
  • Loading branch information
Shaohua Li authored and Linus Torvalds committed Sep 22, 2009
1 parent 42de9f0 commit 9a3da1d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 478b81fd84a299adb401dbbae296f3767e552999
refs/heads/master: 112067f0905b2de862c607ee62411cf47d2fe5c4
2 changes: 2 additions & 0 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,8 @@ extern void setup_per_cpu_pageset(void);
static inline void setup_per_cpu_pageset(void) {}
#endif

extern void zone_pcp_update(struct zone *zone);

/* nommu.c */
extern atomic_long_t mmap_pages_allocated;

Expand Down
1 change: 1 addition & 0 deletions trunk/mm/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
zone->present_pages += onlined_pages;
zone->zone_pgdat->node_present_pages += onlined_pages;

zone_pcp_update(zone);
setup_per_zone_wmarks();
calculate_zone_inactive_ratio(zone);
if (onlined_pages) {
Expand Down
26 changes: 26 additions & 0 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3142,6 +3142,32 @@ int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
return 0;
}

static int __zone_pcp_update(void *data)
{
struct zone *zone = data;
int cpu;
unsigned long batch = zone_batchsize(zone), flags;

for (cpu = 0; cpu < NR_CPUS; cpu++) {
struct per_cpu_pageset *pset;
struct per_cpu_pages *pcp;

pset = zone_pcp(zone, cpu);
pcp = &pset->pcp;

local_irq_save(flags);
free_pages_bulk(zone, pcp->count, &pcp->list, 0);
setup_pageset(pset, batch);
local_irq_restore(flags);
}
return 0;
}

void zone_pcp_update(struct zone *zone)
{
stop_machine(__zone_pcp_update, zone, NULL);
}

static __meminit void zone_pcp_init(struct zone *zone)
{
int cpu;
Expand Down

0 comments on commit 9a3da1d

Please sign in to comment.