linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch] mm: move pagevec stripping to save unlock-relock
@ 2009-02-25  2:38 Johannes Weiner
  2009-02-25  8:13 ` MinChan Kim
  2009-02-25 19:25 ` [patch] mm: don't free swap slots on page deactivation Johannes Weiner
  0 siblings, 2 replies; 7+ messages in thread
From: Johannes Weiner @ 2009-02-25  2:38 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linux-kernel

In shrink_active_list() after the deactivation loop, we strip buffer
heads from the potentially remaining pages in the pagevec.

Currently, this drops the zone's lru lock for stripping, only to
reacquire it again afterwards to update statistics.

It is not necessary to strip the pages before updating the stats, so
move the whole thing out of the protected region and save the extra
locking.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
---
 mm/vmscan.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1298,14 +1298,11 @@ static void shrink_active_list(unsigned 
 	}
 	__mod_zone_page_state(zone, NR_LRU_BASE + lru, pgmoved);
 	pgdeactivate += pgmoved;
-	if (buffer_heads_over_limit) {
-		spin_unlock_irq(&zone->lru_lock);
-		pagevec_strip(&pvec);
-		spin_lock_irq(&zone->lru_lock);
-	}
 	__count_zone_vm_events(PGREFILL, zone, pgscanned);
 	__count_vm_events(PGDEACTIVATE, pgdeactivate);
 	spin_unlock_irq(&zone->lru_lock);
+	if (buffer_heads_over_limit)
+		pagevec_strip(&pvec);
 	if (vm_swap_full())
 		pagevec_swap_free(&pvec);
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-03-02 11:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-25  2:38 [patch] mm: move pagevec stripping to save unlock-relock Johannes Weiner
2009-02-25  8:13 ` MinChan Kim
2009-02-25 19:25 ` [patch] mm: don't free swap slots on page deactivation Johannes Weiner
2009-02-25 20:40   ` Hugh Dickins
2009-03-01 10:37     ` [PATCH for mmotm] remove pagevec_swap_free() KOSAKI Motohiro
2009-03-02 11:56       ` Hugh Dickins
2009-02-25 21:31   ` [patch] mm: don't free swap slots on page deactivation Rik van Riel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox