login
Header Space

 
 

Using sparse to catch invalid RCU dereferences?

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Paul E. McKenney <paulmck@...>
Cc: Linux Kernel list <linux-kernel@...>, linux-sparse <linux-sparse@...>
Date: Monday, April 7, 2008 - 6:04 pm

Hi,

Just a thought, I haven't tried this yet because I'm not entirely sure
it's actually correct. I was just thinking it should be possible to
introduce something like

	#define __rcu	__attribute__((address_space(3)))

(for sparse only, of course) and then be able to say

	struct myfoo *foo __rcu;

and sparse would warn on

	struct myfoo *bar =3D foo;

but not on

	struct myfoo *bar =3D rcu_dereference(foo);

by way of using __force inside rcu_dereference(), rcu_assign_pointer()
etc.

Would this be feasible? Or should one actually use __bitwise/__force to
also get the warning when assigning between two variables both marked
__rcu?

johannes
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Using sparse to catch invalid RCU dereferences?, Johannes Berg, (Mon Apr 7, 6:04 pm)
Re: Using sparse to catch invalid RCU dereferences?, Paul E. McKenney, (Tue Apr 8, 11:52 am)
Re: Using sparse to catch invalid RCU dereferences?, Peter Zijlstra, (Fri Apr 11, 2:18 pm)
Re: Using sparse to catch invalid RCU dereferences?, Paul E. McKenney, (Fri Apr 11, 2:43 pm)
Re: Using sparse to catch invalid RCU dereferences?, Johannes Berg, (Wed Apr 9, 4:09 pm)
Re: Using sparse to catch invalid RCU dereferences?, Paul E. McKenney, (Thu Apr 10, 6:32 pm)
Re: Using sparse to catch invalid RCU dereferences?, Johannes Berg, (Fri Apr 11, 4:54 pm)
Re: Using sparse to catch invalid RCU dereferences?, Johannes Berg, (Tue Apr 8, 12:09 pm)
Re: Using sparse to catch invalid RCU dereferences?, Paul E. McKenney, (Tue Apr 8, 1:24 pm)
speck-geostationary