public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] mm: couple rcu and memory reclaim
@ 2007-09-24  8:45 Peter Zijlstra
  2007-09-24 10:42 ` Balbir Singh
  2007-09-28 20:13 ` Nick Piggin
  0 siblings, 2 replies; 8+ messages in thread
From: Peter Zijlstra @ 2007-09-24  8:45 UTC (permalink / raw)
  To: Paul E. McKenney, linux-kernel; +Cc: Nick Piggin, Rik van Riel



Just an idea I had, it seems like a good idea to wait for RCU callbacks
in reclaim so that we won't get all of memory stuck there.

If this location is too aggressive we might stick it next to
disable_swap_token().

---
Couple RCU and reclaim.

There could be a lot of memory stuck in RCU callbacks. Wait for RCU to
finish before giving it another go.

Placed in kswapd and not direct reclaim path because kswapd never holds
rcu_read_lock() at this point and can thus not deadlock. Direct reclaim
callers might hold rcu_read_lock() and would suffer from deadlocks if
sync_rcu() were to be called.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
 mm/vmscan.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6/mm/vmscan.c
===================================================================
--- linux-2.6.orig/mm/vmscan.c
+++ linux-2.6/mm/vmscan.c
@@ -1435,8 +1435,10 @@ loop_again:
 		unsigned long lru_pages = 0;
 
 		/* The swap token gets in the way of swapout... */
-		if (!priority)
+		if (!priority) {
+			synchronize_rcu();
 			disable_swap_token();
+		}
 
 		all_zones_ok = 1;
 

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

end of thread, other threads:[~2007-09-29 12:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-24  8:45 [RFC][PATCH] mm: couple rcu and memory reclaim Peter Zijlstra
2007-09-24 10:42 ` Balbir Singh
2007-09-24 11:06   ` Peter Zijlstra
2007-09-24 11:22     ` Balbir Singh
2007-09-24 11:50       ` Peter Zijlstra
2007-09-24 12:48         ` Balbir Singh
2007-09-24 12:58           ` Peter Zijlstra
2007-09-28 20:13 ` Nick Piggin

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