[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1232723288.4826.117.camel@laptop>
Date:	Fri, 23 Jan 2009 16:08:08 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Nick Piggin <npiggin@...e.de>
Cc:	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 01/19] lockdep: annotate reclaim context
 (__GFP_NOFS)
On Fri, 2009-01-23 at 09:00 +0100, Peter Zijlstra wrote:
> 
> Yeah, I'll stick a check in there, that ought to suffice.
FWIW, I've ended up with the below, which I folded into your patch
(along with the fix from MinChan Kim).
--- 
Index: linux-2.6/kernel/lockdep.c
===================================================================
--- linux-2.6.orig/kernel/lockdep.c
+++ linux-2.6/kernel/lockdep.c
@@ -2471,16 +2471,21 @@ void lockdep_trace_alloc(gfp_t gfp_mask)
 {
 	struct task_struct *curr = current;
 
+	if (unlikely(!debug_locks))
+		return;
+
+	/* no reclaim without waiting on it */
+	if (!(gfp_mask & __GFP_WAIT))
+		return;
+
 	/* this guy won't enter reclaim */
-	if (curr->flags & PF_MEMALLOC)
+	if ((curr->flags & PF_MEMALLOC) && !(gfp_mask & __GFP_NOMEMALLOC))
 		return;
 
 	/* We're only interested __GFP_FS allocations for now */
 	if (!(gfp_mask & __GFP_FS))
 		return;
 
-	if (unlikely(!debug_locks))
-		return;
 	if (DEBUG_LOCKS_WARN_ON(irqs_disabled()))
 		return;
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
