Skip to contentSkip to conversation

Documentation: RCU: whatisRCU: Fix formatting for section 2

PATCH Superseded Amol Grover 4 participants 10 messages Nov 4, 2019 – Nov 5, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: RCU: whatisRCU: Fix formatting for section 2

Convert RCU API method text to sub-headings and
add hyperlink and superscript to 2 literary notes
under rcu_dereference() section

---
 Documentation/RCU/whatisRCU.rst | 34 +++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
Documentation/RCU/whatisRCU.rst +28 -6
index ae40c8bcc56c..3cf6e17d0065 100644
@@ -150,6 +150,7 @@ later.  See the kernel docbook documentation for more info, or look directly
 at the function header comments.
 
 rcu_read_lock()
+^^^^^^^^^^^^^^^
 
 	void rcu_read_lock(void);
 
@@ -164,6 +165,7 @@ rcu_read_lock()
 	longer-term references to data structures.
 
 rcu_read_unlock()
+^^^^^^^^^^^^^^^^^
 
 	void rcu_read_unlock(void);
 
@@ -172,6 +174,7 @@ rcu_read_unlock()
 	read-side critical sections may be nested and/or overlapping.
 
 synchronize_rcu()
+^^^^^^^^^^^^^^^^^
 
 	void synchronize_rcu(void);
 
@@ -225,6 +228,7 @@ synchronize_rcu()
 	checklist.txt for some approaches to limiting the update rate.
 
 rcu_assign_pointer()
+^^^^^^^^^^^^^^^^^^^^
 
 	void rcu_assign_pointer(p, typeof(p) v);
 
@@ -245,6 +249,7 @@ rcu_assign_pointer()
 	the _rcu list-manipulation primitives such as list_add_rcu().
 
 rcu_dereference()
+^^^^^^^^^^^^^^^^^
 
 	typeof(p) rcu_dereference(p);
 
@@ -279,8 +284,10 @@ rcu_dereference()
 	if an update happened while in the critical section, and incur
 	unnecessary overhead on Alpha CPUs.
 
+.. _back_to_1:
+
 	Note that the value returned by rcu_dereference() is valid
-	only within the enclosing RCU read-side critical section [1].
+	only within the enclosing RCU read-side critical section |cs_1|.
 	For example, the following is -not- legal::
 
 		rcu_read_lock();
@@ -298,15 +305,27 @@ rcu_dereference()
 	it was acquired is just as illegal as doing so with normal
 	locking.
 
+.. _back_to_2:
+
 	As with rcu_assign_pointer(), an important function of
 	rcu_dereference() is to document which pointers are protected by
 	RCU, in particular, flagging a pointer that is subject to changing
 	at any time, including immediately after the rcu_dereference().
 	And, again like rcu_assign_pointer(), rcu_dereference() is
 	typically used indirectly, via the _rcu list-manipulation
-	primitives, such as list_for_each_entry_rcu() [2].
+	primitives, such as list_for_each_entry_rcu() |entry_2|.
+
+.. |cs_1| raw:: html
+
+	<a href="#cs"><sup>[1]</sup></a>
+
+.. |entry_2| raw:: html
 
