Re: [PATCH RFC tip/core/rcu 23/23] vhost: add __rcu annotations

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Paul E. McKenney
Date: Tuesday, May 18, 2010 - 7:20 am

On Mon, May 17, 2010 at 09:35:28PM -0400, Mathieu Desnoyers wrote:

[ . . . ]


My first thought is that we have added quite a bit of RCU consistency
check code in the past few months, so we should see what bugs they find
and what bugs escape.  It is all too easy to create consistency check
code that is more trouble than it is worth.

But in the meantime, let's see what would be required to check for
failures to insert grace-period delays:

o	There would need to be something like rcu_unreference(),
	rcu_no_more_readers() or some such after the grace period.
	The update side would then become something like the following:

		oldp = rcu_dereference_protected(gp, &mylock);
		rcu_assign_pointer(gp, newp);
		synchronize_rcu();
		rcu_no_more_readers(oldp);
		kfree(oldp);

o	There would need to be something to check all of the pointers
	traversed in the read-side critical sections:

		rcu_read_lock();
		...
		p1 = rcu_dereference(gp1->field1);
		...
		p2 = rcu_dereference(gp2->field2);
		...

		rcu_validate(p1);
		rcu_validate(p2);
		rcu_read_unlock();

One thing that bothers me about this is that we are forcing the developer
to do a lot of extra typing.  For example, rcu_no_more_readers() is in
a truth-and-beauty sense redundant with kfree() -- why type both?  The
same could be said about rcu_validate() and rcu_read_unlock(), but nested
RCU read-side critical sections make this difficult.

Or am I misunderstanding what you are suggesting?

							Thanx, Paul
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH RFC tip/core/rcu 08/23] cgroups: __rcu annotations, Paul E. McKenney, (Wed May 12, 2:33 pm)
[PATCH RFC tip/core/rcu 09/23] credentials: rcu annotation, Paul E. McKenney, (Wed May 12, 2:33 pm)
[PATCH RFC tip/core/rcu 10/23] keys: __rcu annotations, Paul E. McKenney, (Wed May 12, 2:33 pm)
[PATCH RFC tip/core/rcu 11/23] nfs: __rcu annotations, Paul E. McKenney, (Wed May 12, 2:33 pm)
[PATCH RFC tip/core/rcu 12/23] net: __rcu annotations for ..., Paul E. McKenney, (Wed May 12, 2:33 pm)
[PATCH RFC tip/core/rcu 13/23] perf_event: __rcu annotations, Paul E. McKenney, (Wed May 12, 2:33 pm)
[PATCH RFC tip/core/rcu 14/23] notifiers: __rcu annotations, Paul E. McKenney, (Wed May 12, 2:33 pm)
[PATCH RFC tip/core/rcu 15/23] radix-tree: __rcu annotations, Paul E. McKenney, (Wed May 12, 2:33 pm)
[PATCH RFC tip/core/rcu 16/23] idr: __rcu annotations, Paul E. McKenney, (Wed May 12, 2:33 pm)
[PATCH RFC tip/core/rcu 17/23] input: __rcu annotations, Paul E. McKenney, (Wed May 12, 2:33 pm)
[PATCH RFC tip/core/rcu 19/23] kvm: add __rcu annotations, Paul E. McKenney, (Wed May 12, 2:33 pm)
[PATCH RFC tip/core/rcu 20/23] kernel: __rcu annotations, Paul E. McKenney, (Wed May 12, 2:33 pm)
[PATCH RFC tip/core/rcu 21/23] net: __rcu annotations, Paul E. McKenney, (Wed May 12, 2:33 pm)
[PATCH RFC tip/core/rcu 22/23] kvm: more __rcu annotations, Paul E. McKenney, (Wed May 12, 2:33 pm)
[PATCH RFC tip/core/rcu 23/23] vhost: add __rcu annotations, Paul E. McKenney, (Wed May 12, 2:33 pm)
Re: [PATCH RFC tip/core/rcu 04/23] net: Make accesses to - ..., Stephen Hemminger, (Wed May 12, 2:44 pm)
Re: [PATCH RFC tip/core/rcu 23/23] vhost: add __rcu annota ..., Michael S. Tsirkin, (Wed May 12, 2:48 pm)
Re: [PATCH RFC tip/core/rcu 04/23] net: Make accesses to - ..., Stephen Hemminger, (Wed May 12, 6:33 pm)
Re: [PATCH RFC tip/core/rcu 23/23] vhost: add __rcu annota ..., Michael S. Tsirkin, (Wed May 12, 8:53 pm)
Re: [PATCH RFC tip/core/rcu 23/23] vhost: add __rcu annota ..., Michael S. Tsirkin, (Wed May 12, 9:50 pm)
Re: [PATCH RFC tip/core/rcu 17/23] input: __rcu annotations, Dmitry Torokhov, (Thu May 13, 12:40 am)
Re: [PATCH RFC tip/core/rcu 23/23] vhost: add __rcu annota ..., Paul E. McKenney, (Thu May 13, 12:55 pm)
Re: [PATCH RFC tip/core/rcu 02/23] rcu: add __rcu API for ..., Paul E. McKenney, (Thu May 13, 2:48 pm)
Re: [PATCH RFC tip/core/rcu 23/23] vhost: add __rcu annota ..., Michael S. Tsirkin, (Mon May 17, 1:33 pm)
Re: [PATCH RFC tip/core/rcu 23/23] vhost: add __rcu annota ..., Mathieu Desnoyers, (Mon May 17, 3:00 pm)
Re: [PATCH RFC tip/core/rcu 23/23] vhost: add __rcu annota ..., Michael S. Tsirkin, (Mon May 17, 4:08 pm)
Re: [PATCH RFC tip/core/rcu 23/23] vhost: add __rcu annota ..., Mathieu Desnoyers, (Mon May 17, 4:40 pm)
Re: [PATCH RFC tip/core/rcu 23/23] vhost: add __rcu annota ..., Mathieu Desnoyers, (Mon May 17, 6:35 pm)
Re: [PATCH RFC tip/core/rcu 23/23] vhost: add __rcu annota ..., Paul E. McKenney, (Tue May 18, 7:20 am)
Re: [PATCH RFC tip/core/rcu 23/23] vhost: add __rcu annota ..., Michael S. Tsirkin, (Tue May 18, 7:25 am)
Re: [PATCH RFC tip/core/rcu 23/23] vhost: add __rcu annota ..., Mathieu Desnoyers, (Tue May 18, 7:47 am)