diff options
author | Christoph Lameter <clameter@sgi.com> | 2006-03-22 03:09:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 10:54:06 -0500 |
commit | 879336c3930ae9273ea1c45214cb8adae0ce494a (patch) | |
tree | 24fbb8aff19f6747b6cc40cb05cbe9f4c21f85e3 | |
parent | b18e7e654d7af741d2bf34a90dc34128d0217fea (diff) |
[PATCH] drain_node_pages: interrupt latency reduction / optimization
1. Only disable interrupts if there is actually something to free
2. Only dirty the pcp cacheline if we actually freed something.
3. Disable interrupts for each single pcp and not for cleaning
all the pcps in all zones of a node.
drain_node_pages is called every 2 seconds from cache_reap. This
fix should avoid most disabling of interrupts.
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 | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ed91684cb1f5..b7f14a4799a5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -603,13 +603,14 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order, | |||
603 | /* | 603 | /* |
604 | * Called from the slab reaper to drain pagesets on a particular node that | 604 | * Called from the slab reaper to drain pagesets on a particular node that |
605 | * belong to the currently executing processor. | 605 | * belong to the currently executing processor. |
606 | * Note that this function must be called with the thread pinned to | ||
607 | * a single processor. | ||
606 | */ | 608 | */ |
607 | void drain_node_pages(int nodeid) | 609 | void drain_node_pages(int nodeid) |
608 | { | 610 | { |
609 | int i, z; | 611 | int i, z; |
610 | unsigned long flags; | 612 | unsigned long flags; |
611 | 613 | ||
612 | local_irq_save(flags); | ||
613 | for (z = 0; z < MAX_NR_ZONES; z++) { | 614 | for (z = 0; z < MAX_NR_ZONES; z++) { |
614 | struct zone *zone = NODE_DATA(nodeid)->node_zones + z; | 615 | struct zone *zone = NODE_DATA(nodeid)->node_zones + z; |
615 | struct per_cpu_pageset *pset; | 616 | struct per_cpu_pageset *pset; |
@@ -619,11 +620,14 @@ void drain_node_pages(int nodeid) | |||
619 | struct per_cpu_pages *pcp; | 620 | struct per_cpu_pages *pcp; |
620 | 621 | ||
621 | pcp = &pset->pcp[i]; | 622 | pcp = &pset->pcp[i]; |
622 | free_pages_bulk(zone, pcp->count, &pcp->list, 0); | 623 | if (pcp->count) { |
623 | pcp->count = 0; | 624 | local_irq_save(flags); |
625 | free_pages_bulk(zone, pcp->count, &pcp->list, 0); | ||
626 | pcp->count = 0; | ||
627 | local_irq_restore(flags); | ||
628 | } | ||
624 | } | 629 | } |
625 | } | 630 | } |
626 | local_irq_restore(flags); | ||
627 | } | 631 | } |
628 | #endif | 632 | #endif |
629 | 633 | ||