<div dir="ltr"><div><div><div><div>Hi Mathieu,<br><br></div>Thanks for your reply. I somehow missed this email of yours, and saw it today while I was clearing my inbox.<br><br></div>I appreciate your prompt response.<br><br></div>Thanks,<br></div>Siddharth<br><div><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 2, 2016 at 1:53 PM, Mathieu Desnoyers <span dir="ltr"><<a href="mailto:mathieu.desnoyers@efficios.com" target="_blank">mathieu.desnoyers@efficios.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:#000000"><span class=""><div><br></div><div><span>----- On Apr 29, 2016, at 3:10 PM, siddharth teotia <<a href="mailto:siddharthteotia@gmail.com" target="_blank">siddharthteotia@gmail.com</a>> wrote:<br></span></div></span><div><span class=""><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr"><div><div><div>The mail was accidentally sent. Here is more info:<br><br></div>My question really is that when writing a user space application that leverages RCU, how do I ensure that I am using the proper flavor/implementation of RCU ? I don't think so I can go ahead with non-preemptive RCU. And the user space paper does not really tell or distinguish clearly as to which of the following -- QSBR, MB, BP, signal can be used for preemptive environments and do not restrict the reader to not block or not sleep ?<br></div></div></div></blockquote></span><div><div>Hi,</div><div><br></div><div>You appear to be confused between concepts that apply to the Linux kernel</div><div>RCU implementation (preemptible vs non-preemptive RCU read-side critical</div><div>sections) and those that apply to the Userspace RCU library (flavors: mb, signal,</div><div>qsbr, bp).<br></div><div><br></div><div>All Userspace RCU flavors read-side critical sections are preemptible,<br></div><div>because we cannot disable preemption when running in user-space.<br></div><div>Therefore, you may block or sleep within liburcu read-side critical<br></div><div>sections. However, if you do so, you need to be careful not to place<br></div><div>calls to synchronize_rcu() within code that have a transitive blocking</div><div>dependency on a RCU read-side, which would cause a deadlock.<br></div><div><br></div><div>For instance, using the same mutex within a read-side critical section,<br></div><div>_and_ holding this mutex while calling synchronize_rcu() in another thread,<br></div><div>can trigger a deadlock.<br></div><div><br></div><div>The main differences between liburcu flavors is detailed here:<br></div><div><a href="https://lwn.net/Articles/573424/#URCU%20Flavors" target="_blank">https://lwn.net/Articles/573424/#URCU%20Flavors</a></div><div><br></div><div>Thanks,<br></div><div><br></div><div>Mathieu</div></div><div><br></div><div><br></div><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><span class=""><div dir="ltr"><div>Thanks,<br></div>Siddharth <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 29, 2016 at 12:07 PM, siddharth teotia <span dir="ltr"><<a href="mailto:siddharthteotia@gmail.com" target="_blank">siddharthteotia@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div>Hi Guys,<br><br></div>I recently started exploring RCU to build a lock free hash table. I have read quite a bit of literature from LWN on RCU, its usage, API etc. I have the following question for which I have had mixed answers online:<br><br></div>Does the user space implementation of RCU liburcu take care of preemptive v/s non-preemptive flavors of RCU. From what I understand RCU can be broadly divided into:<br><br></div>1. Classic RCU - High Performance but suitable for non-preemptive environments.<br></div>2. Preemptible RCU - Permits the reader to block on a resource or the read side critical sections to be preempted. But still does not allow any kind of sleep(). Moreover there seems to be some sort of limitation on the nature of blocking that can happen within RCU read side critical section.<br></div>3. Sleepable RCU - Seems to me an augmentation of preemptible RCU.<br><br></div>The paper that describes the user space implementation of RCU suggests 4 different flavors -- QSBR, Memory Barrier based, Bullet Proof, and Signal based. <br><br></div>I don't think so in my application I can afford to not have the readers block or even sleep. If the reader wants to take some orthogonal lock/latch on an entirely different resource, it might end waiting for it.<br><br></div>And because <br><div><div><div><div><div><div><div><div><div><br><br clear="all"></div></div></div></div></div></div></div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br><div><div><b><span style="color:#000066" color="#000066">Best Regards,</span></b></div><div><b><span style="color:#000066" color="#000066">SIDDHARTH TEOTIA</span></b></div><div><b><span style="color:#000066" color="#000066">2008C6PS540G</span></b></div><div><b><span style="color:#000066" color="#000066">BITS PILANI- GOA CAMPUS</span></b></div><div><b><span style="color:#000066" color="#000066"><a href="tel:%2B91%2087911%2075932" value="+918791175932" target="_blank">+91 87911 75932</a></span></b></div></div></div><br></span>_______________________________________________<br>lttng-dev mailing list<br><a href="mailto:lttng-dev@lists.lttng.org" target="_blank">lttng-dev@lists.lttng.org</a><br><a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><span class="HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- <br></div><div>Mathieu Desnoyers<br>EfficiOS Inc.<br><a href="http://www.efficios.com" target="_blank">http://www.efficios.com</a></div></font></span></div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div><b><font color="#000066">Best Regards,</font></b></div>
<div><b><font color="#000066">SIDDHARTH TEOTIA</font></b></div>
<div><b><font color="#000066">2008C6PS540G</font></b></div>
<div><b><font color="#000066">BITS PILANI- GOA CAMPUS</font></b></div>
<div><b><font color="#000066"></font></b> </div>
<div><b><font color="#000066">+91 87911 75932</font></b></div></div>
</div></div></div></div></div></div></div>