Linux Kernel Mentees Archive on lore.kernel.org
 help / color / Atom feed
* [Linux-kernel-mentees] [PATCH] Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst.
@ 2019-10-28 21:42 madhuparnabhowmik04 at gmail.com (madhuparnabhowmik04 at gmail.com)
  2019-10-28 21:42 ` madhuparnabhowmik04 at gmail.com (madhuparnabhowmik04
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: madhuparnabhowmik04 at gmail.com (madhuparnabhowmik04 at gmail.com) @ 2019-10-28 21:42 UTC (permalink / raw)


From: Madhuparna Bhowmik <madhuparnabhowmik04 at gmail.com>

This patch converts NMI-RCU from txt to rst format.
Also adds NMI-RCU in the index.rst file.

Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04 at gmail.com>
---
 .../RCU/{NMI-RCU.txt => NMI-RCU.rst}          | 53 ++++++++++---------
 Documentation/RCU/index.rst                   |  1 +
 2 files changed, 29 insertions(+), 25 deletions(-)
 rename Documentation/RCU/{NMI-RCU.txt => NMI-RCU.rst} (73%)

diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.rst
similarity index 73%
rename from Documentation/RCU/NMI-RCU.txt
rename to Documentation/RCU/NMI-RCU.rst
index 881353fd5bff..da5861f6a433 100644
--- a/Documentation/RCU/NMI-RCU.txt
+++ b/Documentation/RCU/NMI-RCU.rst
@@ -1,4 +1,7 @@
+.. _NMI_rcu_doc:
+
 Using RCU to Protect Dynamic NMI Handlers
+=========================================
 
 
 Although RCU is usually used to protect read-mostly data structures,
@@ -9,7 +12,7 @@ work in "arch/x86/oprofile/nmi_timer_int.c" and in
 "arch/x86/kernel/traps.c".
 
 The relevant pieces of code are listed below, each followed by a
-brief explanation.
+brief explanation.::
 
 	static int dummy_nmi_callback(struct pt_regs *regs, int cpu)
 	{
@@ -18,12 +21,12 @@ brief explanation.
 
 The dummy_nmi_callback() function is a "dummy" NMI handler that does
 nothing, but returns zero, thus saying that it did nothing, allowing
-the NMI handler to take the default machine-specific action.
+the NMI handler to take the default machine-specific action.::
 
 	static nmi_callback_t nmi_callback = dummy_nmi_callback;
 
 This nmi_callback variable is a global function pointer to the current
-NMI handler.
+NMI handler.::
 
 	void do_nmi(struct pt_regs * regs, long error_code)
 	{
@@ -53,11 +56,12 @@ anyway.  However, in practice it is a good documentation aid, particularly
 for anyone attempting to do something similar on Alpha or on systems
 with aggressive optimizing compilers.
 
-Quick Quiz:  Why might the rcu_dereference_sched() be necessary on Alpha,
-	     given that the code referenced by the pointer is read-only?
+Quick Quiz:
+		Why might the rcu_dereference_sched() be necessary on Alpha, given that the code referenced by the pointer is read-only?
 
+:ref:`Answer to Quick Quiz <answer_quick_quiz_NMI>`
 
-Back to the discussion of NMI and RCU...
+Back to the discussion of NMI and RCU...::
 
 	void set_nmi_callback(nmi_callback_t callback)
 	{
@@ -68,7 +72,7 @@ The set_nmi_callback() function registers an NMI handler.  Note that any
 data that is to be used by the callback must be initialized up -before-
 the call to set_nmi_callback().  On architectures that do not order
 writes, the rcu_assign_pointer() ensures that the NMI handler sees the
-initialized values.
+initialized values::
 
 	void unset_nmi_callback(void)
 	{
@@ -82,7 +86,7 @@ up any data structures used by the old NMI handler until execution
 of it completes on all other CPUs.
 
 One way to accomplish this is via synchronize_rcu(), perhaps as
-follows:
+follows::
 
 	unset_nmi_callback();
 	synchronize_rcu();
@@ -98,24 +102,23 @@ to free up the handler's data as soon as synchronize_rcu() returns.
 Important note: for this to work, the architecture in question must
 invoke nmi_enter() and nmi_exit() on NMI entry and exit, respectively.
 
+.. _answer_quick_quiz_NMI:
 
-Answer to Quick Quiz
-
-	Why might the rcu_dereference_sched() be necessary on Alpha, given
-	that the code referenced by the pointer is read-only?
+Answer to Quick Quiz:
+	Why might the rcu_dereference_sched() be necessary on Alpha, given that the code referenced by the pointer is read-only?
 
-	Answer: The caller to set_nmi_callback() might well have
-		initialized some data that is to be used by the new NMI
-		handler.  In this case, the rcu_dereference_sched() would
-		be needed, because otherwise a CPU that received an NMI
-		just after the new handler was set might see the pointer
-		to the new NMI handler, but the old pre-initialized
-		version of the handler's data.
+	The caller to set_nmi_callback() might well have
+	initialized some data that is to be used by the new NMI
+	handler.  In this case, the rcu_dereference_sched() would
+	be needed, because otherwise a CPU that received an NMI
+	just after the new handler was set might see the pointer
+	to the new NMI handler, but the old pre-initialized
+	version of the handler's data.
 
-		This same sad story can happen on other CPUs when using
-		a compiler with aggressive pointer-value speculation
-		optimizations.
+	This same sad story can happen on other CPUs when using
+	a compiler with aggressive pointer-value speculation
+	optimizations.
 
-		More important, the rcu_dereference_sched() makes it
-		clear to someone reading the code that the pointer is
-		being protected by RCU-sched.
+	More important, the rcu_dereference_sched() makes it
+	clear to someone reading the code that the pointer is
+	being protected by RCU-sched.
diff --git a/Documentation/RCU/index.rst b/Documentation/RCU/index.rst
index 8d20d44f8fd4..627128c230dc 100644
--- a/Documentation/RCU/index.rst
+++ b/Documentation/RCU/index.rst
@@ -10,6 +10,7 @@ RCU concepts
    arrayRCU
    rcu
    listRCU
+   NMI-RCU
    UP
 
    Design/Memory-Ordering/Tree-RCU-Memory-Ordering
-- 
2.17.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Linux-kernel-mentees] [PATCH] Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst.
  2019-10-28 21:42 [Linux-kernel-mentees] [PATCH] Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst madhuparnabhowmik04 at gmail.com (madhuparnabhowmik04 at gmail.com)
@ 2019-10-28 21:42 ` madhuparnabhowmik04 at gmail.com (madhuparnabhowmik04
  2019-10-29 10:06 ` paulmck at kernel.org (Paul E. McKenney)
  2019-11-05 13:40 ` Phong Tran
  2 siblings, 0 replies; 9+ messages in thread
From: madhuparnabhowmik04 at gmail.com (madhuparnabhowmik04 @ 2019-10-28 21:42 UTC (permalink / raw)


From: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>

This patch converts NMI-RCU from txt to rst format.
Also adds NMI-RCU in the index.rst file.

Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04 at gmail.com>
---
 .../RCU/{NMI-RCU.txt => NMI-RCU.rst}          | 53 ++++++++++---------
 Documentation/RCU/index.rst                   |  1 +
 2 files changed, 29 insertions(+), 25 deletions(-)
 rename Documentation/RCU/{NMI-RCU.txt => NMI-RCU.rst} (73%)

diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.rst
similarity index 73%
rename from Documentation/RCU/NMI-RCU.txt
rename to Documentation/RCU/NMI-RCU.rst
index 881353fd5bff..da5861f6a433 100644
--- a/Documentation/RCU/NMI-RCU.txt
+++ b/Documentation/RCU/NMI-RCU.rst
@@ -1,4 +1,7 @@
+.. _NMI_rcu_doc:
+
 Using RCU to Protect Dynamic NMI Handlers
+=========================================
 
 
 Although RCU is usually used to protect read-mostly data structures,
@@ -9,7 +12,7 @@ work in "arch/x86/oprofile/nmi_timer_int.c" and in
 "arch/x86/kernel/traps.c".
 
 The relevant pieces of code are listed below, each followed by a
-brief explanation.
+brief explanation.::
 
 	static int dummy_nmi_callback(struct pt_regs *regs, int cpu)
 	{
@@ -18,12 +21,12 @@ brief explanation.
 
 The dummy_nmi_callback() function is a "dummy" NMI handler that does
 nothing, but returns zero, thus saying that it did nothing, allowing
-the NMI handler to take the default machine-specific action.
+the NMI handler to take the default machine-specific action.::
 
 	static nmi_callback_t nmi_callback = dummy_nmi_callback;
 
 This nmi_callback variable is a global function pointer to the current
-NMI handler.
+NMI handler.::
 
 	void do_nmi(struct pt_regs * regs, long error_code)
 	{
@@ -53,11 +56,12 @@ anyway.  However, in practice it is a good documentation aid, particularly
 for anyone attempting to do something similar on Alpha or on systems
 with aggressive optimizing compilers.
 
-Quick Quiz:  Why might the rcu_dereference_sched() be necessary on Alpha,
-	     given that the code referenced by the pointer is read-only?
+Quick Quiz:
+		Why might the rcu_dereference_sched() be necessary on Alpha, given that the code referenced by the pointer is read-only?
 
+:ref:`Answer to Quick Quiz <answer_quick_quiz_NMI>`
 
-Back to the discussion of NMI and RCU...
+Back to the discussion of NMI and RCU...::
 
 	void set_nmi_callback(nmi_callback_t callback)
 	{
@@ -68,7 +72,7 @@ The set_nmi_callback() function registers an NMI handler.  Note that any
 data that is to be used by the callback must be initialized up -before-
 the call to set_nmi_callback().  On architectures that do not order
 writes, the rcu_assign_pointer() ensures that the NMI handler sees the
-initialized values.
+initialized values::
 
 	void unset_nmi_callback(void)
 	{
@@ -82,7 +86,7 @@ up any data structures used by the old NMI handler until execution
 of it completes on all other CPUs.
 
 One way to accomplish this is via synchronize_rcu(), perhaps as
-follows:
+follows::
 
 	unset_nmi_callback();
 	synchronize_rcu();
@@ -98,24 +102,23 @@ to free up the handler's data as soon as synchronize_rcu() returns.
 Important note: for this to work, the architecture in question must
 invoke nmi_enter() and nmi_exit() on NMI entry and exit, respectively.
 
+.. _answer_quick_quiz_NMI:
 
-Answer to Quick Quiz
-
-	Why might the rcu_dereference_sched() be necessary on Alpha, given
-	that the code referenced by the pointer is read-only?
+Answer to Quick Quiz:
+	Why might the rcu_dereference_sched() be necessary on Alpha, given that the code referenced by the pointer is read-only?
 
-	Answer: The caller to set_nmi_callback() might well have
-		initialized some data that is to be used by the new NMI
-		handler.  In this case, the rcu_dereference_sched() would
-		be needed, because otherwise a CPU that received an NMI
-		just after the new handler was set might see the pointer
-		to the new NMI handler, but the old pre-initialized
-		version of the handler's data.
+	The caller to set_nmi_callback() might well have
+	initialized some data that is to be used by the new NMI
+	handler.  In this case, the rcu_dereference_sched() would
+	be needed, because otherwise a CPU that received an NMI
+	just after the new handler was set might see the pointer
+	to the new NMI handler, but the old pre-initialized
+	version of the handler's data.
 
-		This same sad story can happen on other CPUs when using
-		a compiler with aggressive pointer-value speculation
-		optimizations.
+	This same sad story can happen on other CPUs when using
+	a compiler with aggressive pointer-value speculation
+	optimizations.
 
-		More important, the rcu_dereference_sched() makes it
-		clear to someone reading the code that the pointer is
-		being protected by RCU-sched.
+	More important, the rcu_dereference_sched() makes it
+	clear to someone reading the code that the pointer is
+	being protected by RCU-sched.
diff --git a/Documentation/RCU/index.rst b/Documentation/RCU/index.rst
index 8d20d44f8fd4..627128c230dc 100644
--- a/Documentation/RCU/index.rst
+++ b/Documentation/RCU/index.rst
@@ -10,6 +10,7 @@ RCU concepts
    arrayRCU
    rcu
    listRCU
+   NMI-RCU
    UP
 
    Design/Memory-Ordering/Tree-RCU-Memory-Ordering
-- 
2.17.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Linux-kernel-mentees] [PATCH] Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst.
  2019-10-28 21:42 [Linux-kernel-mentees] [PATCH] Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst madhuparnabhowmik04 at gmail.com (madhuparnabhowmik04 at gmail.com)
  2019-10-28 21:42 ` madhuparnabhowmik04 at gmail.com (madhuparnabhowmik04
@ 2019-10-29 10:06 ` paulmck at kernel.org (Paul E. McKenney)
  2019-10-29 10:06   ` paulmck
  2019-11-05 13:40 ` Phong Tran
  2 siblings, 1 reply; 9+ messages in thread
From: paulmck at kernel.org (Paul E. McKenney) @ 2019-10-29 10:06 UTC (permalink / raw)


On Tue, Oct 29, 2019 at 03:12:52AM +0530, madhuparnabhowmik04 at gmail.com wrote:
> From: Madhuparna Bhowmik <madhuparnabhowmik04 at gmail.com>
> 
> This patch converts NMI-RCU from txt to rst format.
> Also adds NMI-RCU in the index.rst file.
> 
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04 at gmail.com>

Applied for further review, thank you!  Assuming review goes well,
I will be pushing this for v5.6 (not the upcoming merge window, but
the one after it).

							Thanx, Paul

> ---
>  .../RCU/{NMI-RCU.txt => NMI-RCU.rst}          | 53 ++++++++++---------
>  Documentation/RCU/index.rst                   |  1 +
>  2 files changed, 29 insertions(+), 25 deletions(-)
>  rename Documentation/RCU/{NMI-RCU.txt => NMI-RCU.rst} (73%)
> 
> diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.rst
> similarity index 73%
> rename from Documentation/RCU/NMI-RCU.txt
> rename to Documentation/RCU/NMI-RCU.rst
> index 881353fd5bff..da5861f6a433 100644
> --- a/Documentation/RCU/NMI-RCU.txt
> +++ b/Documentation/RCU/NMI-RCU.rst
> @@ -1,4 +1,7 @@
> +.. _NMI_rcu_doc:
> +
>  Using RCU to Protect Dynamic NMI Handlers
> +=========================================
>  
>  
>  Although RCU is usually used to protect read-mostly data structures,
> @@ -9,7 +12,7 @@ work in "arch/x86/oprofile/nmi_timer_int.c" and in
>  "arch/x86/kernel/traps.c".
>  
>  The relevant pieces of code are listed below, each followed by a
> -brief explanation.
> +brief explanation.::
>  
>  	static int dummy_nmi_callback(struct pt_regs *regs, int cpu)
>  	{
> @@ -18,12 +21,12 @@ brief explanation.
>  
>  The dummy_nmi_callback() function is a "dummy" NMI handler that does
>  nothing, but returns zero, thus saying that it did nothing, allowing
> -the NMI handler to take the default machine-specific action.
> +the NMI handler to take the default machine-specific action.::
>  
>  	static nmi_callback_t nmi_callback = dummy_nmi_callback;
>  
>  This nmi_callback variable is a global function pointer to the current
> -NMI handler.
> +NMI handler.::
>  
>  	void do_nmi(struct pt_regs * regs, long error_code)
>  	{
> @@ -53,11 +56,12 @@ anyway.  However, in practice it is a good documentation aid, particularly
>  for anyone attempting to do something similar on Alpha or on systems
>  with aggressive optimizing compilers.
>  
> -Quick Quiz:  Why might the rcu_dereference_sched() be necessary on Alpha,
> -	     given that the code referenced by the pointer is read-only?
> +Quick Quiz:
> +		Why might the rcu_dereference_sched() be necessary on Alpha, given that the code referenced by the pointer is read-only?
>  
> +:ref:`Answer to Quick Quiz <answer_quick_quiz_NMI>`
>  
> -Back to the discussion of NMI and RCU...
> +Back to the discussion of NMI and RCU...::
>  
>  	void set_nmi_callback(nmi_callback_t callback)
>  	{
> @@ -68,7 +72,7 @@ The set_nmi_callback() function registers an NMI handler.  Note that any
>  data that is to be used by the callback must be initialized up -before-
>  the call to set_nmi_callback().  On architectures that do not order
>  writes, the rcu_assign_pointer() ensures that the NMI handler sees the
> -initialized values.
> +initialized values::
>  
>  	void unset_nmi_callback(void)
>  	{
> @@ -82,7 +86,7 @@ up any data structures used by the old NMI handler until execution
>  of it completes on all other CPUs.
>  
>  One way to accomplish this is via synchronize_rcu(), perhaps as
> -follows:
> +follows::
>  
>  	unset_nmi_callback();
>  	synchronize_rcu();
> @@ -98,24 +102,23 @@ to free up the handler's data as soon as synchronize_rcu() returns.
>  Important note: for this to work, the architecture in question must
>  invoke nmi_enter() and nmi_exit() on NMI entry and exit, respectively.
>  
> +.. _answer_quick_quiz_NMI:
>  
> -Answer to Quick Quiz
> -
> -	Why might the rcu_dereference_sched() be necessary on Alpha, given
> -	that the code referenced by the pointer is read-only?
> +Answer to Quick Quiz:
> +	Why might the rcu_dereference_sched() be necessary on Alpha, given that the code referenced by the pointer is read-only?
>  
> -	Answer: The caller to set_nmi_callback() might well have
> -		initialized some data that is to be used by the new NMI
> -		handler.  In this case, the rcu_dereference_sched() would
> -		be needed, because otherwise a CPU that received an NMI
> -		just after the new handler was set might see the pointer
> -		to the new NMI handler, but the old pre-initialized
> -		version of the handler's data.
> +	The caller to set_nmi_callback() might well have
> +	initialized some data that is to be used by the new NMI
> +	handler.  In this case, the rcu_dereference_sched() would
> +	be needed, because otherwise a CPU that received an NMI
> +	just after the new handler was set might see the pointer
> +	to the new NMI handler, but the old pre-initialized
> +	version of the handler's data.
>  
> -		This same sad story can happen on other CPUs when using
> -		a compiler with aggressive pointer-value speculation
> -		optimizations.
> +	This same sad story can happen on other CPUs when using
> +	a compiler with aggressive pointer-value speculation
> +	optimizations.
>  
> -		More important, the rcu_dereference_sched() makes it
> -		clear to someone reading the code that the pointer is
> -		being protected by RCU-sched.
> +	More important, the rcu_dereference_sched() makes it
> +	clear to someone reading the code that the pointer is
> +	being protected by RCU-sched.
> diff --git a/Documentation/RCU/index.rst b/Documentation/RCU/index.rst
> index 8d20d44f8fd4..627128c230dc 100644
> --- a/Documentation/RCU/index.rst
> +++ b/Documentation/RCU/index.rst
> @@ -10,6 +10,7 @@ RCU concepts
>     arrayRCU
>     rcu
>     listRCU
> +   NMI-RCU
>     UP
>  
>     Design/Memory-Ordering/Tree-RCU-Memory-Ordering
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Linux-kernel-mentees] [PATCH] Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst.
  2019-10-29 10:06 ` paulmck at kernel.org (Paul E. McKenney)
@ 2019-10-29 10:06   ` paulmck
  0 siblings, 0 replies; 9+ messages in thread
From: paulmck @ 2019-10-29 10:06 UTC (permalink / raw)


On Tue, Oct 29, 2019 at 03:12:52AM +0530, madhuparnabhowmik04 at gmail.com wrote:
> From: Madhuparna Bhowmik <madhuparnabhowmik04 at gmail.com>
> 
> This patch converts NMI-RCU from txt to rst format.
> Also adds NMI-RCU in the index.rst file.
> 
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04 at gmail.com>

Applied for further review, thank you!  Assuming review goes well,
I will be pushing this for v5.6 (not the upcoming merge window, but
the one after it).

							Thanx, Paul

> ---
>  .../RCU/{NMI-RCU.txt => NMI-RCU.rst}          | 53 ++++++++++---------
>  Documentation/RCU/index.rst                   |  1 +
>  2 files changed, 29 insertions(+), 25 deletions(-)
>  rename Documentation/RCU/{NMI-RCU.txt => NMI-RCU.rst} (73%)
> 
> diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.rst
> similarity index 73%
> rename from Documentation/RCU/NMI-RCU.txt
> rename to Documentation/RCU/NMI-RCU.rst
> index 881353fd5bff..da5861f6a433 100644
> --- a/Documentation/RCU/NMI-RCU.txt
> +++ b/Documentation/RCU/NMI-RCU.rst
> @@ -1,4 +1,7 @@
> +.. _NMI_rcu_doc:
> +
>  Using RCU to Protect Dynamic NMI Handlers
> +=========================================
>  
>  
>  Although RCU is usually used to protect read-mostly data structures,
> @@ -9,7 +12,7 @@ work in "arch/x86/oprofile/nmi_timer_int.c" and in
>  "arch/x86/kernel/traps.c".
>  
>  The relevant pieces of code are listed below, each followed by a
> -brief explanation.
> +brief explanation.::
>  
>  	static int dummy_nmi_callback(struct pt_regs *regs, int cpu)
>  	{
> @@ -18,12 +21,12 @@ brief explanation.
>  
>  The dummy_nmi_callback() function is a "dummy" NMI handler that does
>  nothing, but returns zero, thus saying that it did nothing, allowing
> -the NMI handler to take the default machine-specific action.
> +the NMI handler to take the default machine-specific action.::
>  
>  	static nmi_callback_t nmi_callback = dummy_nmi_callback;
>  
>  This nmi_callback variable is a global function pointer to the current
> -NMI handler.
> +NMI handler.::
>  
>  	void do_nmi(struct pt_regs * regs, long error_code)
>  	{
> @@ -53,11 +56,12 @@ anyway.  However, in practice it is a good documentation aid, particularly
>  for anyone attempting to do something similar on Alpha or on systems
>  with aggressive optimizing compilers.
>  
> -Quick Quiz:  Why might the rcu_dereference_sched() be necessary on Alpha,
> -	     given that the code referenced by the pointer is read-only?
> +Quick Quiz:
> +		Why might the rcu_dereference_sched() be necessary on Alpha, given that the code referenced by the pointer is read-only?
>  
> +:ref:`Answer to Quick Quiz <answer_quick_quiz_NMI>`
>  
> -Back to the discussion of NMI and RCU...
> +Back to the discussion of NMI and RCU...::
>  
>  	void set_nmi_callback(nmi_callback_t callback)
>  	{
> @@ -68,7 +72,7 @@ The set_nmi_callback() function registers an NMI handler.  Note that any
>  data that is to be used by the callback must be initialized up -before-
>  the call to set_nmi_callback().  On architectures that do not order
>  writes, the rcu_assign_pointer() ensures that the NMI handler sees the
> -initialized values.
> +initialized values::
>  
>  	void unset_nmi_callback(void)
>  	{
> @@ -82,7 +86,7 @@ up any data structures used by the old NMI handler until execution
>  of it completes on all other CPUs.
>  
>  One way to accomplish this is via synchronize_rcu(), perhaps as
> -follows:
> +follows::
>  
>  	unset_nmi_callback();
>  	synchronize_rcu();
> @@ -98,24 +102,23 @@ to free up the handler's data as soon as synchronize_rcu() returns.
>  Important note: for this to work, the architecture in question must
>  invoke nmi_enter() and nmi_exit() on NMI entry and exit, respectively.
>  
> +.. _answer_quick_quiz_NMI:
>  
> -Answer to Quick Quiz
> -
> -	Why might the rcu_dereference_sched() be necessary on Alpha, given
> -	that the code referenced by the pointer is read-only?
> +Answer to Quick Quiz:
> +	Why might the rcu_dereference_sched() be necessary on Alpha, given that the code referenced by the pointer is read-only?
>  
> -	Answer: The caller to set_nmi_callback() might well have
> -		initialized some data that is to be used by the new NMI
> -		handler.  In this case, the rcu_dereference_sched() would
> -		be needed, because otherwise a CPU that received an NMI
> -		just after the new handler was set might see the pointer
> -		to the new NMI handler, but the old pre-initialized
> -		version of the handler's data.
> +	The caller to set_nmi_callback() might well have
> +	initialized some data that is to be used by the new NMI
> +	handler.  In this case, the rcu_dereference_sched() would
> +	be needed, because otherwise a CPU that received an NMI
> +	just after the new handler was set might see the pointer
> +	to the new NMI handler, but the old pre-initialized
> +	version of the handler's data.
>  
> -		This same sad story can happen on other CPUs when using
> -		a compiler with aggressive pointer-value speculation
> -		optimizations.
> +	This same sad story can happen on other CPUs when using
> +	a compiler with aggressive pointer-value speculation
> +	optimizations.
>  
> -		More important, the rcu_dereference_sched() makes it
> -		clear to someone reading the code that the pointer is
> -		being protected by RCU-sched.
> +	More important, the rcu_dereference_sched() makes it
> +	clear to someone reading the code that the pointer is
> +	being protected by RCU-sched.
> diff --git a/Documentation/RCU/index.rst b/Documentation/RCU/index.rst
> index 8d20d44f8fd4..627128c230dc 100644
> --- a/Documentation/RCU/index.rst
> +++ b/Documentation/RCU/index.rst
> @@ -10,6 +10,7 @@ RCU concepts
>     arrayRCU
>     rcu
>     listRCU
> +   NMI-RCU
>     UP
>  
>     Design/Memory-Ordering/Tree-RCU-Memory-Ordering
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Linux-kernel-mentees] [PATCH] Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst.
  2019-10-28 21:42 [Linux-kernel-mentees] [PATCH] Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst madhuparnabhowmik04 at gmail.com (madhuparnabhowmik04 at gmail.com)
  2019-10-28 21:42 ` madhuparnabhowmik04 at gmail.com (madhuparnabhowmik04
  2019-10-29 10:06 ` paulmck at kernel.org (Paul E. McKenney)
@ 2019-11-05 13:40 ` Phong Tran
  2019-11-05 13:55   ` Paul E. McKenney
  2 siblings, 1 reply; 9+ messages in thread
From: Phong Tran @ 2019-11-05 13:40 UTC (permalink / raw)
  To: madhuparnabhowmik04
  Cc: paulmck, corbet, linux-doc, linux-kernel, rcu, joel,
	linux-kernel-mentees

On 10/29/19 4:42 AM, madhuparnabhowmik04@gmail.com wrote:
> From: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
> 
> This patch converts NMI-RCU from txt to rst format.
> Also adds NMI-RCU in the index.rst file.
> 
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
> -- >   .../RCU/{NMI-RCU.txt => NMI-RCU.rst}          | 53 ++++++++++---------
>   Documentation/RCU/index.rst                   |  1 +
>   2 files changed, 29 insertions(+), 25 deletions(-)
>   rename Documentation/RCU/{NMI-RCU.txt => NMI-RCU.rst} (73%)
> 
> diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.rst
> similarity index 73%
> rename from Documentation/RCU/NMI-RCU.txt
> rename to Documentation/RCU/NMI-RCU.rst
> index 881353fd5bff..da5861f6a433 100644
> --- a/Documentation/RCU/NMI-RCU.txt
> +++ b/Documentation/RCU/NMI-RCU.rst
> @@ -1,4 +1,7 @@
> +.. _NMI_rcu_doc:
> +
>   Using RCU to Protect Dynamic NMI Handlers
> +=========================================
>   
>   
>   Although RCU is usually used to protect read-mostly data structures,
> @@ -9,7 +12,7 @@ work in "arch/x86/oprofile/nmi_timer_int.c" and in
>   "arch/x86/kernel/traps.c".
>   
>   The relevant pieces of code are listed below, each followed by a
> -brief explanation.
> +brief explanation.::
>   
there is just a minor ":" redundant in html page.There are some same in 
this patch.
eg:
  brief explanation.:

Other things look good to me.

Tested-by: Phong Tran <tranmanphong@gmail.com>

Regards,
Phong.

>   	static int dummy_nmi_callback(struct pt_regs *regs, int cpu)
>   	{
> @@ -18,12 +21,12 @@ brief explanation.
>   
>   The dummy_nmi_callback() function is a "dummy" NMI handler that does
>   nothing, but returns zero, thus saying that it did nothing, allowing
> -the NMI handler to take the default machine-specific action.
> +the NMI handler to take the default machine-specific action.::
>   
>   	static nmi_callback_t nmi_callback = dummy_nmi_callback;
>   
>   This nmi_callback variable is a global function pointer to the current
> -NMI handler.
> +NMI handler.::
>   
>   	void do_nmi(struct pt_regs * regs, long error_code)
>   	{
> @@ -53,11 +56,12 @@ anyway.  However, in practice it is a good documentation aid, particularly
>   for anyone attempting to do something similar on Alpha or on systems
>   with aggressive optimizing compilers.
>   
> -Quick Quiz:  Why might the rcu_dereference_sched() be necessary on Alpha,
> -	     given that the code referenced by the pointer is read-only?
> +Quick Quiz:
> +		Why might the rcu_dereference_sched() be necessary on Alpha, given that the code referenced by the pointer is read-only?
>   
> +:ref:`Answer to Quick Quiz <answer_quick_quiz_NMI>`
>   
> -Back to the discussion of NMI and RCU...
> +Back to the discussion of NMI and RCU...::
>   
>   	void set_nmi_callback(nmi_callback_t callback)
>   	{
> @@ -68,7 +72,7 @@ The set_nmi_callback() function registers an NMI handler.  Note that any
>   data that is to be used by the callback must be initialized up -before-
>   the call to set_nmi_callback().  On architectures that do not order
>   writes, the rcu_assign_pointer() ensures that the NMI handler sees the
> -initialized values.
> +initialized values::
>   
>   	void unset_nmi_callback(void)
>   	{
> @@ -82,7 +86,7 @@ up any data structures used by the old NMI handler until execution
>   of it completes on all other CPUs.
>   
>   One way to accomplish this is via synchronize_rcu(), perhaps as
> -follows:
> +follows::
>   
>   	unset_nmi_callback();
>   	synchronize_rcu();
> @@ -98,24 +102,23 @@ to free up the handler's data as soon as synchronize_rcu() returns.
>   Important note: for this to work, the architecture in question must
>   invoke nmi_enter() and nmi_exit() on NMI entry and exit, respectively.
>   
> +.. _answer_quick_quiz_NMI:
>   
> -Answer to Quick Quiz
> -
> -	Why might the rcu_dereference_sched() be necessary on Alpha, given
> -	that the code referenced by the pointer is read-only?
> +Answer to Quick Quiz:
> +	Why might the rcu_dereference_sched() be necessary on Alpha, given that the code referenced by the pointer is read-only?
>   
> -	Answer: The caller to set_nmi_callback() might well have
> -		initialized some data that is to be used by the new NMI
> -		handler.  In this case, the rcu_dereference_sched() would
> -		be needed, because otherwise a CPU that received an NMI
> -		just after the new handler was set might see the pointer
> -		to the new NMI handler, but the old pre-initialized
> -		version of the handler's data.
> +	The caller to set_nmi_callback() might well have
> +	initialized some data that is to be used by the new NMI
> +	handler.  In this case, the rcu_dereference_sched() would
> +	be needed, because otherwise a CPU that received an NMI
> +	just after the new handler was set might see the pointer
> +	to the new NMI handler, but the old pre-initialized
> +	version of the handler's data.
>   
> -		This same sad story can happen on other CPUs when using
> -		a compiler with aggressive pointer-value speculation
> -		optimizations.
> +	This same sad story can happen on other CPUs when using
> +	a compiler with aggressive pointer-value speculation
> +	optimizations.
>   
> -		More important, the rcu_dereference_sched() makes it
> -		clear to someone reading the code that the pointer is
> -		being protected by RCU-sched.
> +	More important, the rcu_dereference_sched() makes it
> +	clear to someone reading the code that the pointer is
> +	being protected by RCU-sched.
> diff --git a/Documentation/RCU/index.rst b/Documentation/RCU/index.rst
> index 8d20d44f8fd4..627128c230dc 100644
> --- a/Documentation/RCU/index.rst
> +++ b/Documentation/RCU/index.rst
> @@ -10,6 +10,7 @@ RCU concepts
>      arrayRCU
>      rcu
>      listRCU
> +   NMI-RCU
>      UP
>   
>      Design/Memory-Ordering/Tree-RCU-Memory-Ordering
> 
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Linux-kernel-mentees] [PATCH] Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst.
  2019-11-05 13:40 ` Phong Tran
@ 2019-11-05 13:55   ` Paul E. McKenney
  2019-11-05 14:02     ` Phong Tran
  2019-11-05 21:37     ` Madhuparna Bhowmik
  0 siblings, 2 replies; 9+ messages in thread
From: Paul E. McKenney @ 2019-11-05 13:55 UTC (permalink / raw)
  To: Phong Tran
  Cc: corbet, linux-doc, linux-kernel, rcu, joel, linux-kernel-mentees

On Tue, Nov 05, 2019 at 08:40:05PM +0700, Phong Tran wrote:
> On 10/29/19 4:42 AM, madhuparnabhowmik04@gmail.com wrote:
> > From: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
> > 
> > This patch converts NMI-RCU from txt to rst format.
> > Also adds NMI-RCU in the index.rst file.
> > 
> > Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
> > -- >   .../RCU/{NMI-RCU.txt => NMI-RCU.rst}          | 53 ++++++++++---------
> >   Documentation/RCU/index.rst                   |  1 +
> >   2 files changed, 29 insertions(+), 25 deletions(-)
> >   rename Documentation/RCU/{NMI-RCU.txt => NMI-RCU.rst} (73%)
> > 
> > diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.rst
> > similarity index 73%
> > rename from Documentation/RCU/NMI-RCU.txt
> > rename to Documentation/RCU/NMI-RCU.rst
> > index 881353fd5bff..da5861f6a433 100644
> > --- a/Documentation/RCU/NMI-RCU.txt
> > +++ b/Documentation/RCU/NMI-RCU.rst
> > @@ -1,4 +1,7 @@
> > +.. _NMI_rcu_doc:
> > +
> >   Using RCU to Protect Dynamic NMI Handlers
> > +=========================================
> >   Although RCU is usually used to protect read-mostly data structures,
> > @@ -9,7 +12,7 @@ work in "arch/x86/oprofile/nmi_timer_int.c" and in
> >   "arch/x86/kernel/traps.c".
> >   The relevant pieces of code are listed below, each followed by a
> > -brief explanation.
> > +brief explanation.::
> there is just a minor ":" redundant in html page.There are some same in this
> patch.
> eg:
>  brief explanation.:
> 
> Other things look good to me.
> 
> Tested-by: Phong Tran <tranmanphong@gmail.com>

Thank you, Phong!

I queued a commit to be squashed into Madhuparna's original as shown below
which adds your Tested-by and attempts a fix.  Does this work for you?

							Thanx, Paul

------------------------------------------------------------------------

commit 2c29f1c481f74f5e5aaaab195042f4df6a0b8119
Author: Paul E. McKenney <paulmck@kernel.org>
Date:   Tue Nov 5 05:51:12 2019 -0800

    squash! Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst.
    
    [ paulmck: Apply feedback from Phong Tran. ]
    Tested-by: Phong Tran <tranmanphong@gmail.com>
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

diff --git a/Documentation/RCU/NMI-RCU.rst b/Documentation/RCU/NMI-RCU.rst
index da5861f..1809583 100644
--- a/Documentation/RCU/NMI-RCU.rst
+++ b/Documentation/RCU/NMI-RCU.rst
@@ -12,7 +12,7 @@ work in "arch/x86/oprofile/nmi_timer_int.c" and in
 "arch/x86/kernel/traps.c".
 
 The relevant pieces of code are listed below, each followed by a
-brief explanation.::
+brief explanation::
 
 	static int dummy_nmi_callback(struct pt_regs *regs, int cpu)
 	{
@@ -21,12 +21,12 @@ brief explanation.::
 
 The dummy_nmi_callback() function is a "dummy" NMI handler that does
 nothing, but returns zero, thus saying that it did nothing, allowing
-the NMI handler to take the default machine-specific action.::
+the NMI handler to take the default machine-specific action::
 
 	static nmi_callback_t nmi_callback = dummy_nmi_callback;
 
 This nmi_callback variable is a global function pointer to the current
-NMI handler.::
+NMI handler::
 
 	void do_nmi(struct pt_regs * regs, long error_code)
 	{
@@ -61,7 +61,7 @@ Quick Quiz:
 
 :ref:`Answer to Quick Quiz <answer_quick_quiz_NMI>`
 
-Back to the discussion of NMI and RCU...::
+Back to the discussion of NMI and RCU::
 
 	void set_nmi_callback(nmi_callback_t callback)
 	{
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Linux-kernel-mentees] [PATCH] Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst.
  2019-11-05 13:55   ` Paul E. McKenney
@ 2019-11-05 14:02     ` Phong Tran
  2019-11-05 14:05       ` Paul E. McKenney
  2019-11-05 21:37     ` Madhuparna Bhowmik
  1 sibling, 1 reply; 9+ messages in thread
From: Phong Tran @ 2019-11-05 14:02 UTC (permalink / raw)
  To: paulmck; +Cc: corbet, linux-doc, linux-kernel, rcu, joel, linux-kernel-mentees

On 11/5/19 8:55 PM, Paul E. McKenney wrote:
> On Tue, Nov 05, 2019 at 08:40:05PM +0700, Phong Tran wrote:
>> On 10/29/19 4:42 AM, madhuparnabhowmik04@gmail.com wrote:
>>> From: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
>>>
>>> This patch converts NMI-RCU from txt to rst format.
>>> Also adds NMI-RCU in the index.rst file.
>>>
>>> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
>>> -- >   .../RCU/{NMI-RCU.txt => NMI-RCU.rst}          | 53 ++++++++++---------
>>>    Documentation/RCU/index.rst                   |  1 +
>>>    2 files changed, 29 insertions(+), 25 deletions(-)
>>>    rename Documentation/RCU/{NMI-RCU.txt => NMI-RCU.rst} (73%)
>>>
>>> diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.rst
>>> similarity index 73%
>>> rename from Documentation/RCU/NMI-RCU.txt
>>> rename to Documentation/RCU/NMI-RCU.rst
>>> index 881353fd5bff..da5861f6a433 100644
>>> --- a/Documentation/RCU/NMI-RCU.txt
>>> +++ b/Documentation/RCU/NMI-RCU.rst
>>> @@ -1,4 +1,7 @@
>>> +.. _NMI_rcu_doc:
>>> +
>>>    Using RCU to Protect Dynamic NMI Handlers
>>> +=========================================
>>>    Although RCU is usually used to protect read-mostly data structures,
>>> @@ -9,7 +12,7 @@ work in "arch/x86/oprofile/nmi_timer_int.c" and in
>>>    "arch/x86/kernel/traps.c".
>>>    The relevant pieces of code are listed below, each followed by a
>>> -brief explanation.
>>> +brief explanation.::
>> there is just a minor ":" redundant in html page.There are some same in this
>> patch.
>> eg:
>>   brief explanation.:
>>
>> Other things look good to me.
>>
>> Tested-by: Phong Tran <tranmanphong@gmail.com>
> 
> Thank you, Phong!
> 
> I queued a commit to be squashed into Madhuparna's original as shown below
> which adds your Tested-by and attempts a fix.  Does this work for you?
> 

Yes, Paul.

Regards,
Phong.

> 							Thanx, Paul
> 
> ------------------------------------------------------------------------
> 
> commit 2c29f1c481f74f5e5aaaab195042f4df6a0b8119
> Author: Paul E. McKenney <paulmck@kernel.org>
> Date:   Tue Nov 5 05:51:12 2019 -0800
> 
>      squash! Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst.
>      
>      [ paulmck: Apply feedback from Phong Tran. ]
>      Tested-by: Phong Tran <tranmanphong@gmail.com>
>      Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> 
> diff --git a/Documentation/RCU/NMI-RCU.rst b/Documentation/RCU/NMI-RCU.rst
> index da5861f..1809583 100644
> --- a/Documentation/RCU/NMI-RCU.rst
> +++ b/Documentation/RCU/NMI-RCU.rst
> @@ -12,7 +12,7 @@ work in "arch/x86/oprofile/nmi_timer_int.c" and in
>   "arch/x86/kernel/traps.c".
>   
>   The relevant pieces of code are listed below, each followed by a
> -brief explanation.::
> +brief explanation::
>   
>   	static int dummy_nmi_callback(struct pt_regs *regs, int cpu)
>   	{
> @@ -21,12 +21,12 @@ brief explanation.::
>   
>   The dummy_nmi_callback() function is a "dummy" NMI handler that does
>   nothing, but returns zero, thus saying that it did nothing, allowing
> -the NMI handler to take the default machine-specific action.::
> +the NMI handler to take the default machine-specific action::
>   
>   	static nmi_callback_t nmi_callback = dummy_nmi_callback;
>   
>   This nmi_callback variable is a global function pointer to the current
> -NMI handler.::
> +NMI handler::
>   
>   	void do_nmi(struct pt_regs * regs, long error_code)
>   	{
> @@ -61,7 +61,7 @@ Quick Quiz:
>   
>   :ref:`Answer to Quick Quiz <answer_quick_quiz_NMI>`
>   
> -Back to the discussion of NMI and RCU...::
> +Back to the discussion of NMI and RCU::
>   
>   	void set_nmi_callback(nmi_callback_t callback)
>   	{
> 
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Linux-kernel-mentees] [PATCH] Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst.
  2019-11-05 14:02     ` Phong Tran
@ 2019-11-05 14:05       ` Paul E. McKenney
  0 siblings, 0 replies; 9+ messages in thread
From: Paul E. McKenney @ 2019-11-05 14:05 UTC (permalink / raw)
  To: Phong Tran
  Cc: corbet, linux-doc, linux-kernel, rcu, joel, linux-kernel-mentees

On Tue, Nov 05, 2019 at 09:02:46PM +0700, Phong Tran wrote:
> On 11/5/19 8:55 PM, Paul E. McKenney wrote:
> > On Tue, Nov 05, 2019 at 08:40:05PM +0700, Phong Tran wrote:
> > > On 10/29/19 4:42 AM, madhuparnabhowmik04@gmail.com wrote:
> > > > From: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
> > > > 
> > > > This patch converts NMI-RCU from txt to rst format.
> > > > Also adds NMI-RCU in the index.rst file.
> > > > 
> > > > Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
> > > > -- >   .../RCU/{NMI-RCU.txt => NMI-RCU.rst}          | 53 ++++++++++---------
> > > >    Documentation/RCU/index.rst                   |  1 +
> > > >    2 files changed, 29 insertions(+), 25 deletions(-)
> > > >    rename Documentation/RCU/{NMI-RCU.txt => NMI-RCU.rst} (73%)
> > > > 
> > > > diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.rst
> > > > similarity index 73%
> > > > rename from Documentation/RCU/NMI-RCU.txt
> > > > rename to Documentation/RCU/NMI-RCU.rst
> > > > index 881353fd5bff..da5861f6a433 100644
> > > > --- a/Documentation/RCU/NMI-RCU.txt
> > > > +++ b/Documentation/RCU/NMI-RCU.rst
> > > > @@ -1,4 +1,7 @@
> > > > +.. _NMI_rcu_doc:
> > > > +
> > > >    Using RCU to Protect Dynamic NMI Handlers
> > > > +=========================================
> > > >    Although RCU is usually used to protect read-mostly data structures,
> > > > @@ -9,7 +12,7 @@ work in "arch/x86/oprofile/nmi_timer_int.c" and in
> > > >    "arch/x86/kernel/traps.c".
> > > >    The relevant pieces of code are listed below, each followed by a
> > > > -brief explanation.
> > > > +brief explanation.::
> > > there is just a minor ":" redundant in html page.There are some same in this
> > > patch.
> > > eg:
> > >   brief explanation.:
> > > 
> > > Other things look good to me.
> > > 
> > > Tested-by: Phong Tran <tranmanphong@gmail.com>
> > 
> > Thank you, Phong!
> > 
> > I queued a commit to be squashed into Madhuparna's original as shown below
> > which adds your Tested-by and attempts a fix.  Does this work for you?
> 
> Yes, Paul.

Very good, thank you!

							Thanx, Paul

> Regards,
> Phong.
> 
> > 							Thanx, Paul
> > 
> > ------------------------------------------------------------------------
> > 
> > commit 2c29f1c481f74f5e5aaaab195042f4df6a0b8119
> > Author: Paul E. McKenney <paulmck@kernel.org>
> > Date:   Tue Nov 5 05:51:12 2019 -0800
> > 
> >      squash! Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst.
> >      [ paulmck: Apply feedback from Phong Tran. ]
> >      Tested-by: Phong Tran <tranmanphong@gmail.com>
> >      Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> > 
> > diff --git a/Documentation/RCU/NMI-RCU.rst b/Documentation/RCU/NMI-RCU.rst
> > index da5861f..1809583 100644
> > --- a/Documentation/RCU/NMI-RCU.rst
> > +++ b/Documentation/RCU/NMI-RCU.rst
> > @@ -12,7 +12,7 @@ work in "arch/x86/oprofile/nmi_timer_int.c" and in
> >   "arch/x86/kernel/traps.c".
> >   The relevant pieces of code are listed below, each followed by a
> > -brief explanation.::
> > +brief explanation::
> >   	static int dummy_nmi_callback(struct pt_regs *regs, int cpu)
> >   	{
> > @@ -21,12 +21,12 @@ brief explanation.::
> >   The dummy_nmi_callback() function is a "dummy" NMI handler that does
> >   nothing, but returns zero, thus saying that it did nothing, allowing
> > -the NMI handler to take the default machine-specific action.::
> > +the NMI handler to take the default machine-specific action::
> >   	static nmi_callback_t nmi_callback = dummy_nmi_callback;
> >   This nmi_callback variable is a global function pointer to the current
> > -NMI handler.::
> > +NMI handler::
> >   	void do_nmi(struct pt_regs * regs, long error_code)
> >   	{
> > @@ -61,7 +61,7 @@ Quick Quiz:
> >   :ref:`Answer to Quick Quiz <answer_quick_quiz_NMI>`
> > -Back to the discussion of NMI and RCU...::
> > +Back to the discussion of NMI and RCU::
> >   	void set_nmi_callback(nmi_callback_t callback)
> >   	{
> > 
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Linux-kernel-mentees] [PATCH] Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst.
  2019-11-05 13:55   ` Paul E. McKenney
  2019-11-05 14:02     ` Phong Tran
@ 2019-11-05 21:37     ` Madhuparna Bhowmik
  1 sibling, 0 replies; 9+ messages in thread
From: Madhuparna Bhowmik @ 2019-11-05 21:37 UTC (permalink / raw)
  To: paulmck
  Cc: corbet, linux-doc, linux-kernel, rcu, Joel Fernandes,
	linux-kernel-mentees

[-- Attachment #1.1: Type: text/plain, Size: 4065 bytes --]

On Tue, Nov 5, 2019 at 7:25 PM Paul E. McKenney <paulmck@kernel.org> wrote:

> On Tue, Nov 05, 2019 at 08:40:05PM +0700, Phong Tran wrote:
> > On 10/29/19 4:42 AM, madhuparnabhowmik04@gmail.com wrote:
> > > From: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
> > >
> > > This patch converts NMI-RCU from txt to rst format.
> > > Also adds NMI-RCU in the index.rst file.
> > >
> > > Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
> > > -- >   .../RCU/{NMI-RCU.txt => NMI-RCU.rst}          | 53
> ++++++++++---------
> > >   Documentation/RCU/index.rst                   |  1 +
> > >   2 files changed, 29 insertions(+), 25 deletions(-)
> > >   rename Documentation/RCU/{NMI-RCU.txt => NMI-RCU.rst} (73%)
> > >
> > > diff --git a/Documentation/RCU/NMI-RCU.txt
> b/Documentation/RCU/NMI-RCU.rst
> > > similarity index 73%
> > > rename from Documentation/RCU/NMI-RCU.txt
> > > rename to Documentation/RCU/NMI-RCU.rst
> > > index 881353fd5bff..da5861f6a433 100644
> > > --- a/Documentation/RCU/NMI-RCU.txt
> > > +++ b/Documentation/RCU/NMI-RCU.rst
> > > @@ -1,4 +1,7 @@
> > > +.. _NMI_rcu_doc:
> > > +
> > >   Using RCU to Protect Dynamic NMI Handlers
> > > +=========================================
> > >   Although RCU is usually used to protect read-mostly data structures,
> > > @@ -9,7 +12,7 @@ work in "arch/x86/oprofile/nmi_timer_int.c" and in
> > >   "arch/x86/kernel/traps.c".
> > >   The relevant pieces of code are listed below, each followed by a
> > > -brief explanation.
> > > +brief explanation.::
> > there is just a minor ":" redundant in html page.There are some same in
> this
> > patch.
> > eg:
> >  brief explanation.:
> >
> > Other things look good to me.
> >
> > Tested-by: Phong Tran <tranmanphong@gmail.com>
>
> Thank you, Phong!
>
> I queued a commit to be squashed into Madhuparna's original as shown below
> which adds your Tested-by and attempts a fix.  Does this work for you?
>
> Thank you, Paul, for improving my patch. I will do keep these things in
mind from next time and let me know if any other changes are required.

Regards
Madhuparna

>                                                         Thanx, Paul
>
> ------------------------------------------------------------------------
>
> commit 2c29f1c481f74f5e5aaaab195042f4df6a0b8119
> Author: Paul E. McKenney <paulmck@kernel.org>
> Date:   Tue Nov 5 05:51:12 2019 -0800
>
>     squash! Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to
> NMI-RCU.rst.
>
>     [ paulmck: Apply feedback from Phong Tran. ]
>     Tested-by: Phong Tran <tranmanphong@gmail.com>
>     Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
>
> diff --git a/Documentation/RCU/NMI-RCU.rst b/Documentation/RCU/NMI-RCU.rst
> index da5861f..1809583 100644
> --- a/Documentation/RCU/NMI-RCU.rst
> +++ b/Documentation/RCU/NMI-RCU.rst
> @@ -12,7 +12,7 @@ work in "arch/x86/oprofile/nmi_timer_int.c" and in
>  "arch/x86/kernel/traps.c".
>
>  The relevant pieces of code are listed below, each followed by a
> -brief explanation.::
> +brief explanation::
>
>         static int dummy_nmi_callback(struct pt_regs *regs, int cpu)
>         {
> @@ -21,12 +21,12 @@ brief explanation.::
>
>  The dummy_nmi_callback() function is a "dummy" NMI handler that does
>  nothing, but returns zero, thus saying that it did nothing, allowing
> -the NMI handler to take the default machine-specific action.::
> +the NMI handler to take the default machine-specific action::
>
>         static nmi_callback_t nmi_callback = dummy_nmi_callback;
>
>  This nmi_callback variable is a global function pointer to the current
> -NMI handler.::
> +NMI handler::
>
>         void do_nmi(struct pt_regs * regs, long error_code)
>         {
> @@ -61,7 +61,7 @@ Quick Quiz:
>
>  :ref:`Answer to Quick Quiz <answer_quick_quiz_NMI>`
>
> -Back to the discussion of NMI and RCU...::
> +Back to the discussion of NMI and RCU::
>
>         void set_nmi_callback(nmi_callback_t callback)
>         {
>
[-- Attachment #1.2: Type: text/html, Size: 5919 bytes --]

<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 5, 2019 at 7:25 PM Paul E. McKenney &lt;<a href="mailto:paulmck@kernel.org" target="_blank">paulmck@kernel.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Nov 05, 2019 at 08:40:05PM +0700, Phong Tran wrote:<br>
&gt; On 10/29/19 4:42 AM, <a href="mailto:madhuparnabhowmik04@gmail.com" target="_blank">madhuparnabhowmik04@gmail.com</a> wrote:<br>
&gt; &gt; From: Madhuparna Bhowmik &lt;<a href="mailto:madhuparnabhowmik04@gmail.com" target="_blank">madhuparnabhowmik04@gmail.com</a>&gt;<br>
&gt; &gt; <br>
&gt; &gt; This patch converts NMI-RCU from txt to rst format.<br>
&gt; &gt; Also adds NMI-RCU in the index.rst file.<br>
&gt; &gt; <br>
&gt; &gt; Signed-off-by: Madhuparna Bhowmik &lt;<a href="mailto:madhuparnabhowmik04@gmail.com" target="_blank">madhuparnabhowmik04@gmail.com</a>&gt;<br>
&gt; &gt; -- &gt;   .../RCU/{NMI-RCU.txt =&gt; NMI-RCU.rst}          | 53 ++++++++++---------<br>
&gt; &gt;   Documentation/RCU/index.rst                   |  1 +<br>
&gt; &gt;   2 files changed, 29 insertions(+), 25 deletions(-)<br>
&gt; &gt;   rename Documentation/RCU/{NMI-RCU.txt =&gt; NMI-RCU.rst} (73%)<br>
&gt; &gt; <br>
&gt; &gt; diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.rst<br>
&gt; &gt; similarity index 73%<br>
&gt; &gt; rename from Documentation/RCU/NMI-RCU.txt<br>
&gt; &gt; rename to Documentation/RCU/NMI-RCU.rst<br>
&gt; &gt; index 881353fd5bff..da5861f6a433 100644<br>
&gt; &gt; --- a/Documentation/RCU/NMI-RCU.txt<br>
&gt; &gt; +++ b/Documentation/RCU/NMI-RCU.rst<br>
&gt; &gt; @@ -1,4 +1,7 @@<br>
&gt; &gt; +.. _NMI_rcu_doc:<br>
&gt; &gt; +<br>
&gt; &gt;   Using RCU to Protect Dynamic NMI Handlers<br>
&gt; &gt; +=========================================<br>
&gt; &gt;   Although RCU is usually used to protect read-mostly data structures,<br>
&gt; &gt; @@ -9,7 +12,7 @@ work in &quot;arch/x86/oprofile/nmi_timer_int.c&quot; and in<br>
&gt; &gt;   &quot;arch/x86/kernel/traps.c&quot;.<br>
&gt; &gt;   The relevant pieces of code are listed below, each followed by a<br>
&gt; &gt; -brief explanation.<br>
&gt; &gt; +brief explanation.::<br>
&gt; there is just a minor &quot;:&quot; redundant in html page.There are some same in this<br>
&gt; patch.<br>
&gt; eg:<br>
&gt;  brief explanation.:<br>
&gt; <br>
&gt; Other things look good to me.<br>
&gt; <br>
&gt; Tested-by: Phong Tran &lt;<a href="mailto:tranmanphong@gmail.com" target="_blank">tranmanphong@gmail.com</a>&gt;<br>
<br>
Thank you, Phong!<br>
<br>
I queued a commit to be squashed into Madhuparna&#39;s original as shown below<br>
which adds your Tested-by and attempts a fix.  Does this work for you?<br>
<br></blockquote><div>Thank you, Paul, for improving my patch. I will do keep these things in mind from next time and let me know if any other changes are required.</div><div><br></div><div>Regards</div><div>Madhuparna</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                                                        Thanx, Paul<br>
<br>
------------------------------------------------------------------------<br>
<br>
commit 2c29f1c481f74f5e5aaaab195042f4df6a0b8119<br>
Author: Paul E. McKenney &lt;<a href="mailto:paulmck@kernel.org" target="_blank">paulmck@kernel.org</a>&gt;<br>
Date:   Tue Nov 5 05:51:12 2019 -0800<br>
<br>
    squash! Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst.<br>
<br>
    [ paulmck: Apply feedback from Phong Tran. ]<br>
    Tested-by: Phong Tran &lt;<a href="mailto:tranmanphong@gmail.com" target="_blank">tranmanphong@gmail.com</a>&gt;<br>
    Signed-off-by: Paul E. McKenney &lt;<a href="mailto:paulmck@kernel.org" target="_blank">paulmck@kernel.org</a>&gt;<br>
<br>
diff --git a/Documentation/RCU/NMI-RCU.rst b/Documentation/RCU/NMI-RCU.rst<br>
index da5861f..1809583 100644<br>
--- a/Documentation/RCU/NMI-RCU.rst<br>
+++ b/Documentation/RCU/NMI-RCU.rst<br>
@@ -12,7 +12,7 @@ work in &quot;arch/x86/oprofile/nmi_timer_int.c&quot; and in<br>
 &quot;arch/x86/kernel/traps.c&quot;.<br>
<br>
 The relevant pieces of code are listed below, each followed by a<br>
-brief explanation.::<br>
+brief explanation::<br>
<br>
        static int dummy_nmi_callback(struct pt_regs *regs, int cpu)<br>
        {<br>
@@ -21,12 +21,12 @@ brief explanation.::<br>
<br>
 The dummy_nmi_callback() function is a &quot;dummy&quot; NMI handler that does<br>
 nothing, but returns zero, thus saying that it did nothing, allowing<br>
-the NMI handler to take the default machine-specific action.::<br>
+the NMI handler to take the default machine-specific action::<br>
<br>
        static nmi_callback_t nmi_callback = dummy_nmi_callback;<br>
<br>
 This nmi_callback variable is a global function pointer to the current<br>
-NMI handler.::<br>
+NMI handler::<br>
<br>
        void do_nmi(struct pt_regs * regs, long error_code)<br>
        {<br>
@@ -61,7 +61,7 @@ Quick Quiz:<br>
<br>
 :ref:`Answer to Quick Quiz &lt;answer_quick_quiz_NMI&gt;`<br>
<br>
-Back to the discussion of NMI and RCU...::<br>
+Back to the discussion of NMI and RCU::<br>
<br>
        void set_nmi_callback(nmi_callback_t callback)<br>
        {<br>
</blockquote></div></div><div hspace="streak-pt-mark" style="max-height:1px"><img alt="" style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=abWFkaHVwYXJuYWJob3dtaWswNEBnbWFpbC5jb20%3D&amp;type=zerocontent&amp;guid=18c086ca-0d5e-430c-b41c-3e1f8c519496"><font color="#ffffff" size="1">ᐧ</font></div>

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, back to index

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-28 21:42 [Linux-kernel-mentees] [PATCH] Documentation: RCU: NMI-RCU: Converted NMI-RCU.txt to NMI-RCU.rst madhuparnabhowmik04 at gmail.com (madhuparnabhowmik04 at gmail.com)
2019-10-28 21:42 ` madhuparnabhowmik04 at gmail.com (madhuparnabhowmik04
2019-10-29 10:06 ` paulmck at kernel.org (Paul E. McKenney)
2019-10-29 10:06   ` paulmck
2019-11-05 13:40 ` Phong Tran
2019-11-05 13:55   ` Paul E. McKenney
2019-11-05 14:02     ` Phong Tran
2019-11-05 14:05       ` Paul E. McKenney
2019-11-05 21:37     ` Madhuparna Bhowmik

Linux Kernel Mentees Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-kernel-mentees/0 linux-kernel-mentees/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kernel-mentees linux-kernel-mentees/ https://lore.kernel.org/linux-kernel-mentees \
		linux-kernel-mentees@lists.linuxfoundation.org
	public-inbox-index linux-kernel-mentees

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxfoundation.lists.linux-kernel-mentees


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git