Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] [RFC] re-document rculfstack and even rename it
@ 2012-10-10  7:52 Lai Jiangshan
  2012-10-10 14:59 ` Paul E. McKenney
  2012-10-11 18:22 ` Mathieu Desnoyers
  0 siblings, 2 replies; 4+ messages in thread
From: Lai Jiangshan @ 2012-10-10  7:52 UTC (permalink / raw)


rculfstack is not really require RCU-only.

1) cds_lfs_push_rcu() don't need any lock, don't need RCU nor other locks.

2) cds_lfs_pop_rcu() don't only one of the following synchronization(not only RCU):
	A) use rcu_read_lock() to protect cds_lfs_pop_rcu() and use synchronize_rcu()
           or call_rcu() to free the popped node. (current comments said we need this
           synchronization, and thus we named this struct with rcu prefix. But actually,
	   the followings are OK, and are more popular/friendly)
	B) use mutexs/locks to protect cds_lfs_pop_rcu(), we can free to free/modify the
	   popped node any time, we don't need any synchronization when free them.
	C) only ONE thread can call cds_lfs_pop_rcu(). (multi-providers-single customer)
	D) others, like read-write locks.

I consider B) and C) are more popular. In linux kernel,
kernel/task_work.c uses a hybird ways of B) and C).

I suggest to rename it, Or document B) and C) at least.

Thanks,
Lai



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-12  2:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-10  7:52 [lttng-dev] [RFC] re-document rculfstack and even rename it Lai Jiangshan
2012-10-10 14:59 ` Paul E. McKenney
2012-10-11 18:22 ` Mathieu Desnoyers
2012-10-12  2:25   ` Lai Jiangshan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox