Re: 2.6.26-rc: nfsd hangs for a few sec

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Mel Gorman <mel@...>
Cc: Alexander Beregalov <a.beregalov@...>, <kernel-testers@...>, kernel list <linux-kernel@...>, <linux-mm@...>, Lee Schermerhorn <lee.schermerhorn@...>, KAMEZAWA Hiroyuki <kamezawa.hiroyu@...>, Hugh Dickins <hugh@...>, Nick Piggin <nickpiggin@...>, Andrew Morton <akpm@...>, Linus Torvalds <torvalds@...>, <bfields@...>, <neilb@...>, <linux-nfs@...>
Date: Saturday, June 21, 2008 - 7:46 pm

On Sat, 21 Jun 2008, Mel Gorman wrote:


Right we have a significant memory leak here. Potentially one object for 
each zone is allocated and abandoned. May trigger more allocations
and therefore trigger more frequent reclaim because the free objects are
rapidly consumed on a system that relies on fallback allocations 
(memoryless nodes f.e.). Not a direct explanation for the problem but the
memory wastage could certainly can heretofore undiscovered locking 
dependencies to be exposed.


Ok. That would work but its better to put the check into the if branch:


Subject: Slab: Fix memory leak in fallback_alloc()

The zonelist patches caused the loop that checks for available
objects in permitted zones to not terminate immediately. One object
per zone per allocation may be allocated and then abandoned.

Break the loop when we have successfully allocated one object.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

---
 mm/slab.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux-2.6/mm/slab.c
===================================================================
--- linux-2.6.orig/mm/slab.c	2008-06-21 16:39:04.336377178 -0700
+++ linux-2.6/mm/slab.c	2008-06-21 16:40:07.637834699 -0700
@@ -3263,9 +3263,12 @@ retry:
 
 		if (cpuset_zone_allowed_hardwall(zone, flags) &&
 			cache->nodelists[nid] &&
-			cache->nodelists[nid]->free_objects)
+			cache->nodelists[nid]->free_objects) {
 				obj = ____cache_alloc_node(cache,
 					flags | GFP_THISNODE, nid);
+				if (obj)
+					break;
+		}
 	}
 
 	if (!obj) {

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: 2.6.26-rc: nfsd hangs for a few sec, Alexander Beregalov, (Sat Jun 21, 8:57 am)
Re: 2.6.26-rc: nfsd hangs for a few sec, Mel Gorman, (Sat Jun 21, 6:41 pm)
Re: 2.6.26-rc: nfsd hangs for a few sec, Alexander Beregalov, (Sat Jun 21, 10:10 pm)
Re: 2.6.26-rc: nfsd hangs for a few sec, Christoph Lameter, (Sat Jun 21, 8:18 pm)
Re: 2.6.26-rc: nfsd hangs for a few sec, Mel Gorman, (Sat Jun 21, 9:38 pm)
Re: 2.6.26-rc: nfsd hangs for a few sec, Christoph Lameter, (Sun Jun 22, 12:13 am)
Re: 2.6.26-rc: nfsd hangs for a few sec, Mel Gorman, (Sun Jun 22, 1:07 pm)
Re: 2.6.26-rc: nfsd hangs for a few sec, Christoph Lameter, (Sat Jun 21, 7:46 pm)
Re: 2.6.26-rc: nfsd hangs for a few sec, Linus Torvalds, (Sat Jun 21, 7:54 pm)
Re: 2.6.26-rc: nfsd hangs for a few sec, Linus Torvalds, (Sat Jun 21, 2:36 pm)