From: Johannes Berg <johannes@sipsolutions.net>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux-kernel@vger.kernel.org,
Josh Triplett <josh@freedesktop.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
linux-wireless@vger.kernel.org, linux-sparse@vger.kernel.org
Subject: Re: [RFC 1/3] add macros for new sparse features
Date: Fri, 11 Apr 2008 14:20:39 +0200 [thread overview]
Message-ID: <1207916439.13354.68.camel@johannes.berg> (raw)
In-Reply-To: <47FE425C.7060405@s5r6.in-berlin.de>
[-- Attachment #1: Type: text/plain, Size: 775 bytes --]
> So, instead of
>
> /* always call with host_lock held */
> int foo(struct bar *b)
> {
>
> we could write
>
> int foo(struct bar *b) __requires(host_lock)
> {
>
> and let sparse check the call chains... or how is it used?
Yes.
> And what about dynamically allocated locks?
> E.g. b->lock
> Or struct host h* = container_of(b, struct host, m); with the necessity
> to hold h->lock...
I was looking at making sparse check that certain variable references
are under rcu, but it's not as easy. Also, the lock context is just an
arbitrary name, there's no way to actually link it to a certain variable
or so to differentiate between them. I think that's not really solvable
in sparse, look at the things lockdep has to do.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2008-04-11 12:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-10 13:48 [RFC 0/3] Examples for the new sparse context tracking functionality Johannes Berg
2008-04-10 13:48 ` [RFC 1/3] add macros for new sparse features Johannes Berg
2008-04-10 16:37 ` Stefan Richter
2008-04-11 12:20 ` Johannes Berg [this message]
2008-04-10 13:48 ` [RFC 2/3] rcu: allow functions to declare they need RCU locking Johannes Berg
2008-04-10 13:48 ` [RFC 3/3] mac80211: annotate with __requires_rcu Johannes Berg
[not found] ` <20080410134829.412424000-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2008-04-12 8:50 ` Geert Uytterhoeven
2008-04-12 8:56 ` Johannes Berg
[not found] ` <20080410134810.629048000-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2008-04-10 15:22 ` [RFC 0/3] Examples for the new sparse context tracking functionality Johannes Berg
2008-04-19 23:33 ` Paul E. McKenney
2008-04-21 8:25 ` Johannes Berg
[not found] ` <1208766355.26186.37.camel-YfaajirXv214zXjbi5bjpg@public.gmane.org>
2008-04-21 14:55 ` Paul E. McKenney
[not found] ` <20080421145525.GB9153-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-04-21 15:05 ` Johannes Berg
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=1207916439.13354.68.camel@johannes.berg \
--to=johannes@sipsolutions.net \
--cc=josh@freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=stefanr@s5r6.in-berlin.de \
/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;
as well as URLs for NNTP newsgroup(s).