* [Linux-kernel-mentees] [PATCH] doc: RCU callback locks need only _bh, not necessarily _irq
@ 2019-06-27 22:10 ` paulmck
0 siblings, 0 replies; 21+ messages in thread
From: Paul E. McKenney @ 2019-06-27 22:10 UTC (permalink / raw)
On Thu, Jun 27, 2019 at 04:01:35PM -0600, Shuah Khan wrote:
> On 6/27/19 3:01 PM, Jiunn Chang wrote:
> >The UP.rst file calls for locks acquired within RCU callback functions
> >to use _irq variants (spin_lock_irqsave() or similar), which does work,
> >but can be overkill. This commit therefore instead calls for _bh variants
> >(spin_lock_bh() or similar), while noting that _irq does work.
> >
> >Signed-off-by: Paul E. McKenney <paulmck at linux.ibm.com>
>
> Should this by Suggested-by?
I wrote it and Jiunn converted my change to .rst, so I believe that
this is correct as is.
Thanx, Paul
> >Signed-off-by: Jiunn Chang <c0d1n61at3 at gmail.com>
> >---
> > Documentation/RCU/UP.rst | 13 +++++++------
> > 1 file changed, 7 insertions(+), 6 deletions(-)
> >
> >diff --git a/Documentation/RCU/UP.rst b/Documentation/RCU/UP.rst
> >index 67715a47ae89..e26dda27430c 100644
> >--- a/Documentation/RCU/UP.rst
> >+++ b/Documentation/RCU/UP.rst
> >@@ -113,12 +113,13 @@ Answer to Quick Quiz #1:
> > Answer to Quick Quiz #2:
> > What locking restriction must RCU callbacks respect?
> >- Any lock that is acquired within an RCU callback must be
> >- acquired elsewhere using an _irq variant of the spinlock
> >- primitive. For example, if "mylock" is acquired by an
> >- RCU callback, then a process-context acquisition of this
> >- lock must use something like spin_lock_irqsave() to
> >- acquire the lock.
> >+ Any lock that is acquired within an RCU callback must be acquired
> >+ elsewhere using an _bh variant of the spinlock primitive.
> >+ For example, if "mylock" is acquired by an RCU callback, then
> >+ a process-context acquisition of this lock must use something
> >+ like spin_lock_bh() to acquire the lock. Please note that
> >+ it is also OK to use _irq variants of spinlocks, for example,
> >+ spin_lock_irqsave().
> > If the process-context code were to simply use spin_lock(),
> > then, since RCU callbacks can be invoked from softirq context,
> >
>
> thanks,
> -- Shuah
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Linux-kernel-mentees] [PATCH] doc: RCU callback locks need only _bh, not necessarily _irq
@ 2019-06-27 22:10 ` paulmck
0 siblings, 0 replies; 21+ messages in thread
From: paulmck @ 2019-06-27 22:10 UTC (permalink / raw)
On Thu, Jun 27, 2019 at 04:01:35PM -0600, Shuah Khan wrote:
> On 6/27/19 3:01 PM, Jiunn Chang wrote:
> >The UP.rst file calls for locks acquired within RCU callback functions
> >to use _irq variants (spin_lock_irqsave() or similar), which does work,
> >but can be overkill. This commit therefore instead calls for _bh variants
> >(spin_lock_bh() or similar), while noting that _irq does work.
> >
> >Signed-off-by: Paul E. McKenney <paulmck at linux.ibm.com>
>
> Should this by Suggested-by?
I wrote it and Jiunn converted my change to .rst, so I believe that
this is correct as is.
Thanx, Paul
> >Signed-off-by: Jiunn Chang <c0d1n61at3 at gmail.com>
> >---
> > Documentation/RCU/UP.rst | 13 +++++++------
> > 1 file changed, 7 insertions(+), 6 deletions(-)
> >
> >diff --git a/Documentation/RCU/UP.rst b/Documentation/RCU/UP.rst
> >index 67715a47ae89..e26dda27430c 100644
> >--- a/Documentation/RCU/UP.rst
> >+++ b/Documentation/RCU/UP.rst
> >@@ -113,12 +113,13 @@ Answer to Quick Quiz #1:
> > Answer to Quick Quiz #2:
> > What locking restriction must RCU callbacks respect?
> >- Any lock that is acquired within an RCU callback must be
> >- acquired elsewhere using an _irq variant of the spinlock
> >- primitive. For example, if "mylock" is acquired by an
> >- RCU callback, then a process-context acquisition of this
> >- lock must use something like spin_lock_irqsave() to
> >- acquire the lock.
> >+ Any lock that is acquired within an RCU callback must be acquired
> >+ elsewhere using an _bh variant of the spinlock primitive.
> >+ For example, if "mylock" is acquired by an RCU callback, then
> >+ a process-context acquisition of this lock must use something
> >+ like spin_lock_bh() to acquire the lock. Please note that
> >+ it is also OK to use _irq variants of spinlocks, for example,
> >+ spin_lock_irqsave().
> > If the process-context code were to simply use spin_lock(),
> > then, since RCU callbacks can be invoked from softirq context,
> >
>
> thanks,
> -- Shuah
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Linux-kernel-mentees][PATCH] doc: RCU callback locks need only _bh, not necessarily _irq
2019-06-27 22:10 ` paulmck
(?)
@ 2019-06-27 22:11 ` skhan
-1 siblings, 0 replies; 21+ messages in thread
From: Shuah Khan @ 2019-06-27 22:11 UTC (permalink / raw)
To: paulmck
Cc: Jiunn Chang, linux-kernel-mentees, josh, rostedt,
mathieu.desnoyers, jiangshanlai, joel, corbet, rcu, linux-doc,
linux-kernel, skh >> Shuah Khan
On 6/27/19 4:10 PM, Paul E. McKenney wrote:
> On Thu, Jun 27, 2019 at 04:01:35PM -0600, Shuah Khan wrote:
>> On 6/27/19 3:01 PM, Jiunn Chang wrote:
>>> The UP.rst file calls for locks acquired within RCU callback functions
>>> to use _irq variants (spin_lock_irqsave() or similar), which does work,
>>> but can be overkill. This commit therefore instead calls for _bh variants
>>> (spin_lock_bh() or similar), while noting that _irq does work.
>>>
>>> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
>>
>> Should this by Suggested-by?
>
> I wrote it and Jiunn converted my change to .rst, so I believe that
> this is correct as is.
>
Great.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Linux-kernel-mentees] [PATCH] doc: RCU callback locks need only _bh, not necessarily _irq
@ 2019-06-27 22:11 ` skhan
0 siblings, 0 replies; 21+ messages in thread
From: Shuah Khan @ 2019-06-27 22:11 UTC (permalink / raw)
On 6/27/19 4:10 PM, Paul E. McKenney wrote:
> On Thu, Jun 27, 2019 at 04:01:35PM -0600, Shuah Khan wrote:
>> On 6/27/19 3:01 PM, Jiunn Chang wrote:
>>> The UP.rst file calls for locks acquired within RCU callback functions
>>> to use _irq variants (spin_lock_irqsave() or similar), which does work,
>>> but can be overkill. This commit therefore instead calls for _bh variants
>>> (spin_lock_bh() or similar), while noting that _irq does work.
>>>
>>> Signed-off-by: Paul E. McKenney <paulmck at linux.ibm.com>
>>
>> Should this by Suggested-by?
>
> I wrote it and Jiunn converted my change to .rst, so I believe that
> this is correct as is.
>
Great.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Linux-kernel-mentees] [PATCH] doc: RCU callback locks need only _bh, not necessarily _irq
@ 2019-06-27 22:11 ` skhan
0 siblings, 0 replies; 21+ messages in thread
From: skhan @ 2019-06-27 22:11 UTC (permalink / raw)
On 6/27/19 4:10 PM, Paul E. McKenney wrote:
> On Thu, Jun 27, 2019 at 04:01:35PM -0600, Shuah Khan wrote:
>> On 6/27/19 3:01 PM, Jiunn Chang wrote:
>>> The UP.rst file calls for locks acquired within RCU callback functions
>>> to use _irq variants (spin_lock_irqsave() or similar), which does work,
>>> but can be overkill. This commit therefore instead calls for _bh variants
>>> (spin_lock_bh() or similar), while noting that _irq does work.
>>>
>>> Signed-off-by: Paul E. McKenney <paulmck at linux.ibm.com>
>>
>> Should this by Suggested-by?
>
> I wrote it and Jiunn converted my change to .rst, so I believe that
> this is correct as is.
>
Great.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Linux-kernel-mentees][PATCH] doc: RCU callback locks need only _bh, not necessarily _irq
2019-06-27 22:10 ` paulmck
(?)
@ 2019-06-27 22:29 ` rostedt
-1 siblings, 0 replies; 21+ messages in thread
From: Steven Rostedt @ 2019-06-27 22:29 UTC (permalink / raw)
To: Paul E. McKenney
Cc: Shuah Khan, Jiunn Chang, linux-kernel-mentees, josh,
mathieu.desnoyers, jiangshanlai, joel, corbet, rcu, linux-doc,
linux-kernel
On Thu, 27 Jun 2019 15:10:45 -0700
"Paul E. McKenney" <paulmck@linux.ibm.com> wrote:
> On Thu, Jun 27, 2019 at 04:01:35PM -0600, Shuah Khan wrote:
> > On 6/27/19 3:01 PM, Jiunn Chang wrote:
> > >The UP.rst file calls for locks acquired within RCU callback functions
> > >to use _irq variants (spin_lock_irqsave() or similar), which does work,
> > >but can be overkill. This commit therefore instead calls for _bh variants
> > >(spin_lock_bh() or similar), while noting that _irq does work.
> > >
> > >Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
> >
> > Should this by Suggested-by?
>
> I wrote it and Jiunn converted my change to .rst, so I believe that
> this is correct as is.
Note, you did send Jiunn an explicit Signed-off-by when you wrote it,
correct? As Signed-off-by is equivalent to a signature.
-- Steve
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Linux-kernel-mentees] [PATCH] doc: RCU callback locks need only _bh, not necessarily _irq
@ 2019-06-27 22:29 ` rostedt
0 siblings, 0 replies; 21+ messages in thread
From: Steven Rostedt @ 2019-06-27 22:29 UTC (permalink / raw)
On Thu, 27 Jun 2019 15:10:45 -0700
"Paul E. McKenney" <paulmck at linux.ibm.com> wrote:
> On Thu, Jun 27, 2019 at 04:01:35PM -0600, Shuah Khan wrote:
> > On 6/27/19 3:01 PM, Jiunn Chang wrote:
> > >The UP.rst file calls for locks acquired within RCU callback functions
> > >to use _irq variants (spin_lock_irqsave() or similar), which does work,
> > >but can be overkill. This commit therefore instead calls for _bh variants
> > >(spin_lock_bh() or similar), while noting that _irq does work.
> > >
> > >Signed-off-by: Paul E. McKenney <paulmck at linux.ibm.com>
> >
> > Should this by Suggested-by?
>
> I wrote it and Jiunn converted my change to .rst, so I believe that
> this is correct as is.
Note, you did send Jiunn an explicit Signed-off-by when you wrote it,
correct? As Signed-off-by is equivalent to a signature.
-- Steve
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Linux-kernel-mentees] [PATCH] doc: RCU callback locks need only _bh, not necessarily _irq
@ 2019-06-27 22:29 ` rostedt
0 siblings, 0 replies; 21+ messages in thread
From: rostedt @ 2019-06-27 22:29 UTC (permalink / raw)
On Thu, 27 Jun 2019 15:10:45 -0700
"Paul E. McKenney" <paulmck at linux.ibm.com> wrote:
> On Thu, Jun 27, 2019 at 04:01:35PM -0600, Shuah Khan wrote:
> > On 6/27/19 3:01 PM, Jiunn Chang wrote:
> > >The UP.rst file calls for locks acquired within RCU callback functions
> > >to use _irq variants (spin_lock_irqsave() or similar), which does work,
> > >but can be overkill. This commit therefore instead calls for _bh variants
> > >(spin_lock_bh() or similar), while noting that _irq does work.
> > >
> > >Signed-off-by: Paul E. McKenney <paulmck at linux.ibm.com>
> >
> > Should this by Suggested-by?
>
> I wrote it and Jiunn converted my change to .rst, so I believe that
> this is correct as is.
Note, you did send Jiunn an explicit Signed-off-by when you wrote it,
correct? As Signed-off-by is equivalent to a signature.
-- Steve
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Linux-kernel-mentees][PATCH] doc: RCU callback locks need only _bh, not necessarily _irq
2019-06-27 22:29 ` rostedt
(?)
@ 2019-06-27 22:42 ` paulmck
-1 siblings, 0 replies; 21+ messages in thread
From: Paul E. McKenney @ 2019-06-27 22:42 UTC (permalink / raw)
To: Steven Rostedt
Cc: Shuah Khan, Jiunn Chang, linux-kernel-mentees, josh,
mathieu.desnoyers, jiangshanlai, joel, corbet, rcu, linux-doc,
linux-kernel
On Thu, Jun 27, 2019 at 06:29:38PM -0400, Steven Rostedt wrote:
> On Thu, 27 Jun 2019 15:10:45 -0700
> "Paul E. McKenney" <paulmck@linux.ibm.com> wrote:
>
> > On Thu, Jun 27, 2019 at 04:01:35PM -0600, Shuah Khan wrote:
> > > On 6/27/19 3:01 PM, Jiunn Chang wrote:
> > > >The UP.rst file calls for locks acquired within RCU callback functions
> > > >to use _irq variants (spin_lock_irqsave() or similar), which does work,
> > > >but can be overkill. This commit therefore instead calls for _bh variants
> > > >(spin_lock_bh() or similar), while noting that _irq does work.
> > > >
> > > >Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
> > >
> > > Should this by Suggested-by?
> >
> > I wrote it and Jiunn converted my change to .rst, so I believe that
> > this is correct as is.
>
> Note, you did send Jiunn an explicit Signed-off-by when you wrote it,
> correct? As Signed-off-by is equivalent to a signature.
Indeed I did, but I now see that it was via private email. Here it is
again for public consumption, and Jiunn's patch is based on this one,
just translated to .rst. I once again verified that the Jiunn's version
is word-for-word identical to mine, so Jiunn's patch should be good. ;-)
Thanx, Paul
------------------------------------------------------------------------
commit a293734a310b463a0dba68409943a4e6065cd39d
Author: Paul E. McKenney <paulmck@linux.ibm.com>
Date: Wed Jun 26 10:16:19 2019 -0700
doc: RCU callback locks need only _bh, not necessarily _irq
The UP.txt file calls for locks acquired within RCU callback functions
to use _irq variants (spin_lock_irqsave() or similar), which does work,
but can be overkill. This commit therefore instead calls for _bh variants
(spin_lock_bh() or similar), while noting that _irq does work.
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
diff --git a/Documentation/RCU/UP.txt b/Documentation/RCU/UP.txt
index 53bde717017b..0edd8c5af0b5 100644
--- a/Documentation/RCU/UP.txt
+++ b/Documentation/RCU/UP.txt
@@ -104,12 +104,13 @@ Answer to Quick Quiz #1:
Answer to Quick Quiz #2:
What locking restriction must RCU callbacks respect?
- Any lock that is acquired within an RCU callback must be
- acquired elsewhere using an _irq variant of the spinlock
- primitive. For example, if "mylock" is acquired by an
- RCU callback, then a process-context acquisition of this
- lock must use something like spin_lock_irqsave() to
- acquire the lock.
+ Any lock that is acquired within an RCU callback must be acquired
+ elsewhere using an _bh variant of the spinlock primitive.
+ For example, if "mylock" is acquired by an RCU callback, then
+ a process-context acquisition of this lock must use something
+ like spin_lock_bh() to acquire the lock. Please note that
+ it is also OK to use _irq variants of spinlocks, for example,
+ spin_lock_irqsave().
If the process-context code were to simply use spin_lock(),
then, since RCU callbacks can be invoked from softirq context,
^ permalink raw reply related [flat|nested] 21+ messages in thread* [Linux-kernel-mentees] [PATCH] doc: RCU callback locks need only _bh, not necessarily _irq
@ 2019-06-27 22:42 ` paulmck
0 siblings, 0 replies; 21+ messages in thread
From: Paul E. McKenney @ 2019-06-27 22:42 UTC (permalink / raw)
On Thu, Jun 27, 2019 at 06:29:38PM -0400, Steven Rostedt wrote:
> On Thu, 27 Jun 2019 15:10:45 -0700
> "Paul E. McKenney" <paulmck at linux.ibm.com> wrote:
>
> > On Thu, Jun 27, 2019 at 04:01:35PM -0600, Shuah Khan wrote:
> > > On 6/27/19 3:01 PM, Jiunn Chang wrote:
> > > >The UP.rst file calls for locks acquired within RCU callback functions
> > > >to use _irq variants (spin_lock_irqsave() or similar), which does work,
> > > >but can be overkill. This commit therefore instead calls for _bh variants
> > > >(spin_lock_bh() or similar), while noting that _irq does work.
> > > >
> > > >Signed-off-by: Paul E. McKenney <paulmck at linux.ibm.com>
> > >
> > > Should this by Suggested-by?
> >
> > I wrote it and Jiunn converted my change to .rst, so I believe that
> > this is correct as is.
>
> Note, you did send Jiunn an explicit Signed-off-by when you wrote it,
> correct? As Signed-off-by is equivalent to a signature.
Indeed I did, but I now see that it was via private email. Here it is
again for public consumption, and Jiunn's patch is based on this one,
just translated to .rst. I once again verified that the Jiunn's version
is word-for-word identical to mine, so Jiunn's patch should be good. ;-)
Thanx, Paul
------------------------------------------------------------------------
commit a293734a310b463a0dba68409943a4e6065cd39d
Author: Paul E. McKenney <paulmck at linux.ibm.com>
Date: Wed Jun 26 10:16:19 2019 -0700
doc: RCU callback locks need only _bh, not necessarily _irq
The UP.txt file calls for locks acquired within RCU callback functions
to use _irq variants (spin_lock_irqsave() or similar), which does work,
but can be overkill. This commit therefore instead calls for _bh variants
(spin_lock_bh() or similar), while noting that _irq does work.
Signed-off-by: Paul E. McKenney <paulmck at linux.ibm.com>
diff --git a/Documentation/RCU/UP.txt b/Documentation/RCU/UP.txt
index 53bde717017b..0edd8c5af0b5 100644
--- a/Documentation/RCU/UP.txt
+++ b/Documentation/RCU/UP.txt
@@ -104,12 +104,13 @@ Answer to Quick Quiz #1:
Answer to Quick Quiz #2:
What locking restriction must RCU callbacks respect?
- Any lock that is acquired within an RCU callback must be
- acquired elsewhere using an _irq variant of the spinlock
- primitive. For example, if "mylock" is acquired by an
- RCU callback, then a process-context acquisition of this
- lock must use something like spin_lock_irqsave() to
- acquire the lock.
+ Any lock that is acquired within an RCU callback must be acquired
+ elsewhere using an _bh variant of the spinlock primitive.
+ For example, if "mylock" is acquired by an RCU callback, then
+ a process-context acquisition of this lock must use something
+ like spin_lock_bh() to acquire the lock. Please note that
+ it is also OK to use _irq variants of spinlocks, for example,
+ spin_lock_irqsave().
If the process-context code were to simply use spin_lock(),
then, since RCU callbacks can be invoked from softirq context,
^ permalink raw reply related [flat|nested] 21+ messages in thread* [Linux-kernel-mentees] [PATCH] doc: RCU callback locks need only _bh, not necessarily _irq
@ 2019-06-27 22:42 ` paulmck
0 siblings, 0 replies; 21+ messages in thread
From: paulmck @ 2019-06-27 22:42 UTC (permalink / raw)
On Thu, Jun 27, 2019 at 06:29:38PM -0400, Steven Rostedt wrote:
> On Thu, 27 Jun 2019 15:10:45 -0700
> "Paul E. McKenney" <paulmck at linux.ibm.com> wrote:
>
> > On Thu, Jun 27, 2019 at 04:01:35PM -0600, Shuah Khan wrote:
> > > On 6/27/19 3:01 PM, Jiunn Chang wrote:
> > > >The UP.rst file calls for locks acquired within RCU callback functions
> > > >to use _irq variants (spin_lock_irqsave() or similar), which does work,
> > > >but can be overkill. This commit therefore instead calls for _bh variants
> > > >(spin_lock_bh() or similar), while noting that _irq does work.
> > > >
> > > >Signed-off-by: Paul E. McKenney <paulmck at linux.ibm.com>
> > >
> > > Should this by Suggested-by?
> >
> > I wrote it and Jiunn converted my change to .rst, so I believe that
> > this is correct as is.
>
> Note, you did send Jiunn an explicit Signed-off-by when you wrote it,
> correct? As Signed-off-by is equivalent to a signature.
Indeed I did, but I now see that it was via private email. Here it is
again for public consumption, and Jiunn's patch is based on this one,
just translated to .rst. I once again verified that the Jiunn's version
is word-for-word identical to mine, so Jiunn's patch should be good. ;-)
Thanx, Paul
------------------------------------------------------------------------
commit a293734a310b463a0dba68409943a4e6065cd39d
Author: Paul E. McKenney <paulmck at linux.ibm.com>
Date: Wed Jun 26 10:16:19 2019 -0700
doc: RCU callback locks need only _bh, not necessarily _irq
The UP.txt file calls for locks acquired within RCU callback functions
to use _irq variants (spin_lock_irqsave() or similar), which does work,
but can be overkill. This commit therefore instead calls for _bh variants
(spin_lock_bh() or similar), while noting that _irq does work.
Signed-off-by: Paul E. McKenney <paulmck at linux.ibm.com>
diff --git a/Documentation/RCU/UP.txt b/Documentation/RCU/UP.txt
index 53bde717017b..0edd8c5af0b5 100644
--- a/Documentation/RCU/UP.txt
+++ b/Documentation/RCU/UP.txt
@@ -104,12 +104,13 @@ Answer to Quick Quiz #1:
Answer to Quick Quiz #2:
What locking restriction must RCU callbacks respect?
- Any lock that is acquired within an RCU callback must be
- acquired elsewhere using an _irq variant of the spinlock
- primitive. For example, if "mylock" is acquired by an
- RCU callback, then a process-context acquisition of this
- lock must use something like spin_lock_irqsave() to
- acquire the lock.
+ Any lock that is acquired within an RCU callback must be acquired
+ elsewhere using an _bh variant of the spinlock primitive.
+ For example, if "mylock" is acquired by an RCU callback, then
+ a process-context acquisition of this lock must use something
+ like spin_lock_bh() to acquire the lock. Please note that
+ it is also OK to use _irq variants of spinlocks, for example,
+ spin_lock_irqsave().
If the process-context code were to simply use spin_lock(),
then, since RCU callbacks can be invoked from softirq context,
^ permalink raw reply related [flat|nested] 21+ messages in thread