-	[1] The variant rcu_dereference_protected() can be used outside
+	<a href="#entry"><sup>[2]</sup></a>
+
+.. _cs:
+
+	\ :sup:`[1]`\  The variant rcu_dereference_protected() can be used outside
 	of an RCU read-side critical section as long as the usage is
 	protected by locks acquired by the update-side code.  This variant
 	avoids the lockdep warning that would happen when using (for
@@ -317,15 +336,18 @@ rcu_dereference()
 	a lockdep expression to indicate which locks must be acquired
 	by the caller. If the indicated protection is not provided,
 	a lockdep splat is emitted.  See Documentation/RCU/Design/Requirements/Requirements.rst
-	and the API's code comments for more details and example usage.
+	and the API's code comments for more details and example usage. :ref:`back <back_to_1>`
+
+
+.. _entry:
 
-	[2] If the list_for_each_entry_rcu() instance might be used by
+	\ :sup:`[2]`\  If the list_for_each_entry_rcu() instance might be used by
 	update-side code as well as by RCU readers, then an additional
 	lockdep expression can be added to its list of arguments.
 	For example, given an additional "lock_is_held(&mylock)" argument,
 	the RCU lockdep code would complain only if this instance was
 	invoked outside of an RCU read-side critical section and without
-	the protection of mylock.
+	the protection of mylock. :ref:`back <back_to_2>`
 
 The following diagram shows how each API communicates among the
 reader, updater, and reclaimer.
Signature · 6 lines
2.20.1

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
maintainer
#1 lore raw
Quoted 5 lines · Amol Grover

Convert RCU API method text to sub-headings and
add hyperlink and superscript to 2 literary notes
under rcu_dereference() section

Good stuff, but Phong Tran beat you to it. If you are suggesting changes to that patch, please send a reply to her email, which may be found here:

https://lore.kernel.org/lkml/[email protected]/

There are several options for replying to this email listed at the bottom of that web page.

Thanx, Paul

Quoted 115 lines
---
 Documentation/RCU/whatisRCU.rst | 34 +++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
Documentation/RCU/whatisRCU.rst +28 -6
index ae40c8bcc56c..3cf6e17d0065 100644
@@ -150,6 +150,7 @@ later.  See the kernel docbook documentation for more info, or look directly
 at the function header comments.
 
 rcu_read_lock()
+^^^^^^^^^^^^^^^
 
 	void rcu_read_lock(void);
 
@@ -164,6 +165,7 @@ rcu_read_lock()
 	longer-term references to data structures.
 
 rcu_read_unlock()
+^^^^^^^^^^^^^^^^^
 
 	void rcu_read_unlock(void);
 
@@ -172,6 +174,7 @@ rcu_read_unlock()
 	read-side critical sections may be nested and/or overlapping.
 
 synchronize_rcu()
+^^^^^^^^^^^^^^^^^
 
 	void synchronize_rcu(void);
 
@@ -225,6 +228,7 @@ synchronize_rcu()
 	checklist.txt for some approaches to limiting the update rate.
 
 rcu_assign_pointer()
+^^^^^^^^^^^^^^^^^^^^
 
 	void rcu_assign_pointer(p, typeof(p) v);
 
@@ -245,6 +249,7 @@ rcu_assign_pointer()
 	the _rcu list-manipulation primitives such as list_add_rcu().
 
 rcu_dereference()
+^^^^^^^^^^^^^^^^^
 
 	typeof(p) rcu_dereference(p);
 
@@ -279,8 +284,10 @@ rcu_dereference()
 	if an update happened while in the critical section, and incur
 	unnecessary overhead on Alpha CPUs.
 
+.. _back_to_1:
+
 	Note that the value returned by rcu_dereference() is valid
-	only within the enclosing RCU read-side critical section [1].
+	only within the enclosing RCU read-side critical section |cs_1|.
 	For example, the following is -not- legal::
 
 		rcu_read_lock();
@@ -298,15 +305,27 @@ rcu_dereference()
 	it was acquired is just as illegal as doing so with normal
 	locking.
 
+.. _back_to_2:
+
 	As with rcu_assign_pointer(), an important function of
 	rcu_dereference() is to document which pointers are protected by
 	RCU, in particular, flagging a pointer that is subject to changing
 	at any time, including immediately after the rcu_dereference().
 	And, again like rcu_assign_pointer(), rcu_dereference() is
 	typically used indirectly, via the _rcu list-manipulation
-	primitives, such as list_for_each_entry_rcu() [2].
+	primitives, such as list_for_each_entry_rcu() |entry_2|.
+
+.. |cs_1| raw:: html
+
+	<a href="#cs"><sup>[1]</sup></a>
+
+.. |entry_2| raw:: html
 
-	[1] The variant rcu_dereference_protected() can be used outside
+	<a href="#entry"><sup>[2]</sup></a>
+
+.. _cs:
+
+	\ :sup:`[1]`\  The variant rcu_dereference_protected() can be used outside
 	of an RCU read-side critical section as long as the usage is
 	protected by locks acquired by the update-side code.  This variant
 	avoids the lockdep warning that would happen when using (for
@@ -317,15 +336,18 @@ rcu_dereference()
 	a lockdep expression to indicate which locks must be acquired
 	by the caller. If the indicated protection is not provided,
 	a lockdep splat is emitted.  See Documentation/RCU/Design/Requirements/Requirements.rst
-	and the API's code comments for more details and example usage.
+	and the API's code comments for more details and example usage. :ref:`back <back_to_1>`
+
+
+.. _entry:
 
-	[2] If the list_for_each_entry_rcu() instance might be used by
+	\ :sup:`[2]`\  If the list_for_each_entry_rcu() instance might be used by
 	update-side code as well as by RCU readers, then an additional
 	lockdep expression can be added to its list of arguments.
 	For example, given an additional "lock_is_held(&mylock)" argument,
 	the RCU lockdep code would complain only if this instance was
 	invoked outside of an RCU read-side critical section and without
-	the protection of mylock.
+	the protection of mylock. :ref:`back <back_to_2>`
 
 The following diagram shows how each API communicates among the
 reader, updater, and reclaimer.
Signature · 1 line
2.20.1

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#2 lore raw
Quoted 11 lines · Paul E. McKenney
Quoted 5 lines · Amol Grover

Convert RCU API method text to sub-headings and
add hyperlink and superscript to 2 literary notes
under rcu_dereference() section

Good stuff, but Phong Tran beat you to it. If you are suggesting changes to that patch, please send a reply to her email, which may be found here:

Quoted 6 lines

https://lore.kernel.org/lkml/[email protected]/

There are several options for replying to this email listed at the bottom of that web page.

Thanx, Paul

Thank you Paul! And that is correct, I was suggesting changes to that patch. However, since that patch was already integrated into the dev branch, I mistakenly believed this patch could be sent independently. Sorry for the trouble, I'll re-send the patch the correct way.

Thank you
Amol

Quoted 116 lines
Quoted 116 lines
---
 Documentation/RCU/whatisRCU.rst | 34 +++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
Documentation/RCU/whatisRCU.rst +28 -6
index ae40c8bcc56c..3cf6e17d0065 100644
@@ -150,6 +150,7 @@ later.  See the kernel docbook documentation for more info, or look directly
 at the function header comments.
 
 rcu_read_lock()
+^^^^^^^^^^^^^^^
 
 	void rcu_read_lock(void);
 
@@ -164,6 +165,7 @@ rcu_read_lock()
 	longer-term references to data structures.
 
 rcu_read_unlock()
+^^^^^^^^^^^^^^^^^
 
 	void rcu_read_unlock(void);
 
@@ -172,6 +174,7 @@ rcu_read_unlock()
 	read-side critical sections may be nested and/or overlapping.
 
 synchronize_rcu()
+^^^^^^^^^^^^^^^^^
 
 	void synchronize_rcu(void);
 
@@ -225,6 +228,7 @@ synchronize_rcu()
 	checklist.txt for some approaches to limiting the update rate.
 
 rcu_assign_pointer()
+^^^^^^^^^^^^^^^^^^^^
 
 	void rcu_assign_pointer(p, typeof(p) v);
 
@@ -245,6 +249,7 @@ rcu_assign_pointer()
 	the _rcu list-manipulation primitives such as list_add_rcu().
 
 rcu_dereference()
+^^^^^^^^^^^^^^^^^
 
 	typeof(p) rcu_dereference(p);
 
@@ -279,8 +284,10 @@ rcu_dereference()
 	if an update happened while in the critical section, and incur
 	unnecessary overhead on Alpha CPUs.
 
+.. _back_to_1:
+
 	Note that the value returned by rcu_dereference() is valid
-	only within the enclosing RCU read-side critical section [1].
+	only within the enclosing RCU read-side critical section |cs_1|.
 	For example, the following is -not- legal::
 
 		rcu_read_lock();
@@ -298,15 +305,27 @@ rcu_dereference()
 	it was acquired is just as illegal as doing so with normal
 	locking.
 
+.. _back_to_2:
+
 	As with rcu_assign_pointer(), an important function of
 	rcu_dereference() is to document which pointers are protected by
 	RCU, in particular, flagging a pointer that is subject to changing
 	at any time, including immediately after the rcu_dereference().
 	And, again like rcu_assign_pointer(), rcu_dereference() is
 	typically used indirectly, via the _rcu list-manipulation
-	primitives, such as list_for_each_entry_rcu() [2].
+	primitives, such as list_for_each_entry_rcu() |entry_2|.
+
+.. |cs_1| raw:: html
+
+	<a href="#cs"><sup>[1]</sup></a>
+
+.. |entry_2| raw:: html
 
-	[1] The variant rcu_dereference_protected() can be used outside
+	<a href="#entry"><sup>[2]</sup></a>
+
+.. _cs:
+
+	\ :sup:`[1]`\  The variant rcu_dereference_protected() can be used outside
 	of an RCU read-side critical section as long as the usage is
 	protected by locks acquired by the update-side code.  This variant
 	avoids the lockdep warning that would happen when using (for
@@ -317,15 +336,18 @@ rcu_dereference()
 	a lockdep expression to indicate which locks must be acquired
 	by the caller. If the indicated protection is not provided,
 	a lockdep splat is emitted.  See Documentation/RCU/Design/Requirements/Requirements.rst
-	and the API's code comments for more details and example usage.
+	and the API's code comments for more details and example usage. :ref:`back <back_to_1>`
+
+
+.. _entry:
 
-	[2] If the list_for_each_entry_rcu() instance might be used by
+	\ :sup:`[2]`\  If the list_for_each_entry_rcu() instance might be used by
 	update-side code as well as by RCU readers, then an additional
 	lockdep expression can be added to its list of arguments.
 	For example, given an additional "lock_is_held(&mylock)" argument,
 	the RCU lockdep code would complain only if this instance was
 	invoked outside of an RCU read-side critical section and without
-	the protection of mylock.
+	the protection of mylock. :ref:`back <back_to_2>`
 
 The following diagram shows how each API communicates among the
 reader, updater, and reclaimer.
Signature · 1 line
2.20.1
maintainer
#3 lore raw
Quoted 14 lines · Amol Grover
Quoted 13 lines · Paul E. McKenney
Quoted 5 lines · Amol Grover

Convert RCU API method text to sub-headings and
add hyperlink and superscript to 2 literary notes
under rcu_dereference() section

Good stuff, but Phong Tran beat you to it. If you are suggesting changes to that patch, please send a reply to her email, which may be found here:

https://lore.kernel.org/lkml/[email protected]/

Quoted 8 lines
Quoted 2 lines

There are several options for replying to this email listed at the bottom of that web page.

Thank you Paul! And that is correct, I was suggesting changes to that patch. However, since that patch was already integrated into the dev branch, I mistakenly believed this patch could be sent independently. Sorry for the trouble, I'll re-send the patch the correct way.

It is of course only polite to include the author of the previous patch on CC, both using the "Cc: Phong Tran <[email protected]>" tag following your "Signed-off" by.

Thanx, Paul

Quoted 119 lines

Thank you
Amol

Quoted 116 lines
Quoted 116 lines
---
 Documentation/RCU/whatisRCU.rst | 34 +++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
Documentation/RCU/whatisRCU.rst +28 -6
index ae40c8bcc56c..3cf6e17d0065 100644
@@ -150,6 +150,7 @@ later.  See the kernel docbook documentation for more info, or look directly
 at the function header comments.
 
 rcu_read_lock()
+^^^^^^^^^^^^^^^
 
 	void rcu_read_lock(void);
 
@@ -164,6 +165,7 @@ rcu_read_lock()
 	longer-term references to data structures.
 
 rcu_read_unlock()
+^^^^^^^^^^^^^^^^^
 
 	void rcu_read_unlock(void);
 
@@ -172,6 +174,7 @@ rcu_read_unlock()
 	read-side critical sections may be nested and/or overlapping.
 
 synchronize_rcu()
+^^^^^^^^^^^^^^^^^
 
 	void synchronize_rcu(void);
 
@@ -225,6 +228,7 @@ synchronize_rcu()
 	checklist.txt for some approaches to limiting the update rate.
 
 rcu_assign_pointer()
+^^^^^^^^^^^^^^^^^^^^
 
 	void rcu_assign_pointer(p, typeof(p) v);
 
@@ -245,6 +249,7 @@ rcu_assign_pointer()
 	the _rcu list-manipulation primitives such as list_add_rcu().
 
 rcu_dereference()
+^^^^^^^^^^^^^^^^^
 
 	typeof(p) rcu_dereference(p);
 
@@ -279,8 +284,10 @@ rcu_dereference()
 	if an update happened while in the critical section, and incur
 	unnecessary overhead on Alpha CPUs.
 
+.. _back_to_1:
+
 	Note that the value returned by rcu_dereference() is valid
-	only within the enclosing RCU read-side critical section [1].
+	only within the enclosing RCU read-side critical section |cs_1|.
 	For example, the following is -not- legal::
 
 		rcu_read_lock();
@@ -298,15 +305,27 @@ rcu_dereference()
 	it was acquired is just as illegal as doing so with normal
 	locking.
 
+.. _back_to_2:
+
 	As with rcu_assign_pointer(), an important function of
 	rcu_dereference() is to document which pointers are protected by
 	RCU, in particular, flagging a pointer that is subject to changing
 	at any time, including immediately after the rcu_dereference().
 	And, again like rcu_assign_pointer(), rcu_dereference() is
 	typically used indirectly, via the _rcu list-manipulation
-	primitives, such as list_for_each_entry_rcu() [2].
+	primitives, such as list_for_each_entry_rcu() |entry_2|.
+
+.. |cs_1| raw:: html
+
+	<a href="#cs"><sup>[1]</sup></a>
+
+.. |entry_2| raw:: html
 
-	[1] The variant rcu_dereference_protected() can be used outside
+	<a href="#entry"><sup>[2]</sup></a>
+
+.. _cs:
+
+	\ :sup:`[1]`\  The variant rcu_dereference_protected() can be used outside
 	of an RCU read-side critical section as long as the usage is
 	protected by locks acquired by the update-side code.  This variant
 	avoids the lockdep warning that would happen when using (for
@@ -317,15 +336,18 @@ rcu_dereference()
 	a lockdep expression to indicate which locks must be acquired
 	by the caller. If the indicated protection is not provided,
 	a lockdep splat is emitted.  See Documentation/RCU/Design/Requirements/Requirements.rst
-	and the API's code comments for more details and example usage.
+	and the API's code comments for more details and example usage. :ref:`back <back_to_1>`
+
+
+.. _entry:
 
-	[2] If the list_for_each_entry_rcu() instance might be used by
+	\ :sup:`[2]`\  If the list_for_each_entry_rcu() instance might be used by
 	update-side code as well as by RCU readers, then an additional
 	lockdep expression can be added to its list of arguments.
 	For example, given an additional "lock_is_held(&mylock)" argument,
 	the RCU lockdep code would complain only if this instance was
 	invoked outside of an RCU read-side critical section and without
-	the protection of mylock.
+	the protection of mylock. :ref:`back <back_to_2>`
 
 The following diagram shows how each API communicates among the
 reader, updater, and reclaimer.
Signature · 1 line
2.20.1
reviewer
#4 lore raw

Hi Amol,

Quoted 7 lines · Paul E. McKenney
Quoted 6 lines · Amol Grover
Quoted 5 lines · Paul E. McKenney
Quoted 4 lines · Amol Grover

Convert RCU API method text to sub-headings and
add hyperlink and superscript to 2 literary notes
under rcu_dereference() section

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

Good stuff, but Phong Tran beat you to it. If you are suggesting changes to that patch, please send a reply to her email, which may be found here:

Please do a review and send comments and suggestions in an email instead of a patch.

Quoted 11 lines
Quoted 10 lines
Quoted 4 lines

https://lore.kernel.org/lkml/[email protected]/

There are several options for replying to this email listed at the bottom of that web page.

Thank you Paul! And that is correct, I was suggesting changes to that patch. However, since that patch was already integrated into the dev branch, I mistakenly believed this patch could be sent independently. Sorry for the trouble, I'll re-send the patch the correct way.

Please drop your patch and do a review for the patch as suggested by Paul. This should have been a review and not a patch on top.

thanks,
-- Shuah

#5 lore raw
Quoted 12 lines · Shuah Khan

Hi Amol,

Quoted 9 lines · Paul E. McKenney
Quoted 8 lines · Amol Grover
Quoted 7 lines · Paul E. McKenney
Quoted 5 lines · Amol Grover

Convert RCU API method text to sub-headings and
add hyperlink and superscript to 2 literary notes
under rcu_dereference() section

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Good stuff, but Phong Tran beat you to it. If you are suggesting changes to that patch, please send a reply to her email, which may be found here:

Please do a review and send comments and suggestions in an email instead of a patch.

Hi Shuah,

Sure thing! I'll do a review and send in the suggestions.

Quoted 13 lines
Quoted 12 lines
Quoted 11 lines
Quoted 5 lines

https://lore.kernel.org/lkml/[email protected]/

There are several options for replying to this email listed at the bottom of that web page.

Thank you Paul! And that is correct, I was suggesting changes to that patch. However, since that patch was already integrated into the dev branch, I mistakenly believed this patch could be sent independently. Sorry for the trouble, I'll re-send the patch the correct way.

Quoted 2 lines

Please drop your patch and do a review for the patch as suggested by Paul. This should have been a review and not a patch on top.

Noted. Will definitely keep this in mind the next time.

Thank you
Amol

Quoted 3 lines

thanks,
-- Shuah

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#6 lore raw
In reply to Amol Grover
Quoted 71 lines · Amol Grover

Convert RCU API method text to sub-headings and
add hyperlink and superscript to 2 literary notes
under rcu_dereference() section

---
 Documentation/RCU/whatisRCU.rst | 34 +++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
Documentation/RCU/whatisRCU.rst +10 -1
index ae40c8bcc56c..3cf6e17d0065 100644
@@ -150,6 +150,7 @@ later.  See the kernel docbook documentation for more info, or look directly
 at the function header comments.
 
 rcu_read_lock()
+^^^^^^^^^^^^^^^
 
 	void rcu_read_lock(void);
 
@@ -164,6 +165,7 @@ rcu_read_lock()
 	longer-term references to data structures.
 
 rcu_read_unlock()
+^^^^^^^^^^^^^^^^^
 
 	void rcu_read_unlock(void);
 
@@ -172,6 +174,7 @@ rcu_read_unlock()
 	read-side critical sections may be nested and/or overlapping.
 
 synchronize_rcu()
+^^^^^^^^^^^^^^^^^
 
 	void synchronize_rcu(void);
 
@@ -225,6 +228,7 @@ synchronize_rcu()
 	checklist.txt for some approaches to limiting the update rate.
 
 rcu_assign_pointer()
+^^^^^^^^^^^^^^^^^^^^
 
 	void rcu_assign_pointer(p, typeof(p) v);
 
@@ -245,6 +249,7 @@ rcu_assign_pointer()
 	the _rcu list-manipulation primitives such as list_add_rcu().
 
 rcu_dereference()
+^^^^^^^^^^^^^^^^^
 
 	typeof(p) rcu_dereference(p);
 
@@ -279,8 +284,10 @@ rcu_dereference()
 	if an update happened while in the critical section, and incur
 	unnecessary overhead on Alpha CPUs.
 
+.. _back_to_1:
+
 	Note that the value returned by rcu_dereference() is valid
-	only within the enclosing RCU read-side critical section [1].
+	only within the enclosing RCU read-side critical section |cs_1|.
 	For example, the following is -not- legal::
 
 		rcu_read_lock();
@@ -298,15 +305,27 @@ rcu_dereference()
 	it was acquired is just as illegal as doing so with normal
 	locking.
 
+.. _back_to_2:
+

Documentation/RCU/whatisRCU.rst rcu_dereference() · line 318

Quoted 10 lines
Documentation/RCU/whatisRCU.rst +3 -1
 	As with rcu_assign_pointer(), an important function of
 	rcu_dereference() is to document which pointers are protected by
 	RCU, in particular, flagging a pointer that is subject to changing
 	at any time, including immediately after the rcu_dereference().
 	And, again like rcu_assign_pointer(), rcu_dereference() is
 	typically used indirectly, via the _rcu list-manipulation
-	primitives, such as list_for_each_entry_rcu() [2].
+	primitives, such as list_for_each_entry_rcu() |entry_2|.
+
+.. |cs_1| raw:: html

Please don't use raw. It's ugly and error prone. We have some raw output for latex, but this would be the first for html.

What are you trying to achieve?

BR,
Jani.

Quoted 36 lines
Documentation/RCU/whatisRCU.rst +15 -4
+
+	<a href="#cs"><sup>[1]</sup></a>
+
+.. |entry_2| raw:: html
 
-	[1] The variant rcu_dereference_protected() can be used outside
+	<a href="#entry"><sup>[2]</sup></a>
+
+.. _cs:
+
+	\ :sup:`[1]`\  The variant rcu_dereference_protected() can be used outside
 	of an RCU read-side critical section as long as the usage is
 	protected by locks acquired by the update-side code.  This variant
 	avoids the lockdep warning that would happen when using (for
@@ -317,15 +336,18 @@ rcu_dereference()
 	a lockdep expression to indicate which locks must be acquired
 	by the caller. If the indicated protection is not provided,
 	a lockdep splat is emitted.  See Documentation/RCU/Design/Requirements/Requirements.rst
-	and the API's code comments for more details and example usage.
+	and the API's code comments for more details and example usage. :ref:`back <back_to_1>`
+
+
+.. _entry:
 
-	[2] If the list_for_each_entry_rcu() instance might be used by
+	\ :sup:`[2]`\  If the list_for_each_entry_rcu() instance might be used by
 	update-side code as well as by RCU readers, then an additional
 	lockdep expression can be added to its list of arguments.
 	For example, given an additional "lock_is_held(&mylock)" argument,
 	the RCU lockdep code would complain only if this instance was
 	invoked outside of an RCU read-side critical section and without
-	the protection of mylock.
+	the protection of mylock. :ref:`back <back_to_2>`
 
 The following diagram shows how each API communicates among the
 reader, updater, and reclaimer.
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
#7 lore raw
Quoted 86 lines · Jani Nikula
Quoted 71 lines · Amol Grover

Convert RCU API method text to sub-headings and
add hyperlink and superscript to 2 literary notes
under rcu_dereference() section

---
 Documentation/RCU/whatisRCU.rst | 34 +++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
Documentation/RCU/whatisRCU.rst +10 -1
index ae40c8bcc56c..3cf6e17d0065 100644
@@ -150,6 +150,7 @@ later.  See the kernel docbook documentation for more info, or look directly
 at the function header comments.
 
 rcu_read_lock()
+^^^^^^^^^^^^^^^
 
 	void rcu_read_lock(void);
 
@@ -164,6 +165,7 @@ rcu_read_lock()
 	longer-term references to data structures.
 
 rcu_read_unlock()
+^^^^^^^^^^^^^^^^^
 
 	void rcu_read_unlock(void);
 
@@ -172,6 +174,7 @@ rcu_read_unlock()
 	read-side critical sections may be nested and/or overlapping.
 
 synchronize_rcu()
+^^^^^^^^^^^^^^^^^
 
 	void synchronize_rcu(void);
 
@@ -225,6 +228,7 @@ synchronize_rcu()
 	checklist.txt for some approaches to limiting the update rate.
 
 rcu_assign_pointer()
+^^^^^^^^^^^^^^^^^^^^
 
 	void rcu_assign_pointer(p, typeof(p) v);
 
@@ -245,6 +249,7 @@ rcu_assign_pointer()
 	the _rcu list-manipulation primitives such as list_add_rcu().
 
 rcu_dereference()
+^^^^^^^^^^^^^^^^^
 
 	typeof(p) rcu_dereference(p);
 
@@ -279,8 +284,10 @@ rcu_dereference()
 	if an update happened while in the critical section, and incur
 	unnecessary overhead on Alpha CPUs.
 
+.. _back_to_1:
+
 	Note that the value returned by rcu_dereference() is valid
-	only within the enclosing RCU read-side critical section [1].
+	only within the enclosing RCU read-side critical section |cs_1|.
 	For example, the following is -not- legal::
 
 		rcu_read_lock();
@@ -298,15 +305,27 @@ rcu_dereference()
 	it was acquired is just as illegal as doing so with normal
 	locking.
 
+.. _back_to_2:
+

Documentation/RCU/whatisRCU.rst rcu_dereference() · line 318

Quoted 10 lines
Documentation/RCU/whatisRCU.rst +3 -1
 	As with rcu_assign_pointer(), an important function of
 	rcu_dereference() is to document which pointers are protected by
 	RCU, in particular, flagging a pointer that is subject to changing
 	at any time, including immediately after the rcu_dereference().
 	And, again like rcu_assign_pointer(), rcu_dereference() is
 	typically used indirectly, via the _rcu list-manipulation
-	primitives, such as list_for_each_entry_rcu() [2].
+	primitives, such as list_for_each_entry_rcu() |entry_2|.
+
+.. |cs_1| raw:: html

Please don't use raw. It's ugly and error prone. We have some raw output for latex, but this would be the first for html.

Quoted 1 line

What are you trying to achieve?

Hi Jani,
While going through the documentation I encountered a few footnotes (numbers
[1] and [2]) which referenced the actual footnote somewhere below the text. They were particularly not straight-forward to find hence I decided to link them to the footnote text which could be done using inline markup. Then I tried to make them more appealing by converting to super-scripts (the way they look like in books and websites). However, nested inline markup is not yet possible in reST hence I went with the html way to achieve the same. Too much?

Thank you
Amol

Quoted 43 lines

BR,
Jani.

Quoted 36 lines
Documentation/RCU/whatisRCU.rst +15 -4
+
+	<a href="#cs"><sup>[1]</sup></a>
+
+.. |entry_2| raw:: html
 
-	[1] The variant rcu_dereference_protected() can be used outside
+	<a href="#entry"><sup>[2]</sup></a>
+
+.. _cs:
+
+	\ :sup:`[1]`\  The variant rcu_dereference_protected() can be used outside
 	of an RCU read-side critical section as long as the usage is
 	protected by locks acquired by the update-side code.  This variant
 	avoids the lockdep warning that would happen when using (for
@@ -317,15 +336,18 @@ rcu_dereference()
 	a lockdep expression to indicate which locks must be acquired
 	by the caller. If the indicated protection is not provided,
 	a lockdep splat is emitted.  See Documentation/RCU/Design/Requirements/Requirements.rst
-	and the API's code comments for more details and example usage.
+	and the API's code comments for more details and example usage. :ref:`back <back_to_1>`
+
+
+.. _entry:
 
-	[2] If the list_for_each_entry_rcu() instance might be used by
+	\ :sup:`[2]`\  If the list_for_each_entry_rcu() instance might be used by
 	update-side code as well as by RCU readers, then an additional
 	lockdep expression can be added to its list of arguments.
 	For example, given an additional "lock_is_held(&mylock)" argument,
 	the RCU lockdep code would complain only if this instance was
 	invoked outside of an RCU read-side critical section and without
-	the protection of mylock.
+	the protection of mylock. :ref:`back <back_to_2>`
 
 The following diagram shows how each API communicates among the
 reader, updater, and reclaimer.
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
#8 lore raw
Quoted 89 lines · Amol Grover
Quoted 86 lines · Jani Nikula
Quoted 71 lines · Amol Grover

Convert RCU API method text to sub-headings and
add hyperlink and superscript to 2 literary notes
under rcu_dereference() section

---
 Documentation/RCU/whatisRCU.rst | 34 +++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
Documentation/RCU/whatisRCU.rst +10 -1
index ae40c8bcc56c..3cf6e17d0065 100644
@@ -150,6 +150,7 @@ later.  See the kernel docbook documentation for more info, or look directly
 at the function header comments.
 
 rcu_read_lock()
+^^^^^^^^^^^^^^^
 
 	void rcu_read_lock(void);
 
@@ -164,6 +165,7 @@ rcu_read_lock()
 	longer-term references to data structures.
 
 rcu_read_unlock()
+^^^^^^^^^^^^^^^^^
 
 	void rcu_read_unlock(void);
 
@@ -172,6 +174,7 @@ rcu_read_unlock()
 	read-side critical sections may be nested and/or overlapping.
 
 synchronize_rcu()
+^^^^^^^^^^^^^^^^^
 
 	void synchronize_rcu(void);
 
@@ -225,6 +228,7 @@ synchronize_rcu()
 	checklist.txt for some approaches to limiting the update rate.
 
 rcu_assign_pointer()
+^^^^^^^^^^^^^^^^^^^^
 
 	void rcu_assign_pointer(p, typeof(p) v);
 
@@ -245,6 +249,7 @@ rcu_assign_pointer()
 	the _rcu list-manipulation primitives such as list_add_rcu().
 
 rcu_dereference()
+^^^^^^^^^^^^^^^^^
 
 	typeof(p) rcu_dereference(p);
 
@@ -279,8 +284,10 @@ rcu_dereference()
 	if an update happened while in the critical section, and incur
 	unnecessary overhead on Alpha CPUs.
 
+.. _back_to_1:
+
 	Note that the value returned by rcu_dereference() is valid
-	only within the enclosing RCU read-side critical section [1].
+	only within the enclosing RCU read-side critical section |cs_1|.
 	For example, the following is -not- legal::
 
 		rcu_read_lock();
@@ -298,15 +305,27 @@ rcu_dereference()
 	it was acquired is just as illegal as doing so with normal
 	locking.
 
+.. _back_to_2:
+

Documentation/RCU/whatisRCU.rst rcu_dereference() · line 318

Quoted 10 lines
Documentation/RCU/whatisRCU.rst +3 -1
 	As with rcu_assign_pointer(), an important function of
 	rcu_dereference() is to document which pointers are protected by
 	RCU, in particular, flagging a pointer that is subject to changing
 	at any time, including immediately after the rcu_dereference().
 	And, again like rcu_assign_pointer(), rcu_dereference() is
 	typically used indirectly, via the _rcu list-manipulation
-	primitives, such as list_for_each_entry_rcu() [2].
+	primitives, such as list_for_each_entry_rcu() |entry_2|.
+
+.. |cs_1| raw:: html

Please don't use raw. It's ugly and error prone. We have some raw output for latex, but this would be the first for html.

Quoted 1 line

What are you trying to achieve?

Quoted 9 lines

Hi Jani,
While going through the documentation I encountered a few footnotes (numbers
[1] and [2]) which referenced the actual footnote somewhere below the text. They were particularly not straight-forward to find hence I decided to link them to the footnote text which could be done using inline markup. Then I tried to make them more appealing by converting to super-scripts (the way they look like in books and websites). However, nested inline markup is not yet possible in reST hence I went with the html way to achieve the same. Too much?

I suggest you use rst footnote markup. It's less of an eye sore in the rst source, but provides you with the links in the generated output. And typically would be superscript. In particular "autonumber labels" might fit the bill. [1][2]

BR,
Jani.

[1] http://docutils.sourceforge.net/docs/user/rst/quickref.html#footnotes
[2] http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#footnotes

Quoted 47 lines

Thank you
Amol

Quoted 43 lines

BR,
Jani.

Quoted 36 lines
Documentation/RCU/whatisRCU.rst +15 -4
+
+	<a href="#cs"><sup>[1]</sup></a>
+
+.. |entry_2| raw:: html
 
-	[1] The variant rcu_dereference_protected() can be used outside
+	<a href="#entry"><sup>[2]</sup></a>
+
+.. _cs:
+
+	\ :sup:`[1]`\  The variant rcu_dereference_protected() can be used outside
 	of an RCU read-side critical section as long as the usage is
 	protected by locks acquired by the update-side code.  This variant
 	avoids the lockdep warning that would happen when using (for
@@ -317,15 +336,18 @@ rcu_dereference()
 	a lockdep expression to indicate which locks must be acquired
 	by the caller. If the indicated protection is not provided,
 	a lockdep splat is emitted.  See Documentation/RCU/Design/Requirements/Requirements.rst
-	and the API's code comments for more details and example usage.
+	and the API's code comments for more details and example usage. :ref:`back <back_to_1>`
+
+
+.. _entry:
 
-	[2] If the list_for_each_entry_rcu() instance might be used by
+	\ :sup:`[2]`\  If the list_for_each_entry_rcu() instance might be used by
 	update-side code as well as by RCU readers, then an additional
 	lockdep expression can be added to its list of arguments.
 	For example, given an additional "lock_is_held(&mylock)" argument,
 	the RCU lockdep code would complain only if this instance was
 	invoked outside of an RCU read-side critical section and without
-	the protection of mylock.
+	the protection of mylock. :ref:`back <back_to_2>`
 
 The following diagram shows how each API communicates among the
 reader, updater, and reclaimer.
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
#9 lore raw
Quoted 155 lines · Jani Nikula
Quoted 89 lines · Amol Grover
Quoted 86 lines · Jani Nikula
Quoted 71 lines · Amol Grover

Convert RCU API method text to sub-headings and
add hyperlink and superscript to 2 literary notes
under rcu_dereference() section

---
 Documentation/RCU/whatisRCU.rst | 34 +++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
Documentation/RCU/whatisRCU.rst +10 -1
index ae40c8bcc56c..3cf6e17d0065 100644
@@ -150,6 +150,7 @@ later.  See the kernel docbook documentation for more info, or look directly
 at the function header comments.
 
 rcu_read_lock()
+^^^^^^^^^^^^^^^
 
 	void rcu_read_lock(void);
 
@@ -164,6 +165,7 @@ rcu_read_lock()
 	longer-term references to data structures.
 
 rcu_read_unlock()
+^^^^^^^^^^^^^^^^^
 
 	void rcu_read_unlock(void);
 
@@ -172,6 +174,7 @@ rcu_read_unlock()
 	read-side critical sections may be nested and/or overlapping.
 
 synchronize_rcu()
+^^^^^^^^^^^^^^^^^
 
 	void synchronize_rcu(void);
 
@@ -225,6 +228,7 @@ synchronize_rcu()
 	checklist.txt for some approaches to limiting the update rate.
 
 rcu_assign_pointer()
+^^^^^^^^^^^^^^^^^^^^
 
 	void rcu_assign_pointer(p, typeof(p) v);
 
@@ -245,6 +249,7 @@ rcu_assign_pointer()
 	the _rcu list-manipulation primitives such as list_add_rcu().
 
 rcu_dereference()
+^^^^^^^^^^^^^^^^^
 
 	typeof(p) rcu_dereference(p);
 
@@ -279,8 +284,10 @@ rcu_dereference()
 	if an update happened while in the critical section, and incur
 	unnecessary overhead on Alpha CPUs.
 
+.. _back_to_1:
+
 	Note that the value returned by rcu_dereference() is valid
-	only within the enclosing RCU read-side critical section [1].
+	only within the enclosing RCU read-side critical section |cs_1|.
 	For example, the following is -not- legal::
 
 		rcu_read_lock();
@@ -298,15 +305,27 @@ rcu_dereference()
 	it was acquired is just as illegal as doing so with normal
 	locking.
 
+.. _back_to_2:
+

Documentation/RCU/whatisRCU.rst rcu_dereference() · line 318

Quoted 10 lines
Documentation/RCU/whatisRCU.rst +3 -1
 	As with rcu_assign_pointer(), an important function of
 	rcu_dereference() is to document which pointers are protected by
 	RCU, in particular, flagging a pointer that is subject to changing
 	at any time, including immediately after the rcu_dereference().
 	And, again like rcu_assign_pointer(), rcu_dereference() is
 	typically used indirectly, via the _rcu list-manipulation
-	primitives, such as list_for_each_entry_rcu() [2].
+	primitives, such as list_for_each_entry_rcu() |entry_2|.
+
+.. |cs_1| raw:: html

Please don't use raw. It's ugly and error prone. We have some raw output for latex, but this would be the first for html.

Quoted 1 line

What are you trying to achieve?

Quoted 9 lines

Hi Jani,
While going through the documentation I encountered a few footnotes (numbers
[1] and [2]) which referenced the actual footnote somewhere below the text. They were particularly not straight-forward to find hence I decided to link them to the footnote text which could be done using inline markup. Then I tried to make them more appealing by converting to super-scripts (the way they look like in books and websites). However, nested inline markup is not yet possible in reST hence I went with the html way to achieve the same. Too much?

I suggest you use rst footnote markup. It's less of an eye sore in the rst source, but provides you with the links in the generated output. And typically would be superscript. In particular "autonumber labels" might fit the bill. [1][2]

BR,
Jani.

[1] http://docutils.sourceforge.net/docs/user/rst/quickref.html#footnotes
[2] http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#footnotes

Quoted 42 lines

Thank you
Amol

Quoted 38 lines

BR,
Jani.

Quoted 34 lines
Documentation/RCU/whatisRCU.rst +15 -4
+
+	<a href="#cs"><sup>[1]</sup></a>
+
+.. |entry_2| raw:: html
 
-	[1] The variant rcu_dereference_protected() can be used outside
+	<a href="#entry"><sup>[2]</sup></a>
+
+.. _cs:
+
+	\ :sup:`[1]`\  The variant rcu_dereference_protected() can be used outside
 	of an RCU read-side critical section as long as the usage is
 	protected by locks acquired by the update-side code.  This variant
 	avoids the lockdep warning that would happen when using (for
@@ -317,15 +336,18 @@ rcu_dereference()
 	a lockdep expression to indicate which locks must be acquired
 	by the caller. If the indicated protection is not provided,
 	a lockdep splat is emitted.  See Documentation/RCU/Design/Requirements/Requirements.rst
-	and the API's code comments for more details and example usage.
+	and the API's code comments for more details and example usage. :ref:`back <back_to_1>`
+
+
+.. _entry:
 
-	[2] If the list_for_each_entry_rcu() instance might be used by
+	\ :sup:`[2]`\  If the list_for_each_entry_rcu() instance might be used by
 	update-side code as well as by RCU readers, then an additional
 	lockdep expression can be added to its list of arguments.
 	For example, given an additional "lock_is_held(&mylock)" argument,
 	the RCU lockdep code would complain only if this instance was
 	invoked outside of an RCU read-side critical section and without
-	the protection of mylock.
+	the protection of mylock. :ref:`back <back_to_2>`
 
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Documentation/RCU/whatisRCU.rst +0 -0
 The following diagram shows how each API communicates among the
 reader, updater, and reclaimer.
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center

Thank you for the feedback Paul and Jani! Sent the updated patch at
https://lore.kernel.org/lkml/20191105073340.GA3682@workstation-kernel-dev/
with the requested changes.

Thank you
Amol