* [Linux-kernel-mentees][PATCH v4 0/5] Documentation: RCU: Convert to reST
[not found] <20190625062627.26378-1-c0d1n61at3@gmail.com>
@ 2019-06-26 19:12 ` Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 " Jiunn Chang
` (5 more replies)
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 1/5] Documentation: RCU: Convert RCU basic concepts to reST Jiunn Chang
` (4 subsequent siblings)
5 siblings, 6 replies; 17+ messages in thread
From: Jiunn Chang @ 2019-06-26 19:12 UTC (permalink / raw)
To: skhan
Cc: linux-kernel-mentees, rcu, linux-doc, paulmck, josh, rostedt,
mathieu.desnoyers, jiangshanlai, joel, corbet
This patch series is the initial conversion of the RCU documentation
section. This includes reST markup and renaming txt files to rst. For files
converted, internal links have been created. Checkpatch was used to leverage codespell
for any spelling errors. Each patch in the series has been compiled and reviewed
for warnings and errors. Patches can be bisected.
The changes made in v4 include:
- Change links in rcu.rst to the path in documentation section
- Maintain the original name of the txt files
The changes made in v3 include:
- correcting markup to maintain even more of the original text
- correcting markup for line breaks
- combining all file renaming into one patch
- add reviewed-by tags
- add required public list to CC
The changes made in v2 include:
- correcting markup to maintain as much of the original text as possible
- correcting markup to reduce reader context switching
- breakout file renaming into individual patches in the series
>8---------------------------------------------------------------------------8<
Jiunn Chang (5):
Documentation: RCU: Convert RCU basic concepts to reST
Documentation: RCU: Convert RCU linked list to reST
Documentation: RCU: Convert RCU UP systems to reST
Documentation: RCU: Rename txt files to rst
Documentation: RCU: Add TOC tree hooks
Documentation/RCU/{UP.txt => UP.rst} | 37 +++++---
Documentation/RCU/index.rst | 19 ++++
.../RCU/{listRCU.txt => listRCU.rst} | 38 ++++----
Documentation/RCU/rcu.rst | 92 +++++++++++++++++++
Documentation/RCU/rcu.txt | 89 ------------------
5 files changed, 156 insertions(+), 119 deletions(-)
rename Documentation/RCU/{UP.txt => UP.rst} (84%)
create mode 100644 Documentation/RCU/index.rst
rename Documentation/RCU/{listRCU.txt => listRCU.rst} (92%)
create mode 100644 Documentation/RCU/rcu.rst
delete mode 100644 Documentation/RCU/rcu.txt
--
2.22.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Linux-kernel-mentees][PATCH v4 1/5] Documentation: RCU: Convert RCU basic concepts to reST
[not found] <20190625062627.26378-1-c0d1n61at3@gmail.com>
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 0/5] Documentation: RCU: Convert to reST Jiunn Chang
@ 2019-06-26 19:12 ` Jiunn Chang
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 2/5] Documentation: RCU: Convert RCU linked list " Jiunn Chang
` (3 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: Jiunn Chang @ 2019-06-26 19:12 UTC (permalink / raw)
To: skhan
Cc: linux-kernel-mentees, rcu, linux-doc, paulmck, josh, rostedt,
mathieu.desnoyers, jiangshanlai, joel, corbet
RCU basic concepts reST markup.
Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
---
Documentation/RCU/rcu.txt | 119 +++++++++++++++++++-------------------
1 file changed, 61 insertions(+), 58 deletions(-)
diff --git a/Documentation/RCU/rcu.txt b/Documentation/RCU/rcu.txt
index c818cf65c5a9..8dfb437dacc3 100644
--- a/Documentation/RCU/rcu.txt
+++ b/Documentation/RCU/rcu.txt
@@ -1,5 +1,7 @@
-RCU Concepts
+.. _rcu_doc:
+RCU Concepts
+============
The basic idea behind RCU (read-copy update) is to split destructive
operations into two parts, one that prevents anyone from seeing the data
@@ -8,82 +10,83 @@ A "grace period" must elapse between the two parts, and this grace period
must be long enough that any readers accessing the item being deleted have
since dropped their references. For example, an RCU-protected deletion
from a linked list would first remove the item from the list, wait for
-a grace period to elapse, then free the element. See the listRCU.txt
-file for more information on using RCU with linked lists.
-
+a grace period to elapse, then free the element. See the
+Documentation/RCU/listRCU.rst file for more information on using RCU with
+linked lists.
Frequently Asked Questions
+--------------------------
-o Why would anyone want to use RCU?
+- Why would anyone want to use RCU?
- The advantage of RCU's two-part approach is that RCU readers need
- not acquire any locks, perform any atomic instructions, write to
- shared memory, or (on CPUs other than Alpha) execute any memory
- barriers. The fact that these operations are quite expensive
- on modern CPUs is what gives RCU its performance advantages
- in read-mostly situations. The fact that RCU readers need not
- acquire locks can also greatly simplify deadlock-avoidance code.
+ The advantage of RCU's two-part approach is that RCU readers need
+ not acquire any locks, perform any atomic instructions, write to
+ shared memory, or (on CPUs other than Alpha) execute any memory
+ barriers. The fact that these operations are quite expensive
+ on modern CPUs is what gives RCU its performance advantages
+ in read-mostly situations. The fact that RCU readers need not
+ acquire locks can also greatly simplify deadlock-avoidance code.
-o How can the updater tell when a grace period has completed
- if the RCU readers give no indication when they are done?
+- How can the updater tell when a grace period has completed
+ if the RCU readers give no indication when they are done?
- Just as with spinlocks, RCU readers are not permitted to
- block, switch to user-mode execution, or enter the idle loop.
- Therefore, as soon as a CPU is seen passing through any of these
- three states, we know that that CPU has exited any previous RCU
- read-side critical sections. So, if we remove an item from a
- linked list, and then wait until all CPUs have switched context,
- executed in user mode, or executed in the idle loop, we can
- safely free up that item.
+ Just as with spinlocks, RCU readers are not permitted to
+ block, switch to user-mode execution, or enter the idle loop.
+ Therefore, as soon as a CPU is seen passing through any of these
+ three states, we know that that CPU has exited any previous RCU
+ read-side critical sections. So, if we remove an item from a
+ linked list, and then wait until all CPUs have switched context,
+ executed in user mode, or executed in the idle loop, we can
+ safely free up that item.
- Preemptible variants of RCU (CONFIG_PREEMPT_RCU) get the
- same effect, but require that the readers manipulate CPU-local
- counters. These counters allow limited types of blocking within
- RCU read-side critical sections. SRCU also uses CPU-local
- counters, and permits general blocking within RCU read-side
- critical sections. These variants of RCU detect grace periods
- by sampling these counters.
+ Preemptible variants of RCU (CONFIG_PREEMPT_RCU) get the
+ same effect, but require that the readers manipulate CPU-local
+ counters. These counters allow limited types of blocking within
+ RCU read-side critical sections. SRCU also uses CPU-local
+ counters, and permits general blocking within RCU read-side
+ critical sections. These variants of RCU detect grace periods
+ by sampling these counters.
-o If I am running on a uniprocessor kernel, which can only do one
- thing at a time, why should I wait for a grace period?
+- If I am running on a uniprocessor kernel, which can only do one
+ thing at a time, why should I wait for a grace period?
- See the UP.txt file in this directory.
+ See the Documentation/RCU/UP.rst file for more information.
-o How can I see where RCU is currently used in the Linux kernel?
+- How can I see where RCU is currently used in the Linux kernel?
- Search for "rcu_read_lock", "rcu_read_unlock", "call_rcu",
- "rcu_read_lock_bh", "rcu_read_unlock_bh", "srcu_read_lock",
- "srcu_read_unlock", "synchronize_rcu", "synchronize_net",
- "synchronize_srcu", and the other RCU primitives. Or grab one
- of the cscope databases from:
+ Search for "rcu_read_lock", "rcu_read_unlock", "call_rcu",
+ "rcu_read_lock_bh", "rcu_read_unlock_bh", "srcu_read_lock",
+ "srcu_read_unlock", "synchronize_rcu", "synchronize_net",
+ "synchronize_srcu", and the other RCU primitives. Or grab one
+ of the cscope databases from:
- http://www.rdrop.com/users/paulmck/RCU/linuxusage/rculocktab.html
+ (http://www.rdrop.com/users/paulmck/RCU/linuxusage/rculocktab.html).
-o What guidelines should I follow when writing code that uses RCU?
+- What guidelines should I follow when writing code that uses RCU?
- See the checklist.txt file in this directory.
+ See the checklist.txt file in this directory.
-o Why the name "RCU"?
+- Why the name "RCU"?
- "RCU" stands for "read-copy update". The file listRCU.txt has
- more information on where this name came from, search for
- "read-copy update" to find it.
+ "RCU" stands for "read-copy update". The file Documentation/RCU/listRCU.rst
+ has more information on where this name came from, search for
+ "read-copy update" to find it.
-o I hear that RCU is patented? What is with that?
+- I hear that RCU is patented? What is with that?
- Yes, it is. There are several known patents related to RCU,
- search for the string "Patent" in RTFP.txt to find them.
- Of these, one was allowed to lapse by the assignee, and the
- others have been contributed to the Linux kernel under GPL.
- There are now also LGPL implementations of user-level RCU
- available (http://liburcu.org/).
+ Yes, it is. There are several known patents related to RCU,
+ search for the string "Patent" in RTFP.txt to find them.
+ Of these, one was allowed to lapse by the assignee, and the
+ others have been contributed to the Linux kernel under GPL.
+ There are now also LGPL implementations of user-level RCU
+ available (http://liburcu.org/).
-o I hear that RCU needs work in order to support realtime kernels?
+- I hear that RCU needs work in order to support realtime kernels?
- Realtime-friendly RCU can be enabled via the CONFIG_PREEMPT_RCU
- kernel configuration parameter.
+ Realtime-friendly RCU can be enabled via the CONFIG_PREEMPT_RCU
+ kernel configuration parameter.
-o Where can I find more information on RCU?
+- Where can I find more information on RCU?
- See the RTFP.txt file in this directory.
- Or point your browser at http://www.rdrop.com/users/paulmck/RCU/.
+ See the RTFP.txt file in this directory.
+ Or point your browser at (http://www.rdrop.com/users/paulmck/RCU/).
--
2.22.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Linux-kernel-mentees][PATCH v4 2/5] Documentation: RCU: Convert RCU linked list to reST
[not found] <20190625062627.26378-1-c0d1n61at3@gmail.com>
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 0/5] Documentation: RCU: Convert to reST Jiunn Chang
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 1/5] Documentation: RCU: Convert RCU basic concepts to reST Jiunn Chang
@ 2019-06-26 19:12 ` Jiunn Chang
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 3/5] Documentation: RCU: Convert RCU UP systems " Jiunn Chang
` (2 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: Jiunn Chang @ 2019-06-26 19:12 UTC (permalink / raw)
To: skhan
Cc: linux-kernel-mentees, rcu, linux-doc, paulmck, josh, rostedt,
mathieu.desnoyers, jiangshanlai, joel, corbet
RCU linked list reST markup.
Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
---
Documentation/RCU/listRCU.txt | 38 ++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 16 deletions(-)
diff --git a/Documentation/RCU/listRCU.txt b/Documentation/RCU/listRCU.txt
index adb5a3782846..7956ff33042b 100644
--- a/Documentation/RCU/listRCU.txt
+++ b/Documentation/RCU/listRCU.txt
@@ -1,5 +1,7 @@
-Using RCU to Protect Read-Mostly Linked Lists
+.. _list_rcu_doc:
+Using RCU to Protect Read-Mostly Linked Lists
+=============================================
One of the best applications of RCU is to protect read-mostly linked lists
("struct list_head" in list.h). One big advantage of this approach
@@ -7,8 +9,8 @@ is that all of the required memory barriers are included for you in
the list macros. This document describes several applications of RCU,
with the best fits first.
-
Example 1: Read-Side Action Taken Outside of Lock, No In-Place Updates
+----------------------------------------------------------------------
The best applications are cases where, if reader-writer locking were
used, the read-side lock would be dropped before taking any action
@@ -24,7 +26,7 @@ added or deleted, rather than being modified in place.
A straightforward example of this use of RCU may be found in the
system-call auditing support. For example, a reader-writer locked
-implementation of audit_filter_task() might be as follows:
+implementation of audit_filter_task() might be as follows::
static enum audit_state audit_filter_task(struct task_struct *tsk)
{
@@ -48,7 +50,7 @@ the corresponding value is returned. By the time that this value is acted
on, the list may well have been modified. This makes sense, since if
you are turning auditing off, it is OK to audit a few extra system calls.
-This means that RCU can be easily applied to the read side, as follows:
+This means that RCU can be easily applied to the read side, as follows::
static enum audit_state audit_filter_task(struct task_struct *tsk)
{
@@ -73,7 +75,7 @@ become list_for_each_entry_rcu(). The _rcu() list-traversal primitives
insert the read-side memory barriers that are required on DEC Alpha CPUs.
The changes to the update side are also straightforward. A reader-writer
-lock might be used as follows for deletion and insertion:
+lock might be used as follows for deletion and insertion::
static inline int audit_del_rule(struct audit_rule *rule,
struct list_head *list)
@@ -106,7 +108,7 @@ lock might be used as follows for deletion and insertion:
return 0;
}
-Following are the RCU equivalents for these two functions:
+Following are the RCU equivalents for these two functions::
static inline int audit_del_rule(struct audit_rule *rule,
struct list_head *list)
@@ -154,13 +156,13 @@ otherwise cause concurrent readers to fail spectacularly.
So, when readers can tolerate stale data and when entries are either added
or deleted, without in-place modification, it is very easy to use RCU!
-
Example 2: Handling In-Place Updates
+------------------------------------
The system-call auditing code does not update auditing rules in place.
However, if it did, reader-writer-locked code to do so might look as
follows (presumably, the field_count is only permitted to decrease,
-otherwise, the added fields would need to be filled in):
+otherwise, the added fields would need to be filled in)::
static inline int audit_upd_rule(struct audit_rule *rule,
struct list_head *list,
@@ -187,7 +189,7 @@ otherwise, the added fields would need to be filled in):
The RCU version creates a copy, updates the copy, then replaces the old
entry with the newly updated entry. This sequence of actions, allowing
concurrent reads while doing a copy to perform an update, is what gives
-RCU ("read-copy update") its name. The RCU code is as follows:
+RCU ("read-copy update") its name. The RCU code is as follows::
static inline int audit_upd_rule(struct audit_rule *rule,
struct list_head *list,
@@ -216,8 +218,8 @@ RCU ("read-copy update") its name. The RCU code is as follows:
Again, this assumes that the caller holds audit_netlink_sem. Normally,
the reader-writer lock would become a spinlock in this sort of code.
-
Example 3: Eliminating Stale Data
+---------------------------------
The auditing examples above tolerate stale data, as do most algorithms
that are tracking external state. Because there is a delay from the
@@ -231,13 +233,16 @@ per-entry spinlock, and, if the "deleted" flag is set, pretends that the
entry does not exist. For this to be helpful, the search function must
return holding the per-entry spinlock, as ipc_lock() does in fact do.
-Quick Quiz: Why does the search function need to return holding the
- per-entry lock for this deleted-flag technique to be helpful?
+Quick Quiz:
+ Why does the search function need to return holding the per-entry lock for
+ this deleted-flag technique to be helpful?
+
+:ref:`Answer to Quick Quiz <answer_quick_quiz_list>`
If the system-call audit module were to ever need to reject stale data,
one way to accomplish this would be to add a "deleted" flag and a "lock"
spinlock to the audit_entry structure, and modify audit_filter_task()
-as follows:
+as follows::
static enum audit_state audit_filter_task(struct task_struct *tsk)
{
@@ -268,7 +273,7 @@ audit_upd_rule() would need additional memory barriers to ensure
that the list_add_rcu() was really executed before the list_del_rcu().
The audit_del_rule() function would need to set the "deleted"
-flag under the spinlock as follows:
+flag under the spinlock as follows::
static inline int audit_del_rule(struct audit_rule *rule,
struct list_head *list)
@@ -290,8 +295,8 @@ flag under the spinlock as follows:
return -EFAULT; /* No matching rule */
}
-
Summary
+-------
Read-mostly list-based data structures that can tolerate stale data are
the most amenable to use of RCU. The simplest case is where entries are
@@ -302,8 +307,9 @@ If stale data cannot be tolerated, then a "deleted" flag may be used
in conjunction with a per-entry spinlock in order to allow the search
function to reject newly deleted data.
+.. _answer_quick_quiz_list:
-Answer to Quick Quiz
+Answer to Quick Quiz:
Why does the search function need to return holding the per-entry
lock for this deleted-flag technique to be helpful?
--
2.22.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Linux-kernel-mentees][PATCH v4 3/5] Documentation: RCU: Convert RCU UP systems to reST
[not found] <20190625062627.26378-1-c0d1n61at3@gmail.com>
` (2 preceding siblings ...)
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 2/5] Documentation: RCU: Convert RCU linked list " Jiunn Chang
@ 2019-06-26 19:12 ` Jiunn Chang
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 4/5] Documentation: RCU: Rename txt files to rst Jiunn Chang
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 5/5] Documentation: RCU: Add TOC tree hooks Jiunn Chang
5 siblings, 0 replies; 17+ messages in thread
From: Jiunn Chang @ 2019-06-26 19:12 UTC (permalink / raw)
To: skhan
Cc: linux-kernel-mentees, rcu, linux-doc, paulmck, josh, rostedt,
mathieu.desnoyers, jiangshanlai, joel, corbet
RCU UP systems reST markup.
Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
---
Documentation/RCU/UP.txt | 37 +++++++++++++++++++++++--------------
1 file changed, 23 insertions(+), 14 deletions(-)
diff --git a/Documentation/RCU/UP.txt b/Documentation/RCU/UP.txt
index 53bde717017b..67715a47ae89 100644
--- a/Documentation/RCU/UP.txt
+++ b/Documentation/RCU/UP.txt
@@ -1,17 +1,19 @@
-RCU on Uniprocessor Systems
+.. _up_doc:
+RCU on Uniprocessor Systems
+===========================
A common misconception is that, on UP systems, the call_rcu() primitive
may immediately invoke its function. The basis of this misconception
is that since there is only one CPU, it should not be necessary to
wait for anything else to get done, since there are no other CPUs for
-anything else to be happening on. Although this approach will -sort- -of-
+anything else to be happening on. Although this approach will *sort of*
work a surprising amount of the time, it is a very bad idea in general.
This document presents three examples that demonstrate exactly how bad
an idea this is.
-
Example 1: softirq Suicide
+--------------------------
Suppose that an RCU-based algorithm scans a linked list containing
elements A, B, and C in process context, and can delete elements from
@@ -28,8 +30,8 @@ your kernel.
This same problem can occur if call_rcu() is invoked from a hardware
interrupt handler.
-
Example 2: Function-Call Fatality
+---------------------------------
Of course, one could avert the suicide described in the preceding example
by having call_rcu() directly invoke its arguments only if it was called
@@ -46,11 +48,13 @@ its arguments would cause it to fail to make the fundamental guarantee
underlying RCU, namely that call_rcu() defers invoking its arguments until
all RCU read-side critical sections currently executing have completed.
-Quick Quiz #1: why is it -not- legal to invoke synchronize_rcu() in
- this case?
+Quick Quiz #1:
+ Why is it *not* legal to invoke synchronize_rcu() in this case?
+:ref:`Answers to Quick Quiz <answer_quick_quiz_up>`
Example 3: Death by Deadlock
+----------------------------
Suppose that call_rcu() is invoked while holding a lock, and that the
callback function must acquire this same lock. In this case, if
@@ -76,25 +80,30 @@ there are cases where this can be quite ugly:
If call_rcu() directly invokes the callback, painful locking restrictions
or API changes would be required.
-Quick Quiz #2: What locking restriction must RCU callbacks respect?
+Quick Quiz #2:
+ What locking restriction must RCU callbacks respect?
+:ref:`Answers to Quick Quiz <answer_quick_quiz_up>`
Summary
+-------
Permitting call_rcu() to immediately invoke its arguments breaks RCU,
even on a UP system. So do not do it! Even on a UP system, the RCU
-infrastructure -must- respect grace periods, and -must- invoke callbacks
+infrastructure *must* respect grace periods, and *must* invoke callbacks
from a known environment in which no locks are held.
-Note that it -is- safe for synchronize_rcu() to return immediately on
-UP systems, including !PREEMPT SMP builds running on UP systems.
+Note that it *is* safe for synchronize_rcu() to return immediately on
+UP systems, including PREEMPT SMP builds running on UP systems.
-Quick Quiz #3: Why can't synchronize_rcu() return immediately on
- UP systems running preemptable RCU?
+Quick Quiz #3:
+ Why can't synchronize_rcu() return immediately on UP systems running
+ preemptable RCU?
+.. _answer_quick_quiz_up:
Answer to Quick Quiz #1:
- Why is it -not- legal to invoke synchronize_rcu() in this case?
+ Why is it *not* legal to invoke synchronize_rcu() in this case?
Because the calling function is scanning an RCU-protected linked
list, and is therefore within an RCU read-side critical section.
@@ -119,7 +128,7 @@ Answer to Quick Quiz #2:
This restriction might seem gratuitous, since very few RCU
callbacks acquire locks directly. However, a great many RCU
- callbacks do acquire locks -indirectly-, for example, via
+ callbacks do acquire locks *indirectly*, for example, via
the kfree() primitive.
Answer to Quick Quiz #3:
--
2.22.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Linux-kernel-mentees][PATCH v4 4/5] Documentation: RCU: Rename txt files to rst
[not found] <20190625062627.26378-1-c0d1n61at3@gmail.com>
` (3 preceding siblings ...)
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 3/5] Documentation: RCU: Convert RCU UP systems " Jiunn Chang
@ 2019-06-26 19:12 ` Jiunn Chang
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 5/5] Documentation: RCU: Add TOC tree hooks Jiunn Chang
5 siblings, 0 replies; 17+ messages in thread
From: Jiunn Chang @ 2019-06-26 19:12 UTC (permalink / raw)
To: skhan
Cc: linux-kernel-mentees, rcu, linux-doc, paulmck, josh, rostedt,
mathieu.desnoyers, jiangshanlai, joel, corbet
Rename the following files to reST:
- rcu.txt
- listRCU.txt
- UP.txt
Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
---
Documentation/RCU/{UP.txt => UP.rst} | 0
Documentation/RCU/{listRCU.txt => listRCU.rst} | 0
Documentation/RCU/{rcu.txt => rcu.rst} | 0
3 files changed, 0 insertions(+), 0 deletions(-)
rename Documentation/RCU/{UP.txt => UP.rst} (100%)
rename Documentation/RCU/{listRCU.txt => listRCU.rst} (100%)
rename Documentation/RCU/{rcu.txt => rcu.rst} (100%)
diff --git a/Documentation/RCU/UP.txt b/Documentation/RCU/UP.rst
similarity index 100%
rename from Documentation/RCU/UP.txt
rename to Documentation/RCU/UP.rst
diff --git a/Documentation/RCU/listRCU.txt b/Documentation/RCU/listRCU.rst
similarity index 100%
rename from Documentation/RCU/listRCU.txt
rename to Documentation/RCU/listRCU.rst
diff --git a/Documentation/RCU/rcu.txt b/Documentation/RCU/rcu.rst
similarity index 100%
rename from Documentation/RCU/rcu.txt
rename to Documentation/RCU/rcu.rst
--
2.22.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Linux-kernel-mentees][PATCH v4 5/5] Documentation: RCU: Add TOC tree hooks
[not found] <20190625062627.26378-1-c0d1n61at3@gmail.com>
` (4 preceding siblings ...)
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 4/5] Documentation: RCU: Rename txt files to rst Jiunn Chang
@ 2019-06-26 19:12 ` Jiunn Chang
5 siblings, 0 replies; 17+ messages in thread
From: Jiunn Chang @ 2019-06-26 19:12 UTC (permalink / raw)
To: skhan
Cc: linux-kernel-mentees, rcu, linux-doc, paulmck, josh, rostedt,
mathieu.desnoyers, jiangshanlai, joel, corbet
Add TOC tree hooks for:
- rcu
- listRCU
- UP
Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
---
Documentation/RCU/index.rst | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
create mode 100644 Documentation/RCU/index.rst
diff --git a/Documentation/RCU/index.rst b/Documentation/RCU/index.rst
new file mode 100644
index 000000000000..340a9725676c
--- /dev/null
+++ b/Documentation/RCU/index.rst
@@ -0,0 +1,19 @@
+.. _rcu_concepts:
+
+============
+RCU concepts
+============
+
+.. toctree::
+ :maxdepth: 1
+
+ rcu
+ listRCU
+ UP
+
+.. only:: subproject and html
+
+ Indices
+ =======
+
+ * :ref:`genindex`
--
2.22.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Linux-kernel-mentees][PATCH v5 0/5] Documentation: RCU: Convert to reST
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 0/5] Documentation: RCU: Convert to reST Jiunn Chang
@ 2019-06-26 20:07 ` Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 1/5] Documentation: RCU: Convert RCU basic concepts " Jiunn Chang
` (4 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: Jiunn Chang @ 2019-06-26 20:07 UTC (permalink / raw)
To: skhan
Cc: linux-kernel-mentees, rcu, linux-doc, paulmck, josh, rostedt,
mathieu.desnoyers, jiangshanlai, joel, corbet
This patch series is the initial conversion of the RCU documentation
section. This includes reST markup and renaming txt files to rst. For files
converted, internal links have been created. Checkpatch was used to leverage codespell
for any spelling errors. Each patch in the series has been compiled and reviewed
for warnings and errors. Patches can be bisected.
The changes make in v5 include:
- add reviewed-by tags
The changes made in v4 include:
- Change links in rcu.rst to the path in documentation section
- Maintain the original name of the txt files
The changes made in v3 include:
- correcting markup to maintain even more of the original text
- correcting markup for line breaks
- combining all file renaming into one patch
- add reviewed-by tags
- add required public list to CC
The changes made in v2 include:
- correcting markup to maintain as much of the original text as possible
- correcting markup to reduce reader context switching
- breakout file renaming into individual patches in the series
>8---------------------------------------------------------------------------8<
Jiunn Chang (5):
Documentation: RCU: Convert RCU basic concepts to reST
Documentation: RCU: Convert RCU linked list to reST
Documentation: RCU: Convert RCU UP systems to reST
Documentation: RCU: Rename txt files to rst
Documentation: RCU: Add TOC tree hooks
Documentation/RCU/{UP.txt => UP.rst} | 37 +++++---
Documentation/RCU/index.rst | 19 ++++
.../RCU/{listRCU.txt => listRCU.rst} | 38 ++++----
Documentation/RCU/rcu.rst | 92 +++++++++++++++++++
Documentation/RCU/rcu.txt | 89 ------------------
5 files changed, 156 insertions(+), 119 deletions(-)
rename Documentation/RCU/{UP.txt => UP.rst} (84%)
create mode 100644 Documentation/RCU/index.rst
rename Documentation/RCU/{listRCU.txt => listRCU.rst} (92%)
create mode 100644 Documentation/RCU/rcu.rst
delete mode 100644 Documentation/RCU/rcu.txt
--
2.22.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Linux-kernel-mentees][PATCH v5 1/5] Documentation: RCU: Convert RCU basic concepts to reST
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 0/5] Documentation: RCU: Convert to reST Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 " Jiunn Chang
@ 2019-06-26 20:07 ` Jiunn Chang
2019-06-27 14:34 ` Jonathan Corbet
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 2/5] Documentation: RCU: Convert RCU linked list " Jiunn Chang
` (3 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: Jiunn Chang @ 2019-06-26 20:07 UTC (permalink / raw)
To: skhan
Cc: linux-kernel-mentees, rcu, linux-doc, paulmck, josh, rostedt,
mathieu.desnoyers, jiangshanlai, joel, corbet
RCU basic concepts reST markup.
Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
---
Documentation/RCU/rcu.txt | 119 +++++++++++++++++++-------------------
1 file changed, 61 insertions(+), 58 deletions(-)
diff --git a/Documentation/RCU/rcu.txt b/Documentation/RCU/rcu.txt
index c818cf65c5a9..8dfb437dacc3 100644
--- a/Documentation/RCU/rcu.txt
+++ b/Documentation/RCU/rcu.txt
@@ -1,5 +1,7 @@
-RCU Concepts
+.. _rcu_doc:
+RCU Concepts
+============
The basic idea behind RCU (read-copy update) is to split destructive
operations into two parts, one that prevents anyone from seeing the data
@@ -8,82 +10,83 @@ A "grace period" must elapse between the two parts, and this grace period
must be long enough that any readers accessing the item being deleted have
since dropped their references. For example, an RCU-protected deletion
from a linked list would first remove the item from the list, wait for
-a grace period to elapse, then free the element. See the listRCU.txt
-file for more information on using RCU with linked lists.
-
+a grace period to elapse, then free the element. See the
+Documentation/RCU/listRCU.rst file for more information on using RCU with
+linked lists.
Frequently Asked Questions
+--------------------------
-o Why would anyone want to use RCU?
+- Why would anyone want to use RCU?
- The advantage of RCU's two-part approach is that RCU readers need
- not acquire any locks, perform any atomic instructions, write to
- shared memory, or (on CPUs other than Alpha) execute any memory
- barriers. The fact that these operations are quite expensive
- on modern CPUs is what gives RCU its performance advantages
- in read-mostly situations. The fact that RCU readers need not
- acquire locks can also greatly simplify deadlock-avoidance code.
+ The advantage of RCU's two-part approach is that RCU readers need
+ not acquire any locks, perform any atomic instructions, write to
+ shared memory, or (on CPUs other than Alpha) execute any memory
+ barriers. The fact that these operations are quite expensive
+ on modern CPUs is what gives RCU its performance advantages
+ in read-mostly situations. The fact that RCU readers need not
+ acquire locks can also greatly simplify deadlock-avoidance code.
-o How can the updater tell when a grace period has completed
- if the RCU readers give no indication when they are done?
+- How can the updater tell when a grace period has completed
+ if the RCU readers give no indication when they are done?
- Just as with spinlocks, RCU readers are not permitted to
- block, switch to user-mode execution, or enter the idle loop.
- Therefore, as soon as a CPU is seen passing through any of these
- three states, we know that that CPU has exited any previous RCU
- read-side critical sections. So, if we remove an item from a
- linked list, and then wait until all CPUs have switched context,
- executed in user mode, or executed in the idle loop, we can
- safely free up that item.
+ Just as with spinlocks, RCU readers are not permitted to
+ block, switch to user-mode execution, or enter the idle loop.
+ Therefore, as soon as a CPU is seen passing through any of these
+ three states, we know that that CPU has exited any previous RCU
+ read-side critical sections. So, if we remove an item from a
+ linked list, and then wait until all CPUs have switched context,
+ executed in user mode, or executed in the idle loop, we can
+ safely free up that item.
- Preemptible variants of RCU (CONFIG_PREEMPT_RCU) get the
- same effect, but require that the readers manipulate CPU-local
- counters. These counters allow limited types of blocking within
- RCU read-side critical sections. SRCU also uses CPU-local
- counters, and permits general blocking within RCU read-side
- critical sections. These variants of RCU detect grace periods
- by sampling these counters.
+ Preemptible variants of RCU (CONFIG_PREEMPT_RCU) get the
+ same effect, but require that the readers manipulate CPU-local
+ counters. These counters allow limited types of blocking within
+ RCU read-side critical sections. SRCU also uses CPU-local
+ counters, and permits general blocking within RCU read-side
+ critical sections. These variants of RCU detect grace periods
+ by sampling these counters.
-o If I am running on a uniprocessor kernel, which can only do one
- thing at a time, why should I wait for a grace period?
+- If I am running on a uniprocessor kernel, which can only do one
+ thing at a time, why should I wait for a grace period?
- See the UP.txt file in this directory.
+ See the Documentation/RCU/UP.rst file for more information.
-o How can I see where RCU is currently used in the Linux kernel?
+- How can I see where RCU is currently used in the Linux kernel?
- Search for "rcu_read_lock", "rcu_read_unlock", "call_rcu",
- "rcu_read_lock_bh", "rcu_read_unlock_bh", "srcu_read_lock",
- "srcu_read_unlock", "synchronize_rcu", "synchronize_net",
- "synchronize_srcu", and the other RCU primitives. Or grab one
- of the cscope databases from:
+ Search for "rcu_read_lock", "rcu_read_unlock", "call_rcu",
+ "rcu_read_lock_bh", "rcu_read_unlock_bh", "srcu_read_lock",
+ "srcu_read_unlock", "synchronize_rcu", "synchronize_net",
+ "synchronize_srcu", and the other RCU primitives. Or grab one
+ of the cscope databases from:
- http://www.rdrop.com/users/paulmck/RCU/linuxusage/rculocktab.html
+ (http://www.rdrop.com/users/paulmck/RCU/linuxusage/rculocktab.html).
-o What guidelines should I follow when writing code that uses RCU?
+- What guidelines should I follow when writing code that uses RCU?
- See the checklist.txt file in this directory.
+ See the checklist.txt file in this directory.
-o Why the name "RCU"?
+- Why the name "RCU"?
- "RCU" stands for "read-copy update". The file listRCU.txt has
- more information on where this name came from, search for
- "read-copy update" to find it.
+ "RCU" stands for "read-copy update". The file Documentation/RCU/listRCU.rst
+ has more information on where this name came from, search for
+ "read-copy update" to find it.
-o I hear that RCU is patented? What is with that?
+- I hear that RCU is patented? What is with that?
- Yes, it is. There are several known patents related to RCU,
- search for the string "Patent" in RTFP.txt to find them.
- Of these, one was allowed to lapse by the assignee, and the
- others have been contributed to the Linux kernel under GPL.
- There are now also LGPL implementations of user-level RCU
- available (http://liburcu.org/).
+ Yes, it is. There are several known patents related to RCU,
+ search for the string "Patent" in RTFP.txt to find them.
+ Of these, one was allowed to lapse by the assignee, and the
+ others have been contributed to the Linux kernel under GPL.
+ There are now also LGPL implementations of user-level RCU
+ available (http://liburcu.org/).
-o I hear that RCU needs work in order to support realtime kernels?
+- I hear that RCU needs work in order to support realtime kernels?
- Realtime-friendly RCU can be enabled via the CONFIG_PREEMPT_RCU
- kernel configuration parameter.
+ Realtime-friendly RCU can be enabled via the CONFIG_PREEMPT_RCU
+ kernel configuration parameter.
-o Where can I find more information on RCU?
+- Where can I find more information on RCU?
- See the RTFP.txt file in this directory.
- Or point your browser at http://www.rdrop.com/users/paulmck/RCU/.
+ See the RTFP.txt file in this directory.
+ Or point your browser at (http://www.rdrop.com/users/paulmck/RCU/).
--
2.22.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Linux-kernel-mentees][PATCH v5 2/5] Documentation: RCU: Convert RCU linked list to reST
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 0/5] Documentation: RCU: Convert to reST Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 " Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 1/5] Documentation: RCU: Convert RCU basic concepts " Jiunn Chang
@ 2019-06-26 20:07 ` Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 3/5] Documentation: RCU: Convert RCU UP systems " Jiunn Chang
` (2 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: Jiunn Chang @ 2019-06-26 20:07 UTC (permalink / raw)
To: skhan
Cc: linux-kernel-mentees, rcu, linux-doc, paulmck, josh, rostedt,
mathieu.desnoyers, jiangshanlai, joel, corbet
RCU linked list reST markup.
Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
---
Documentation/RCU/listRCU.txt | 38 ++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 16 deletions(-)
diff --git a/Documentation/RCU/listRCU.txt b/Documentation/RCU/listRCU.txt
index adb5a3782846..7956ff33042b 100644
--- a/Documentation/RCU/listRCU.txt
+++ b/Documentation/RCU/listRCU.txt
@@ -1,5 +1,7 @@
-Using RCU to Protect Read-Mostly Linked Lists
+.. _list_rcu_doc:
+Using RCU to Protect Read-Mostly Linked Lists
+=============================================
One of the best applications of RCU is to protect read-mostly linked lists
("struct list_head" in list.h). One big advantage of this approach
@@ -7,8 +9,8 @@ is that all of the required memory barriers are included for you in
the list macros. This document describes several applications of RCU,
with the best fits first.
-
Example 1: Read-Side Action Taken Outside of Lock, No In-Place Updates
+----------------------------------------------------------------------
The best applications are cases where, if reader-writer locking were
used, the read-side lock would be dropped before taking any action
@@ -24,7 +26,7 @@ added or deleted, rather than being modified in place.
A straightforward example of this use of RCU may be found in the
system-call auditing support. For example, a reader-writer locked
-implementation of audit_filter_task() might be as follows:
+implementation of audit_filter_task() might be as follows::
static enum audit_state audit_filter_task(struct task_struct *tsk)
{
@@ -48,7 +50,7 @@ the corresponding value is returned. By the time that this value is acted
on, the list may well have been modified. This makes sense, since if
you are turning auditing off, it is OK to audit a few extra system calls.
-This means that RCU can be easily applied to the read side, as follows:
+This means that RCU can be easily applied to the read side, as follows::
static enum audit_state audit_filter_task(struct task_struct *tsk)
{
@@ -73,7 +75,7 @@ become list_for_each_entry_rcu(). The _rcu() list-traversal primitives
insert the read-side memory barriers that are required on DEC Alpha CPUs.
The changes to the update side are also straightforward. A reader-writer
-lock might be used as follows for deletion and insertion:
+lock might be used as follows for deletion and insertion::
static inline int audit_del_rule(struct audit_rule *rule,
struct list_head *list)
@@ -106,7 +108,7 @@ lock might be used as follows for deletion and insertion:
return 0;
}
-Following are the RCU equivalents for these two functions:
+Following are the RCU equivalents for these two functions::
static inline int audit_del_rule(struct audit_rule *rule,
struct list_head *list)
@@ -154,13 +156,13 @@ otherwise cause concurrent readers to fail spectacularly.
So, when readers can tolerate stale data and when entries are either added
or deleted, without in-place modification, it is very easy to use RCU!
-
Example 2: Handling In-Place Updates
+------------------------------------
The system-call auditing code does not update auditing rules in place.
However, if it did, reader-writer-locked code to do so might look as
follows (presumably, the field_count is only permitted to decrease,
-otherwise, the added fields would need to be filled in):
+otherwise, the added fields would need to be filled in)::
static inline int audit_upd_rule(struct audit_rule *rule,
struct list_head *list,
@@ -187,7 +189,7 @@ otherwise, the added fields would need to be filled in):
The RCU version creates a copy, updates the copy, then replaces the old
entry with the newly updated entry. This sequence of actions, allowing
concurrent reads while doing a copy to perform an update, is what gives
-RCU ("read-copy update") its name. The RCU code is as follows:
+RCU ("read-copy update") its name. The RCU code is as follows::
static inline int audit_upd_rule(struct audit_rule *rule,
struct list_head *list,
@@ -216,8 +218,8 @@ RCU ("read-copy update") its name. The RCU code is as follows:
Again, this assumes that the caller holds audit_netlink_sem. Normally,
the reader-writer lock would become a spinlock in this sort of code.
-
Example 3: Eliminating Stale Data
+---------------------------------
The auditing examples above tolerate stale data, as do most algorithms
that are tracking external state. Because there is a delay from the
@@ -231,13 +233,16 @@ per-entry spinlock, and, if the "deleted" flag is set, pretends that the
entry does not exist. For this to be helpful, the search function must
return holding the per-entry spinlock, as ipc_lock() does in fact do.
-Quick Quiz: Why does the search function need to return holding the
- per-entry lock for this deleted-flag technique to be helpful?
+Quick Quiz:
+ Why does the search function need to return holding the per-entry lock for
+ this deleted-flag technique to be helpful?
+
+:ref:`Answer to Quick Quiz <answer_quick_quiz_list>`
If the system-call audit module were to ever need to reject stale data,
one way to accomplish this would be to add a "deleted" flag and a "lock"
spinlock to the audit_entry structure, and modify audit_filter_task()
-as follows:
+as follows::
static enum audit_state audit_filter_task(struct task_struct *tsk)
{
@@ -268,7 +273,7 @@ audit_upd_rule() would need additional memory barriers to ensure
that the list_add_rcu() was really executed before the list_del_rcu().
The audit_del_rule() function would need to set the "deleted"
-flag under the spinlock as follows:
+flag under the spinlock as follows::
static inline int audit_del_rule(struct audit_rule *rule,
struct list_head *list)
@@ -290,8 +295,8 @@ flag under the spinlock as follows:
return -EFAULT; /* No matching rule */
}
-
Summary
+-------
Read-mostly list-based data structures that can tolerate stale data are
the most amenable to use of RCU. The simplest case is where entries are
@@ -302,8 +307,9 @@ If stale data cannot be tolerated, then a "deleted" flag may be used
in conjunction with a per-entry spinlock in order to allow the search
function to reject newly deleted data.
+.. _answer_quick_quiz_list:
-Answer to Quick Quiz
+Answer to Quick Quiz:
Why does the search function need to return holding the per-entry
lock for this deleted-flag technique to be helpful?
--
2.22.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Linux-kernel-mentees][PATCH v5 3/5] Documentation: RCU: Convert RCU UP systems to reST
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 0/5] Documentation: RCU: Convert to reST Jiunn Chang
` (2 preceding siblings ...)
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 2/5] Documentation: RCU: Convert RCU linked list " Jiunn Chang
@ 2019-06-26 20:07 ` Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 4/5] Documentation: RCU: Rename txt files to rst Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 5/5] Documentation: RCU: Add TOC tree hooks Jiunn Chang
5 siblings, 0 replies; 17+ messages in thread
From: Jiunn Chang @ 2019-06-26 20:07 UTC (permalink / raw)
To: skhan
Cc: linux-kernel-mentees, rcu, linux-doc, paulmck, josh, rostedt,
mathieu.desnoyers, jiangshanlai, joel, corbet
RCU UP systems reST markup.
Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
---
Documentation/RCU/UP.txt | 37 +++++++++++++++++++++++--------------
1 file changed, 23 insertions(+), 14 deletions(-)
diff --git a/Documentation/RCU/UP.txt b/Documentation/RCU/UP.txt
index 53bde717017b..67715a47ae89 100644
--- a/Documentation/RCU/UP.txt
+++ b/Documentation/RCU/UP.txt
@@ -1,17 +1,19 @@
-RCU on Uniprocessor Systems
+.. _up_doc:
+RCU on Uniprocessor Systems
+===========================
A common misconception is that, on UP systems, the call_rcu() primitive
may immediately invoke its function. The basis of this misconception
is that since there is only one CPU, it should not be necessary to
wait for anything else to get done, since there are no other CPUs for
-anything else to be happening on. Although this approach will -sort- -of-
+anything else to be happening on. Although this approach will *sort of*
work a surprising amount of the time, it is a very bad idea in general.
This document presents three examples that demonstrate exactly how bad
an idea this is.
-
Example 1: softirq Suicide
+--------------------------
Suppose that an RCU-based algorithm scans a linked list containing
elements A, B, and C in process context, and can delete elements from
@@ -28,8 +30,8 @@ your kernel.
This same problem can occur if call_rcu() is invoked from a hardware
interrupt handler.
-
Example 2: Function-Call Fatality
+---------------------------------
Of course, one could avert the suicide described in the preceding example
by having call_rcu() directly invoke its arguments only if it was called
@@ -46,11 +48,13 @@ its arguments would cause it to fail to make the fundamental guarantee
underlying RCU, namely that call_rcu() defers invoking its arguments until
all RCU read-side critical sections currently executing have completed.
-Quick Quiz #1: why is it -not- legal to invoke synchronize_rcu() in
- this case?
+Quick Quiz #1:
+ Why is it *not* legal to invoke synchronize_rcu() in this case?
+:ref:`Answers to Quick Quiz <answer_quick_quiz_up>`
Example 3: Death by Deadlock
+----------------------------
Suppose that call_rcu() is invoked while holding a lock, and that the
callback function must acquire this same lock. In this case, if
@@ -76,25 +80,30 @@ there are cases where this can be quite ugly:
If call_rcu() directly invokes the callback, painful locking restrictions
or API changes would be required.
-Quick Quiz #2: What locking restriction must RCU callbacks respect?
+Quick Quiz #2:
+ What locking restriction must RCU callbacks respect?
+:ref:`Answers to Quick Quiz <answer_quick_quiz_up>`
Summary
+-------
Permitting call_rcu() to immediately invoke its arguments breaks RCU,
even on a UP system. So do not do it! Even on a UP system, the RCU
-infrastructure -must- respect grace periods, and -must- invoke callbacks
+infrastructure *must* respect grace periods, and *must* invoke callbacks
from a known environment in which no locks are held.
-Note that it -is- safe for synchronize_rcu() to return immediately on
-UP systems, including !PREEMPT SMP builds running on UP systems.
+Note that it *is* safe for synchronize_rcu() to return immediately on
+UP systems, including PREEMPT SMP builds running on UP systems.
-Quick Quiz #3: Why can't synchronize_rcu() return immediately on
- UP systems running preemptable RCU?
+Quick Quiz #3:
+ Why can't synchronize_rcu() return immediately on UP systems running
+ preemptable RCU?
+.. _answer_quick_quiz_up:
Answer to Quick Quiz #1:
- Why is it -not- legal to invoke synchronize_rcu() in this case?
+ Why is it *not* legal to invoke synchronize_rcu() in this case?
Because the calling function is scanning an RCU-protected linked
list, and is therefore within an RCU read-side critical section.
@@ -119,7 +128,7 @@ Answer to Quick Quiz #2:
This restriction might seem gratuitous, since very few RCU
callbacks acquire locks directly. However, a great many RCU
- callbacks do acquire locks -indirectly-, for example, via
+ callbacks do acquire locks *indirectly*, for example, via
the kfree() primitive.
Answer to Quick Quiz #3:
--
2.22.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Linux-kernel-mentees][PATCH v5 4/5] Documentation: RCU: Rename txt files to rst
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 0/5] Documentation: RCU: Convert to reST Jiunn Chang
` (3 preceding siblings ...)
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 3/5] Documentation: RCU: Convert RCU UP systems " Jiunn Chang
@ 2019-06-26 20:07 ` Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 5/5] Documentation: RCU: Add TOC tree hooks Jiunn Chang
5 siblings, 0 replies; 17+ messages in thread
From: Jiunn Chang @ 2019-06-26 20:07 UTC (permalink / raw)
To: skhan
Cc: linux-kernel-mentees, rcu, linux-doc, paulmck, josh, rostedt,
mathieu.desnoyers, jiangshanlai, joel, corbet
Rename the following files to reST:
- rcu.txt
- listRCU.txt
- UP.txt
Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
---
Documentation/RCU/{UP.txt => UP.rst} | 0
Documentation/RCU/{listRCU.txt => listRCU.rst} | 0
Documentation/RCU/{rcu.txt => rcu.rst} | 0
3 files changed, 0 insertions(+), 0 deletions(-)
rename Documentation/RCU/{UP.txt => UP.rst} (100%)
rename Documentation/RCU/{listRCU.txt => listRCU.rst} (100%)
rename Documentation/RCU/{rcu.txt => rcu.rst} (100%)
diff --git a/Documentation/RCU/UP.txt b/Documentation/RCU/UP.rst
similarity index 100%
rename from Documentation/RCU/UP.txt
rename to Documentation/RCU/UP.rst
diff --git a/Documentation/RCU/listRCU.txt b/Documentation/RCU/listRCU.rst
similarity index 100%
rename from Documentation/RCU/listRCU.txt
rename to Documentation/RCU/listRCU.rst
diff --git a/Documentation/RCU/rcu.txt b/Documentation/RCU/rcu.rst
similarity index 100%
rename from Documentation/RCU/rcu.txt
rename to Documentation/RCU/rcu.rst
--
2.22.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Linux-kernel-mentees][PATCH v5 5/5] Documentation: RCU: Add TOC tree hooks
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 0/5] Documentation: RCU: Convert to reST Jiunn Chang
` (4 preceding siblings ...)
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 4/5] Documentation: RCU: Rename txt files to rst Jiunn Chang
@ 2019-06-26 20:07 ` Jiunn Chang
5 siblings, 0 replies; 17+ messages in thread
From: Jiunn Chang @ 2019-06-26 20:07 UTC (permalink / raw)
To: skhan
Cc: linux-kernel-mentees, rcu, linux-doc, paulmck, josh, rostedt,
mathieu.desnoyers, jiangshanlai, joel, corbet
Add TOC tree hooks for:
- rcu
- listRCU
- UP
Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
---
Documentation/RCU/index.rst | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
create mode 100644 Documentation/RCU/index.rst
diff --git a/Documentation/RCU/index.rst b/Documentation/RCU/index.rst
new file mode 100644
index 000000000000..340a9725676c
--- /dev/null
+++ b/Documentation/RCU/index.rst
@@ -0,0 +1,19 @@
+.. _rcu_concepts:
+
+============
+RCU concepts
+============
+
+.. toctree::
+ :maxdepth: 1
+
+ rcu
+ listRCU
+ UP
+
+.. only:: subproject and html
+
+ Indices
+ =======
+
+ * :ref:`genindex`
--
2.22.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [Linux-kernel-mentees][PATCH v5 1/5] Documentation: RCU: Convert RCU basic concepts to reST
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 1/5] Documentation: RCU: Convert RCU basic concepts " Jiunn Chang
@ 2019-06-27 14:34 ` Jonathan Corbet
2019-06-27 15:13 ` Steven Rostedt
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: Jonathan Corbet @ 2019-06-27 14:34 UTC (permalink / raw)
To: Jiunn Chang
Cc: skhan, linux-kernel-mentees, rcu, linux-doc, paulmck, josh,
rostedt, mathieu.desnoyers, jiangshanlai, joel
On Wed, 26 Jun 2019 15:07:01 -0500
Jiunn Chang <c0d1n61at3@gmail.com> wrote:
> RCU basic concepts reST markup.
>
> Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
So this is a little detail but ... your signoff should be the last thing
in the set of tags on the patch.
This isn't worth making you do yet another revision, so I went ahead and
applied the patches and fixed the tag ordering on the way in. I'll also
append a patch adding the new RCU stuff into the core-api manual so people
can actually get to it.
Thanks,
jon
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Linux-kernel-mentees][PATCH v5 1/5] Documentation: RCU: Convert RCU basic concepts to reST
2019-06-27 14:34 ` Jonathan Corbet
@ 2019-06-27 15:13 ` Steven Rostedt
2019-06-27 16:48 ` Shuah Khan
2019-06-27 16:26 ` Paul E. McKenney
2019-06-27 16:47 ` Jiunn Chang
2 siblings, 1 reply; 17+ messages in thread
From: Steven Rostedt @ 2019-06-27 15:13 UTC (permalink / raw)
To: Jonathan Corbet
Cc: Jiunn Chang, skhan, linux-kernel-mentees, rcu, linux-doc, paulmck,
josh, mathieu.desnoyers, jiangshanlai, joel
On Thu, 27 Jun 2019 08:34:43 -0600
Jonathan Corbet <corbet@lwn.net> wrote:
> On Wed, 26 Jun 2019 15:07:01 -0500
> Jiunn Chang <c0d1n61at3@gmail.com> wrote:
>
> > RCU basic concepts reST markup.
> >
> > Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
> > Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
>
> So this is a little detail but ... your signoff should be the last thing
> in the set of tags on the patch.
Note, I've been seeing this a lot lately, and then noticed, that when I
downloaded a patch directly from patchwork, it placed all the
Reviewed-by and Acked-by tags after the original Signed-off-by. I
checked the original patch on the mailing list, and it had no other
tags but the Signed-off-by. I then pulled one of my own patches, and it
did it to that patch as well.
I too prefer the Signed-off-by be last, but our tooling needs to do
this as well, otherwise it's a failure in our procedures.
-- Steve
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Linux-kernel-mentees][PATCH v5 1/5] Documentation: RCU: Convert RCU basic concepts to reST
2019-06-27 14:34 ` Jonathan Corbet
2019-06-27 15:13 ` Steven Rostedt
@ 2019-06-27 16:26 ` Paul E. McKenney
2019-06-27 16:47 ` Jiunn Chang
2 siblings, 0 replies; 17+ messages in thread
From: Paul E. McKenney @ 2019-06-27 16:26 UTC (permalink / raw)
To: Jonathan Corbet
Cc: Jiunn Chang, skhan, linux-kernel-mentees, rcu, linux-doc, josh,
rostedt, mathieu.desnoyers, jiangshanlai, joel
On Thu, Jun 27, 2019 at 08:34:43AM -0600, Jonathan Corbet wrote:
> On Wed, 26 Jun 2019 15:07:01 -0500
> Jiunn Chang <c0d1n61at3@gmail.com> wrote:
>
> > RCU basic concepts reST markup.
> >
> > Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
> > Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
>
> So this is a little detail but ... your signoff should be the last thing
> in the set of tags on the patch.
>
> This isn't worth making you do yet another revision, so I went ahead and
> applied the patches and fixed the tag ordering on the way in. I'll also
> append a patch adding the new RCU stuff into the core-api manual so people
> can actually get to it.
Please feel free to add my ack:
Acked-by: Paul E. McKenney <paulmck@linux.ibm.com>
Thanx, Paul
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Linux-kernel-mentees][PATCH v5 1/5] Documentation: RCU: Convert RCU basic concepts to reST
2019-06-27 14:34 ` Jonathan Corbet
2019-06-27 15:13 ` Steven Rostedt
2019-06-27 16:26 ` Paul E. McKenney
@ 2019-06-27 16:47 ` Jiunn Chang
2 siblings, 0 replies; 17+ messages in thread
From: Jiunn Chang @ 2019-06-27 16:47 UTC (permalink / raw)
To: Jonathan Corbet
Cc: skhan, linux-kernel-mentees, rcu, linux-doc, paulmck, josh,
rostedt, mathieu.desnoyers, jiangshanlai, joel
On Thu, Jun 27, 2019 at 08:34:43AM -0600, Jonathan Corbet wrote:
> On Wed, 26 Jun 2019 15:07:01 -0500
> Jiunn Chang <c0d1n61at3@gmail.com> wrote:
>
> > RCU basic concepts reST markup.
> >
> > Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
> > Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
>
> So this is a little detail but ... your signoff should be the last thing
> in the set of tags on the patch.
>
> This isn't worth making you do yet another revision, so I went ahead and
> applied the patches and fixed the tag ordering on the way in. I'll also
> append a patch adding the new RCU stuff into the core-api manual so people
> can actually get to it.
>
> Thanks,
>
> jon
Hello Jon,
I will keep this in mind for next time. I would like to thank you, Joel, Paul
and everyone else who has helped me learn the Linux kernel patch process.
I will send a patch for the UP systems change Paul sent me for _bh suffix.
THX,
Jiunn
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Linux-kernel-mentees][PATCH v5 1/5] Documentation: RCU: Convert RCU basic concepts to reST
2019-06-27 15:13 ` Steven Rostedt
@ 2019-06-27 16:48 ` Shuah Khan
0 siblings, 0 replies; 17+ messages in thread
From: Shuah Khan @ 2019-06-27 16:48 UTC (permalink / raw)
To: Steven Rostedt, Jonathan Corbet
Cc: Jiunn Chang, linux-kernel-mentees, rcu, linux-doc, paulmck, josh,
mathieu.desnoyers, jiangshanlai, joel, skh >> Shuah Khan
On 6/27/19 9:13 AM, Steven Rostedt wrote:
> On Thu, 27 Jun 2019 08:34:43 -0600
> Jonathan Corbet <corbet@lwn.net> wrote:
>
>> On Wed, 26 Jun 2019 15:07:01 -0500
>> Jiunn Chang <c0d1n61at3@gmail.com> wrote:
>>
>>> RCU basic concepts reST markup.
>>>
>>> Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
>>> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
>>
>> So this is a little detail but ... your signoff should be the last thing
>> in the set of tags on the patch.
>
> Note, I've been seeing this a lot lately, and then noticed, that when I
> downloaded a patch directly from patchwork, it placed all the
> Reviewed-by and Acked-by tags after the original Signed-off-by. I
> checked the original patch on the mailing list, and it had no other
> tags but the Signed-off-by. I then pulled one of my own patches, and it
> did it to that patch as well.
>
> I too prefer the Signed-off-by be last, but our tooling needs to do
> this as well, otherwise it's a failure in our procedures.
>
Thanks Steve for pointing this out. I am seeing some odd behavior with tags.
It appears some maintainers want the tags in chronological order, which
is Reviewed-by after Signed-off which doesn't make sense to me.
I prefer Signed-off-by last.
I am working on FAQ (Frequently Answered Questions) section for mentees.
I will add this to it.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2019-06-27 16:48 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20190625062627.26378-1-c0d1n61at3@gmail.com>
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 0/5] Documentation: RCU: Convert to reST Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 " Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 1/5] Documentation: RCU: Convert RCU basic concepts " Jiunn Chang
2019-06-27 14:34 ` Jonathan Corbet
2019-06-27 15:13 ` Steven Rostedt
2019-06-27 16:48 ` Shuah Khan
2019-06-27 16:26 ` Paul E. McKenney
2019-06-27 16:47 ` Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 2/5] Documentation: RCU: Convert RCU linked list " Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 3/5] Documentation: RCU: Convert RCU UP systems " Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 4/5] Documentation: RCU: Rename txt files to rst Jiunn Chang
2019-06-26 20:07 ` [Linux-kernel-mentees][PATCH v5 5/5] Documentation: RCU: Add TOC tree hooks Jiunn Chang
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 1/5] Documentation: RCU: Convert RCU basic concepts to reST Jiunn Chang
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 2/5] Documentation: RCU: Convert RCU linked list " Jiunn Chang
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 3/5] Documentation: RCU: Convert RCU UP systems " Jiunn Chang
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 4/5] Documentation: RCU: Rename txt files to rst Jiunn Chang
2019-06-26 19:12 ` [Linux-kernel-mentees][PATCH v4 5/5] Documentation: RCU: Add TOC tree hooks Jiunn Chang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).