<div dir="ltr">Thank you Amol and Phong for your valuable feedback. I have made the changes requested and sent the patch.<div><br></div><div><a href="https://lists.linuxfoundation.org/pipermail/linux-kernel-mentees/2019-November/001055.html" target="_blank">https://lists.linuxfoundation.org/pipermail/linux-kernel-mentees/2019-November/001055.html</a><br></div><div><br></div><div>Regards,</div><div>Madhuparna</div></div><div hspace="streak-pt-mark" style="max-height:1px"><img alt="" style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=abWFkaHVwYXJuYWJob3dtaWswNEBnbWFpbC5jb20%3D&amp;type=zerocontent&amp;guid=9c13d0fb-d0cd-4e01-9df0-988426ad16bd"><font color="#ffffff" size="1">ᐧ</font></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 5, 2019 at 8:15 PM Paul E. McKenney &lt;<a href="mailto:paulmck@kernel.org">paulmck@kernel.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Nov 05, 2019 at 08:03:44PM +0530, Amol Grover wrote:<br>
&gt; On Tue, Nov 05, 2019 at 06:04:11AM -0800, Paul E. McKenney wrote:<br>
&gt; &gt; On Tue, Nov 05, 2019 at 08:49:47PM +0700, Phong Tran wrote:<br>
&gt; &gt; &gt; On 10/29/19 3:24 AM, <a href="mailto:madhuparnabhowmik04@gmail.com" target="_blank">madhuparnabhowmik04@gmail.com</a> wrote:<br>
&gt; &gt; &gt; &gt; From: Madhuparna Bhowmik &lt;<a href="mailto:madhuparnabhowmik04@gmail.com" target="_blank">madhuparnabhowmik04@gmail.com</a>&gt;<br>
&gt; &gt; &gt; &gt; <br>
&gt; &gt; &gt; &gt; This patch converts arrayRCU from txt to rst format.<br>
&gt; &gt; &gt; &gt; arrayRCU.rst is also added in the index.rst file.<br>
&gt; &gt; &gt; &gt; <br>
&gt; &gt; &gt; &gt; Signed-off-by: Madhuparna Bhowmik &lt;<a href="mailto:madhuparnabhowmik04@gmail.com" target="_blank">madhuparnabhowmik04@gmail.com</a>&gt;<br>
&gt; &gt; &gt; &gt; ---<br>
&gt; &gt; &gt; &gt;   .../RCU/{arrayRCU.txt =&gt; arrayRCU.rst}         | 18 +++++++++++++-----<br>
&gt; &gt; &gt; &gt;   Documentation/RCU/index.rst                    |  1 +<br>
&gt; &gt; &gt; &gt;   2 files changed, 14 insertions(+), 5 deletions(-)<br>
&gt; &gt; &gt; &gt;   rename Documentation/RCU/{arrayRCU.txt =&gt; arrayRCU.rst} (91%)<br>
&gt; &gt; &gt; &gt; <br>
&gt; &gt; &gt; &gt; diff --git a/Documentation/RCU/arrayRCU.txt b/Documentation/RCU/arrayRCU.rst<br>
&gt; &gt; &gt; &gt; similarity index 91%<br>
&gt; &gt; &gt; &gt; rename from Documentation/RCU/arrayRCU.txt<br>
&gt; &gt; &gt; &gt; rename to Documentation/RCU/arrayRCU.rst<br>
&gt; &gt; &gt; &gt; index f05a9afb2c39..ed5ae24b196e 100644<br>
&gt; &gt; &gt; &gt; --- a/Documentation/RCU/arrayRCU.txt<br>
&gt; &gt; &gt; &gt; +++ b/Documentation/RCU/arrayRCU.rst<br>
&gt; &gt; &gt; &gt; @@ -1,5 +1,7 @@<br>
&gt; &gt; &gt; &gt; -Using RCU to Protect Read-Mostly Arrays<br>
&gt; &gt; &gt; &gt; +.. _array_rcu_doc:<br>
&gt; &gt; &gt; &gt; +Using RCU to Protect Read-Mostly Arrays<br>
&gt; &gt; &gt; &gt; +=======================================<br>
&gt; &gt; &gt; &gt;   Although RCU is more commonly used to protect linked lists, it can<br>
&gt; &gt; &gt; &gt;   also be used to protect arrays.  Three situations are as follows:<br>
&gt; &gt; &gt; &gt; @@ -26,6 +28,7 @@ described in the following sections.<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; It will be better to have the cross reference for each situation.<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; Hash Tables<br>
&gt; &gt; &gt; Static Arrays<br>
&gt; &gt; &gt; Resizeable Arrays<br>
&gt; &gt; <br>
&gt; &gt; Madhuparna, could you please put a patch together creating these<br>
&gt; &gt; cross-references and handling Phong&#39;s comments below (probably<br>
&gt; &gt; by getting rid of the &quot;.&quot; so that the resulting &quot;:&quot; doesn&#39;t look<br>
&gt; &gt; strange)?<br>
&gt; &gt; <br>
&gt; &gt; Then I will fold that patch into your original commit in -rcu and<br>
&gt; &gt; add Phong&#39;s Tested-by.<br>
&gt; &gt; <br>
&gt; &gt;                                                     Thanx, Paul<br>
&gt; &gt; <br>
&gt; &gt; &gt; &gt;   Situation 1: Hash Tables<br>
&gt; &gt; &gt; &gt; +------------------------<br>
&gt; &gt; &gt; &gt;   Hash tables are often implemented as an array, where each array entry<br>
&gt; &gt; &gt; &gt;   has a linked-list hash chain.  Each hash chain can be protected by RCU<br>
&gt; &gt; &gt; &gt; @@ -34,6 +37,7 @@ to other array-of-list situations, such as radix trees.<br>
&gt; &gt; &gt; &gt;   Situation 2: Static Arrays<br>
&gt; &gt; &gt; &gt; +--------------------------<br>
&gt; &gt; &gt; &gt;   Static arrays, where the data (rather than a pointer to the data) is<br>
&gt; &gt; &gt; &gt;   located in each array element, and where the array is never resized,<br>
&gt; &gt; &gt; &gt; @@ -41,11 +45,13 @@ have not been used with RCU.  Rik van Riel recommends using seqlock in<br>
&gt; &gt; &gt; &gt;   this situation, which would also have minimal read-side overhead as long<br>
&gt; &gt; &gt; &gt;   as updates are rare.<br>
&gt; &gt; &gt; &gt; -Quick Quiz:  Why is it so important that updates be rare when<br>
&gt; &gt; &gt; &gt; -            using seqlock?<br>
&gt; &gt; &gt; &gt; +Quick Quiz:<br>
&gt; &gt; &gt; &gt; +               Why is it so important that updates be rare when using seqlock?<br>
&gt; &gt; &gt; &gt; +:ref:`Answer to Quick Quiz &lt;answer_quick_quiz_seqlock&gt;`<br>
&gt; &gt; &gt; &gt;   Situation 3: Resizeable Arrays<br>
&gt; &gt; &gt; &gt; +------------------------------<br>
&gt; &gt; &gt; &gt;   Use of RCU for resizeable arrays is demonstrated by the grow_ary()<br>
&gt; &gt; &gt; &gt;   function formerly used by the System V IPC code.  The array is used<br>
&gt; &gt; &gt; &gt; @@ -60,7 +66,7 @@ the remainder of the new, updates the ids-&gt;entries pointer to point to<br>
&gt; &gt; &gt; &gt;   the new array, and invokes ipc_rcu_putref() to free up the old array.<br>
&gt; &gt; &gt; &gt;   Note that rcu_assign_pointer() is used to update the ids-&gt;entries pointer,<br>
&gt; &gt; &gt; &gt;   which includes any memory barriers required on whatever architecture<br>
&gt; &gt; &gt; &gt; -you are running on.<br>
&gt; &gt; &gt; &gt; +you are running on.::<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; a redundant &quot;:&quot; in here with html page.<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; &gt;         static int grow_ary(struct ipc_ids* ids, int newsize)<br>
&gt; &gt; &gt; &gt;         {<br>
&gt; &gt; &gt; &gt; @@ -112,7 +118,7 @@ a simple check suffices.  The pointer to the structure corresponding<br>
&gt; &gt; &gt; &gt;   to the desired IPC object is placed in &quot;out&quot;, with NULL indicating<br>
&gt; &gt; &gt; &gt;   a non-existent entry.  After acquiring &quot;out-&gt;lock&quot;, the &quot;out-&gt;deleted&quot;<br>
&gt; &gt; &gt; &gt;   flag indicates whether the IPC object is in the process of being<br>
&gt; &gt; &gt; &gt; -deleted, and, if not, the pointer is returned.<br>
&gt; &gt; &gt; &gt; +deleted, and, if not, the pointer is returned.::<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; same as above<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; Tested-by: Phong Tran &lt;<a href="mailto:tranmanphong@gmail.com" target="_blank">tranmanphong@gmail.com</a>&gt;<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; Regards,<br>
&gt; &gt; &gt; Phong.<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; &gt;         struct kern_ipc_perm* ipc_lock(struct ipc_ids* ids, int id)<br>
&gt; &gt; &gt; &gt;         {<br>
&gt; &gt; &gt; &gt; @@ -144,8 +150,10 @@ deleted, and, if not, the pointer is returned.<br>
&gt; &gt; &gt; &gt;                 return out;<br>
&gt; &gt; &gt; &gt;         }<br>
&gt; &gt; &gt; &gt; +.. _answer_quick_quiz_seqlock:<br>
&gt; &gt; &gt; &gt;   Answer to Quick Quiz:<br>
&gt; &gt; &gt; &gt; +       Why is it so important that updates be rare when using seqlock?<br>
&gt; &gt; &gt; &gt;         The reason that it is important that updates be rare when<br>
&gt; &gt; &gt; &gt;         using seqlock is that frequent updates can livelock readers.<br>
&gt; &gt; &gt; &gt; diff --git a/Documentation/RCU/index.rst b/Documentation/RCU/index.rst<br>
&gt; &gt; &gt; &gt; index 5c99185710fa..8d20d44f8fd4 100644<br>
&gt; &gt; &gt; &gt; --- a/Documentation/RCU/index.rst<br>
&gt; &gt; &gt; &gt; +++ b/Documentation/RCU/index.rst<br>
&gt; &gt; &gt; &gt; @@ -7,6 +7,7 @@ RCU concepts<br>
&gt; &gt; &gt; &gt;   .. toctree::<br>
&gt; &gt; &gt; &gt;      :maxdepth: 3<br>
&gt; &gt; &gt; &gt; +   arrayRCU<br>
&gt; &gt; &gt; &gt;      rcu<br>
&gt; &gt; &gt; &gt;      listRCU<br>
&gt; &gt; &gt; &gt;      UP<br>
&gt; &gt; &gt; &gt; <br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Linux-kernel-mentees mailing list<br>
&gt; &gt; <a href="mailto:Linux-kernel-mentees@lists.linuxfoundation.org" target="_blank">Linux-kernel-mentees@lists.linuxfoundation.org</a><br>
&gt; &gt; <a href="https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees</a><br>
&gt; <br>
&gt; Hey,<br>
&gt; There are a few instances in the document where words are<br>
&gt; emphasized. Example, -not- in the first paragraph. The <br>
&gt; previous emphasis was correct wrt txt format, but this<br>
&gt; could be converted to italicize/bold to keep up with the<br>
&gt; reST format. Other than this and what Phong suggested,<br>
&gt; everything looks good!<br>
&gt; <br>
&gt; Tested-by: Amol Grover &lt;<a href="mailto:frextrite@gmail.com" target="_blank">frextrite@gmail.com</a>&gt;<br>
<br>
Thank you, Amol!<br>
<br>
Madhuparna, could you please also include a fix to the &quot;-not-&quot;<br>
text-emphasis issue (and any other occurrences) that Amol located?<br>
<br>
I can then add both Phong&#39;s and Amol&#39;s Tested-by.<br>
<br>
                                                        Thanx, Paul<br>
</blockquote></div>