Re: WARNING: at kernel/lockdep.c:690 __lock_acquire+0x168/0x164b()

From: Tejun Heo
Date: Thu Oct 20 2011 - 17:36:50 EST


Hello,

On Thu, Oct 20, 2011 at 02:31:39PM -0700, David Rientjes wrote:
> > So, according to this thread, the problem is that the memset() clears
> > lock->name field, right?
>
> Right, and reverting f59de8992aa6 ("lockdep: Clear whole lockdep_map on
> initialization") seems to fix the lockdep warning.
>
> > But how can that be a problem? lock->name
> > is always set to either "NULL" or @name. Why would clearing it before
> > setting make any difference? What am I missing?
> >
>
> The scheduler (in sched_fair and sched_rt) calls lock_set_subclass() which
> sets the name in double_unlock_balance() to set the name but there's a
> race between when that is cleared with the memset() and setting of
> lock->name where lockdep can find them to match.

Hmmm... so lock_set_subclass() is racing against lockdep_init()? That
sounds very fishy and probably needs better fix. Anyways, if someone
can't come up with proper solution, please feel free to revert the
commit.

Thanks.

--
tejun
--
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/