lkml.org 
[lkml]   [2008]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC 1/3] add macros for new sparse features
From
Date

> 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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2008-04-11 14:23    [W:0.042 / U:0.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site