From: Philipp Reisner <philipp.reisner@linbit.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Josh Triplett <josh@freedesktop.org>, linux-sparse@vger.kernel.org
Subject: Re: [PATCH 1/3] make sparse keep its promise about context tracking
Date: Thu, 10 Apr 2008 18:05:31 +0200 [thread overview]
Message-ID: <200804101805.31854.philipp.reisner@linbit.com> (raw)
In-Reply-To: <1207842687.13354.12.camel@johannes.berg>
Am Donnerstag, 10. April 2008 17:51:27 schrieb Johannes Berg:
> > I also worked on that part, although I have to admitt that I did not
> > got that part of the manpage. Instead I invented the require_context
> > attribute.
>
> Heh.
>
> > Here is the second patch. It applies on top of the first one...
>
> I don't really have time to look through it right now, sorry.
>
> > I hope that we get the good ideas of our two works combined and
> > accepted into sparse...
>
> That would be good :)
>
>
> What's this "rdwr" etc. for? And "call"? Also, how are you planning to
> handle nested contexts, where 1,1 doesn't cut it any >0,>0 is really
> more like what we need?
>
I also use it to check a recusive lock mechanism.
The sematics of what I implemented is:
You simply use the __attribute__((context(ctx,in,out))) to
annotate the context changes of functions.
to annotate a variable, struct/union member or a function that
a certain locking primitive is required for accessing it, you
do it by
__attribute__((require_context(ctx,min,max,"type")))
ctx ... the expression that describes the locking primitive
min ... the minimum of locks required of that locking primitive
max ... the maximum allowed of locks of that locking primitive.
type .. read, write, rdwr or call for the access type.
So you can express you need to hold this and that locking
primitive to write to something. But an other locking
primitive might be sufficient for reading that something.
The annotation for a variable foo protected by a recursive lock
bar would be:
int foo __attribute__((require_context(bar,1,99999,"rdwr")))
PS: I just realized that there my e-mail client introduced linebreakes
in the first patch I posted. I will repost on request of course.
-Phil
--
: Dipl-Ing Philipp Reisner Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH Fax +43-1-8178292-82 :
: Vivenotgasse 48, 1120 Vienna, Austria http://www.linbit.com :
next prev parent reply other threads:[~2008-04-10 16:05 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-10 13:25 [PATCH 0/3] improve context handling Johannes Berg
2008-04-10 13:25 ` [PATCH 1/3] make sparse keep its promise about context tracking Johannes Berg
2008-04-10 15:24 ` Philipp Reisner
2008-04-10 15:30 ` Johannes Berg
2008-04-10 15:46 ` Philipp Reisner
2008-04-10 15:51 ` Johannes Berg
2008-04-10 16:05 ` Philipp Reisner [this message]
2008-04-10 16:12 ` Johannes Berg
2008-04-10 21:21 ` Philipp Reisner
2008-04-11 19:53 ` Josh Triplett
2008-04-18 12:35 ` Johannes Berg
2008-04-11 11:06 ` Johannes Berg
2008-04-21 19:34 ` Josh Triplett
2008-04-21 19:37 ` Johannes Berg
2008-04-10 15:54 ` Johannes Berg
2008-04-21 19:22 ` Josh Triplett
2008-04-21 18:04 ` Josh Triplett
2008-04-21 18:11 ` Johannes Berg
2008-04-21 18:26 ` Josh Triplett
2008-04-21 18:30 ` Johannes Berg
2008-04-21 18:51 ` Josh Triplett
2008-04-10 13:25 ` [PATCH 2/3] sparse test suite: add test mixing __context__ and __attribute__((context(...))) Johannes Berg
2008-04-10 13:25 ` [PATCH 3/3] sparse: simple conditional context tracking Johannes Berg
2008-04-11 11:07 ` [PATCH 4/3] inlined call bugfix & test Johannes Berg
2008-04-11 11:08 ` [PATCH 5/3] improve -Wcontext code and messages Johannes Berg
2008-04-21 18:37 ` [PATCH 0/3] improve context handling Josh Triplett
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=200804101805.31854.philipp.reisner@linbit.com \
--to=philipp.reisner@linbit.com \
--cc=johannes@sipsolutions.net \
--cc=josh@freedesktop.org \
--cc=linux-sparse@vger.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 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).