From: Andrew Morton <akpm@linux-foundation.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Anton Arapov <anton@redhat.com>, Ingo Molnar <mingo@elte.hu>,
Linus Torvalds <torvalds@linux-foundation.org>,
Michal Marek <mmarek@suse.cz>,
Mikulas Patocka <mpatocka@redhat.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Peter Zijlstra <peterz@infradead.org>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] percpu_rw_semaphore: add the lockdep annotations
Date: Mon, 19 Nov 2012 15:05:53 -0800 [thread overview]
Message-ID: <20121119150553.8c890970.akpm@linux-foundation.org> (raw)
In-Reply-To: <20121118190321.GA9684@redhat.com>
On Sun, 18 Nov 2012 20:03:21 +0100
Oleg Nesterov <oleg@redhat.com> wrote:
> Add the lockdep annotations. Not only this can help to find the
> potential problems, we do not want the false warnings if, say,
> the task takes two different percpu_rw_semaphore's for reading.
> IOW, at least ->rw_sem should not use a single class.
>
> This patch exposes this internal lock to lockdep so that it
> represents the whole percpu_rw_semaphore. This way we do not
> need to add another "fake" ->lockdep_map and lock_class_key.
> More importantly, this also makes the output from lockdep much
> more understandable if it finds the problem.
>
> In short, with this patch from lockdep pov percpu_down_read()
> and percpu_up_read() acquire/release ->rw_sem for reading, this
> matches the actual semantics. This abuses __up_read() but I hope
> this is fine and in fact I'd like to have down_read_no_lockdep()
> as well, percpu_down_read_recursive_readers() will need it.
>
> ...
>
> -extern int percpu_init_rwsem(struct percpu_rw_semaphore *);
> +extern int __percpu_init_rwsem(struct percpu_rw_semaphore *,
> + const char *, struct lock_class_key *);
> extern void percpu_free_rwsem(struct percpu_rw_semaphore *);
>
> +#define percpu_init_rwsem(brw) \
Should have been called percpu_rwsem_init(). The naming in this code does
seem to be rather inconsistent. s/percpu_rw_semaphore/percpu_rwsem/g
would be a good start, then consistently use percpu_rwsem_foo where
practical. But percpu_rwsem_down_read() doesn't sound practical :(
Is there much point in doing all these changes as five separate patches
(so far)? Perhaps it should all blobbed into as little as one patch(es)?
You sent your uprobes changes to Ingo as a git pull, but I doubt if
Ingo's trees contain the percpu_rwsem_rw_semaphore changes. What's
happening here?
next prev parent reply other threads:[~2012-11-19 23:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-18 19:02 [PATCH -mm 0/3] percpu_rw_semaphore: lockdep + config Oleg Nesterov
2012-11-18 19:03 ` [PATCH 1/3] percpu_rw_semaphore: kill ->writer_mutex, add ->write_ctr Oleg Nesterov
2012-11-18 19:03 ` [PATCH 2/3] percpu_rw_semaphore: add the lockdep annotations Oleg Nesterov
2012-11-19 23:05 ` Andrew Morton [this message]
2012-11-20 16:31 ` Oleg Nesterov
2012-11-18 19:03 ` [PATCH 3/3] percpu_rw_semaphore: introduce CONFIG_PERCPU_RWSEM Oleg Nesterov
2012-11-19 13:54 ` Q: __lockdep_no_validate__ (Was: [PATCH -mm 0/3] percpu_rw_semaphore: lockdep + config) Oleg Nesterov
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=20121119150553.8c890970.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=anton@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mmarek@suse.cz \
--cc=mpatocka@redhat.com \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=srikar@linux.vnet.ibm.com \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome