From: Yong Zhang <yong.zhang0@gmail.com>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: David Rientjes <rientjes@google.com>, Tejun Heo <tj@kernel.org>,
Ingo Molnar <mingo@elte.hu>, Borislav Petkov <bp@alien8.de>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: WARNING: at kernel/lockdep.c:690 __lock_acquire+0x168/0x164b()
Date: Thu, 3 Nov 2011 15:27:05 +0800 [thread overview]
Message-ID: <20111103072705.GA15871@zhy> (raw)
In-Reply-To: <20111103071735.GA3228@swordfish.minsk.epam.com>
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
next prev parent reply other threads:[~2011-11-03 7:27 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-15 20:12 WARNING: at kernel/lockdep.c:690 __lock_acquire+0x168/0x164b() Sergey Senozhatsky
2011-10-15 21:42 ` David Rientjes
2011-10-15 22:23 ` Borislav Petkov
2011-10-15 22:32 ` David Rientjes
2011-10-16 5:09 ` Sergey Senozhatsky
2011-10-20 18:39 ` Borislav Petkov
2011-10-20 18:53 ` Sergey Senozhatsky
2011-10-20 19:07 ` Sergey Senozhatsky
2011-10-20 21:17 ` David Rientjes
2011-10-20 21:23 ` Tejun Heo
2011-10-20 21:31 ` David Rientjes
2011-10-20 21:36 ` Tejun Heo
2011-10-20 23:00 ` Sergey Senozhatsky
2011-10-21 9:14 ` David Rientjes
2011-10-21 9:26 ` Sergey Senozhatsky
2011-10-21 9:45 ` Yong Zhang
2011-11-03 7:17 ` Sergey Senozhatsky
2011-11-03 7:27 ` Yong Zhang [this message]
2011-11-03 7:45 ` Sergey Senozhatsky
2011-11-03 7:53 ` Yong Zhang
2011-11-04 9:25 ` Borislav Petkov
2011-11-04 9:31 ` Sergey Senozhatsky
2011-11-07 4:54 ` Yong Zhang
2011-11-07 8:43 ` Sergey Senozhatsky
2011-11-04 9:34 ` Yong Zhang
2011-11-04 9:51 ` Sergey Senozhatsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111103072705.GA15871@zhy \
--to=yong.zhang0@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=rientjes@google.com \
--cc=sergey.senozhatsky@gmail.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.