Skip to content

Commit

Permalink
[PATCH] drain_node_page(): Drain pages in batch units
Browse files Browse the repository at this point in the history
drain_node_pages() currently drains the complete pageset of all pages.  If
there are a large number of pages in the queues then we may hold off
interrupts for too long.

Duplicate the method used in free_hot_cold_page.  Only drain pcp->batch
pages at one time.

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 Dec 7, 2006
1 parent ebe2973 commit bc4ba39
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,15 @@ void drain_node_pages(int nodeid)

pcp = &pset->pcp[i];
if (pcp->count) {
int to_drain;

local_irq_save(flags);
free_pages_bulk(zone, pcp->count, &pcp->list, 0);
pcp->count = 0;
if (pcp->count >= pcp->batch)
to_drain = pcp->batch;
else
to_drain = pcp->count;
free_pages_bulk(zone, to_drain, &pcp->list, 0);
pcp->count -= to_drain;
local_irq_restore(flags);
}
}
Expand Down

0 comments on commit bc4ba39

Please sign in to comment.