[lttng-dev] Can userspace RCU be used with shared memory?
Devanjan Choudhury
devanjan.dev at gmail.com
Sun Sep 15 09:44:46 EDT 2013
Hello Mathieu,
We are interested in using userspace rcu for one of our projects.
Our main requirement is that we have some hash tables stored in shared
memory which will be accessed by multiple reader processes. We have one
single writer process. Since our use case is more read intensive compared
to write, we have choosen to use RCU to synchronize the shared data.
Now, when our writer process updates some nodes(lets say delete some node)
in hash tables stored in shared memory, it must call synchronize_rcu(),
before it can actually free up the node. However, one note in the
discussion (
http://lists.lttng.org/pipermail/lttng-dev/2012-December/019295.html)
states that synchronize_rcu() (or call_rcu()) executing in the context of
one process will not see the RCU read-side locks of another process. If
this is the case, then how/when can the writer process delete the node
permanently. Should we need to consider doing garbage collection on our own?
Also, if I undertsand correctly, shyncronize_rcu() does the following
basically:
void synchronize_rcu(void) { int cpu; for_each_online_cpu(cpu) run_on(cpu);
}
So, when our writer process call synchronize_rcu(), it will basically be
made to run on all the CPUs. Shouldn't this be sufficient to ensure that
any other reader process which had started a read rcu critical section has
completed?
--
Regards,
Devanjan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20130915/43ed9880/attachment.html>
More information about the lttng-dev
mailing list