diff options
author | Christoph Lameter <clameter@sgi.com> | 2006-12-06 23:33:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:23 -0500 |
commit | bc4ba393c007248f76c05945abb7b7b892cdd1cc (patch) | |
tree | 3c2cf7e13ecf991c58ffc00617757fcdeb3d863f | |
parent | ebe29738f3934ad6a93c8bd76e30aa5d797a269d (diff) |
[PATCH] drain_node_page(): Drain pages in batch units
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>
-rw-r--r-- | mm/page_alloc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a840e702722c..86f2984f8b79 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -685,9 +685,15 @@ void drain_node_pages(int nodeid) | |||
685 | 685 | ||
686 | pcp = &pset->pcp[i]; | 686 | pcp = &pset->pcp[i]; |
687 | if (pcp->count) { | 687 | if (pcp->count) { |
688 | int to_drain; | ||
689 | |||
688 | local_irq_save(flags); | 690 | local_irq_save(flags); |
689 | free_pages_bulk(zone, pcp->count, &pcp->list, 0); | 691 | if (pcp->count >= pcp->batch) |
690 | pcp->count = 0; | 692 | to_drain = pcp->batch; |
693 | else | ||
694 | to_drain = pcp->count; | ||
695 | free_pages_bulk(zone, to_drain, &pcp->list, 0); | ||
696 | pcp->count -= to_drain; | ||
691 | local_irq_restore(flags); | 697 | local_irq_restore(flags); |
692 | } | 698 | } |
693 | } | 699 | } |