Re: [RFC PATCH 01/19] lockdep: annotate reclaim context(__GFP_NOFS)

From: Peter Zijlstra
Date: Fri Jan 23 2009 - 10:08:23 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/