Skip to content

Commit

Permalink
[PATCH] mm: do not check unpopulated zones for draining and counter u…
Browse files Browse the repository at this point in the history
…pdates

If a zone is unpopulated then we do not need to check for pages that are to
be drained and also not for vm counters that may need to be updated.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Sep 26, 2006
1 parent 006d22d commit 39bbcb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
#ifdef CONFIG_NUMA
/*
* Called from the slab reaper to drain pagesets on a particular node that
* belong to the currently executing processor.
* belongs to the currently executing processor.
* Note that this function must be called with the thread pinned to
* a single processor.
*/
Expand All @@ -647,6 +647,9 @@ void drain_node_pages(int nodeid)
struct zone *zone = NODE_DATA(nodeid)->node_zones + z;
struct per_cpu_pageset *pset;

if (!populated_zone(zone))
continue;

pset = zone_pcp(zone, smp_processor_id());
for (i = 0; i < ARRAY_SIZE(pset->pcp); i++) {
struct per_cpu_pages *pcp;
Expand Down
3 changes: 3 additions & 0 deletions mm/vmstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ void refresh_cpu_vm_stats(int cpu)
for_each_zone(zone) {
struct per_cpu_pageset *pcp;

if (!populated_zone(zone))
continue;

pcp = zone_pcp(zone, cpu);

for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++)
Expand Down

0 comments on commit 39bbcb8

Please sign in to comment.