lkml.org 
[lkml]   [2011]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: WARNING: at kernel/lockdep.c:690 __lock_acquire+0x168/0x164b()
On Thu, Nov 03, 2011 at 10:17:36AM +0300, Sergey Senozhatsky wrote:
> On (10/21/11 17:45), Yong Zhang wrote:
> > On Fri, Oct 21, 2011 at 02:14:34AM -0700, David Rientjes wrote:
> > > How does it mask the race condition? Before the memset(), the ->name
> > > field was never _cleared_ in lockdep_init_map() like it is now, it was
> > > only stored.
> >
> > A typcal race condition will like this:
> >
> > CPU A CPU B
> > lock_set_subclass(lockA);
> > lock_set_class(lockA);
> > lockdep_init_map(lockA);
> > /* lockA->name is cleared */
> > memset(lockA);
> > __lock_acquire(lockA);
> > /* lockA->class_cache[] is cleared */
> > register_lock_class(lockA);
> > look_up_lock_class(lockA);
> > WARN_ON_ONCE(class->name !=
> > lock->name);
> >
> > lock->name = name;
> >
> > And a untested patch is below:
> > BTW, now the patch could cure (I guess) the very issue reported
> > in this thread.
> > But it don't cover the case which change the key and the relevant
> > lock_class has existed, I don't think out a way how to fix it yet :)
> > But the fact is we have no such caller yet, the only call site of
> > lock_set_subclass() is double_unlock_balance().
> >
>
> Hello,
> Any news on this patch? Do you like it or hate it? With recent kernels
> I'm able to hit this problem more often (several time a day) so if any
> testing is required I'm willing to help.

Did you have tried it? Though I don't find time to polish it yet but
I think will smooth your concern.

Thanks,
Yong


\
 
 \ /
  Last update: 2011-11-03 08:31    [W:0.055 / U:5.100 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site