From: Steven Rostedt <rostedt@goodmis.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC] seqlock,lockdep: Add lock primitives to read_seqbegin().
Date: Mon, 28 Mar 2011 13:12:17 -0400 [thread overview]
Message-ID: <20110328171217.GA8529@home.goodmis.org> (raw)
In-Reply-To: <201103261312.AEJ01293.OVFJFSLtHOFOMQ@I-love.SAKURA.ne.jp>
On Sat, Mar 26, 2011 at 01:12:17PM +0900, Tetsuo Handa wrote:
> I got a freeze between "seqlock_t rename_lock" and "DEFINE_BRLOCK(vfsmount_lock)"
Egad, that DEFINE_BRLOCK() is a scary macro. Turns into DEFINE_LGLOCK()
and creates a local and global lock.
>
> But there is still a problem. It seems to me that lockdep checks for this bug
> only when a new locking pattern (a locking pattern which was not already added
> to lockdep database) is added. This freeze can be triggered by running
>
> while :; do newns /sbin/pivot_root /proc/ /proc/sys/; done
>
> on one terminal and running
>
> while :; do /bin/ls -l /proc/*/exe; done
>
> on another terminal. (The "newns" is a program that unshares the mnt namespace
> before execve() using CLONE_NEWNS.) But even after applying the patch above,
> lockdep does not show the trace above.
>
> lockdep shows the trace above only after I run test programs for TOMOYO (which
> causes a locking pattern that was generated by neither
> "/sbin/pivot_root /proc/ /proc/sys/" nor "/bin/ls -l /proc/*/exe" to be added
> to lockdep database).
>
> I think that we want some method for rechecking already added locking pattern.
> Maybe it is run by (e.g.) every 60 seconds. Maybe it is run when stall checking
> mechanisms report the possibility of stall. (The sysrq key didn't work after
> the freeze occurred.)
This is where you confused me. Why would a pattern that was previously
checked, suddenly break? If we found A->B and then come across B->A,
lockdep should surely catch it. Maybe I don't understand exactly whay
you are trying to say.
>
> Also, what to do with __read_seqcount_begin() case? Since seqcount_t does not
> have a spinlock embedded into the struct, we can't use lock primitives...?
>
We could probably just add a lockdep key to the seqcount, and "acquire"
and "release" it when necessary. I can look into that as I'm playing
around with lockdep now anyway ;)
-- Steve
next prev parent reply other threads:[~2011-03-28 17:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-26 4:12 [RFC] seqlock,lockdep: Add lock primitives to read_seqbegin() Tetsuo Handa
2011-03-28 17:12 ` Steven Rostedt [this message]
2011-03-28 21:57 ` Tetsuo Handa
2011-03-29 4:30 ` Tetsuo Handa
2011-03-29 12:49 ` Steven Rostedt
2011-03-29 13:39 ` Peter Zijlstra
2011-03-29 17:50 ` Peter Zijlstra
2011-03-30 8:12 ` Tetsuo Handa
2011-03-30 9:50 ` Peter Zijlstra
2011-03-30 12:17 ` Tetsuo Handa
2011-03-31 13:59 ` Peter Zijlstra
2011-03-29 13:11 ` Peter Zijlstra
2011-03-29 13:14 ` Peter Zijlstra
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=20110328171217.GA8529@home.goodmis.org \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=peterz@infradead.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.