linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* mm: call into direct reclaim without PF_MEMALLOC set
@ 2006-11-15 19:25 Peter Zijlstra
  2006-11-15 20:42 ` Andrew Morton
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Zijlstra @ 2006-11-15 19:25 UTC (permalink / raw)
  To: Andrew Morton, linux-mm

PF_MEMALLOC keeps direct reclaim from recursing into itself, I noticed this
call to try_to_free_pages didn't set it thus opening the floodgates.

/me wonders why this never triggered...

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
 fs/buffer.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Index: linux-2.6-git/fs/buffer.c
===================================================================
--- linux-2.6-git.orig/fs/buffer.c	2006-11-15 20:14:58.000000000 +0100
+++ linux-2.6-git/fs/buffer.c	2006-11-15 20:19:22.000000000 +0100
@@ -360,8 +360,18 @@ static void free_more_memory(void)
 
 	for_each_online_pgdat(pgdat) {
 		zones = pgdat->node_zonelists[gfp_zone(GFP_NOFS)].zones;
-		if (*zones)
+		if (*zones) {
+			struct task_struct *p = current;
+			struct reclaim_state reclaim_state;
+			reclaim_state.reclaim_slab = 0;
+			p->flags |= PF_MEMALLOC;
+			p->reclaim_state = &reclaim_state;
+
 			try_to_free_pages(zones, GFP_NOFS);
+
+			p->reclaim_state = NULL;
+			p->flags &= ~PF_MEMALLOC;
+		}
 	}
 }
 


--
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] 12+ messages in thread

end of thread, other threads:[~2006-11-17 12:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-15 19:25 mm: call into direct reclaim without PF_MEMALLOC set Peter Zijlstra
2006-11-15 20:42 ` Andrew Morton
2006-11-15 21:23   ` [PATCH] " Peter Zijlstra
2006-11-15 21:32     ` Andrew Morton
     [not found]   ` <1163625058.5968.64.camel@twins>
     [not found]     ` <20061115132340.3cbf4008.akpm@osdl.org>
2006-11-15 21:32       ` Peter Zijlstra
2006-11-15 22:00         ` Andrew Morton
2006-11-15 22:12           ` Arjan van de Ven
2006-11-15 22:24             ` Andrew Morton
2006-11-16  9:52           ` [PATCH] mm: cleanup and document reclaim recursion Peter Zijlstra
2006-11-17  0:16             ` Andrew Morton
2006-11-17  8:31               ` Peter Zijlstra
2006-11-17 12:18               ` Peter Zijlstra

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