* [PATCH] Documentation/locking/locktypes: fix local_locks documentation
@ 2020-07-26 18:54 Marta Rybczynska
2020-08-21 11:53 ` Will Deacon
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Marta Rybczynska @ 2020-07-26 18:54 UTC (permalink / raw)
To: peterz, will, Jonathan Corbet, linux-kernel, linux-doc
Fix issues with local_locks documentation:
- fix function names, local_lock.h has local_unlock_irqrestore(),
not local_lock_irqrestore()
- fix mapping table, local_unlock_irqrestore() maps to local_irq_restore(),
not _save()
Signed-off-by: Marta Rybczynska <rybczynska@gmail.com>
---
Documentation/locking/locktypes.rst | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/Documentation/locking/locktypes.rst
b/Documentation/locking/locktypes.rst
index 1b577a8bf982..2a9c38bfdf16 100644
--- a/Documentation/locking/locktypes.rst
+++ b/Documentation/locking/locktypes.rst
@@ -164,14 +164,14 @@ by disabling preemption or interrupts.
On non-PREEMPT_RT kernels local_lock operations map to the preemption and
interrupt disabling and enabling primitives:
- =========================== ======================
- local_lock(&llock) preempt_disable()
- local_unlock(&llock) preempt_enable()
- local_lock_irq(&llock) local_irq_disable()
- local_unlock_irq(&llock) local_irq_enable()
- local_lock_save(&llock) local_irq_save()
- local_lock_restore(&llock) local_irq_save()
- =========================== ======================
+ =============================== ======================
+ local_lock(&llock) preempt_disable()
+ local_unlock(&llock) preempt_enable()
+ local_lock_irq(&llock) local_irq_disable()
+ local_unlock_irq(&llock) local_irq_enable()
+ local_lock_irqsave(&llock) local_irq_save()
+ local_unlock_irqrestore(&llock) local_irq_restore()
+ =============================== ======================
The named scope of local_lock has two advantages over the regular
primitives:
@@ -353,14 +353,14 @@ protection scope. So the following substitution is wrong::
{
local_irq_save(flags); -> local_lock_irqsave(&local_lock_1, flags);
func3();
- local_irq_restore(flags); -> local_lock_irqrestore(&local_lock_1, flags);
+ local_irq_restore(flags); -> local_unlock_irqrestore(&local_lock_1, flags);
}
func2()
{
local_irq_save(flags); -> local_lock_irqsave(&local_lock_2, flags);
func3();
- local_irq_restore(flags); -> local_lock_irqrestore(&local_lock_2, flags);
+ local_irq_restore(flags); -> local_unlock_irqrestore(&local_lock_2, flags);
}
func3()
@@ -379,14 +379,14 @@ PREEMPT_RT-specific semantics of spinlock_t. The
correct substitution is::
{
local_irq_save(flags); -> local_lock_irqsave(&local_lock, flags);
func3();
- local_irq_restore(flags); -> local_lock_irqrestore(&local_lock, flags);
+ local_irq_restore(flags); -> local_unlock_irqrestore(&local_lock, flags);
}
func2()
{
local_irq_save(flags); -> local_lock_irqsave(&local_lock, flags);
func3();
- local_irq_restore(flags); -> local_lock_irqrestore(&local_lock, flags);
+ local_irq_restore(flags); -> local_unlock_irqrestore(&local_lock, flags);
}
func3()
--
2.27.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Documentation/locking/locktypes: fix local_locks documentation
2020-07-26 18:54 [PATCH] Documentation/locking/locktypes: fix local_locks documentation Marta Rybczynska
@ 2020-08-21 11:53 ` Will Deacon
2020-08-24 21:56 ` Jonathan Corbet
2020-08-27 7:54 ` [tip: locking/core] Documentation/locking/locktypes: Fix " tip-bot2 for Marta Rybczynska
2 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2020-08-21 11:53 UTC (permalink / raw)
To: Marta Rybczynska; +Cc: peterz, Jonathan Corbet, linux-kernel, linux-doc
On Sun, Jul 26, 2020 at 08:54:40PM +0200, Marta Rybczynska wrote:
> Fix issues with local_locks documentation:
> - fix function names, local_lock.h has local_unlock_irqrestore(),
> not local_lock_irqrestore()
> - fix mapping table, local_unlock_irqrestore() maps to local_irq_restore(),
> not _save()
>
> Signed-off-by: Marta Rybczynska <rybczynska@gmail.com>
> ---
> Documentation/locking/locktypes.rst | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
Looks correct to me, thanks:
Acked-by: Will Deacon <will@kernel.org>
Will
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Documentation/locking/locktypes: fix local_locks documentation
2020-07-26 18:54 [PATCH] Documentation/locking/locktypes: fix local_locks documentation Marta Rybczynska
2020-08-21 11:53 ` Will Deacon
@ 2020-08-24 21:56 ` Jonathan Corbet
2020-08-27 7:54 ` [tip: locking/core] Documentation/locking/locktypes: Fix " tip-bot2 for Marta Rybczynska
2 siblings, 0 replies; 4+ messages in thread
From: Jonathan Corbet @ 2020-08-24 21:56 UTC (permalink / raw)
To: Marta Rybczynska; +Cc: peterz, will, linux-kernel, linux-doc
On Sun, 26 Jul 2020 20:54:40 +0200
Marta Rybczynska <rybczynska@gmail.com> wrote:
> Fix issues with local_locks documentation:
> - fix function names, local_lock.h has local_unlock_irqrestore(),
> not local_lock_irqrestore()
> - fix mapping table, local_unlock_irqrestore() maps to local_irq_restore(),
> not _save()
>
> Signed-off-by: Marta Rybczynska <rybczynska@gmail.com>
> ---
> Documentation/locking/locktypes.rst | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
Applied (finally). I had to fix some mailer-inflicted line wrapping
before the patch would apply...
jon
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip: locking/core] Documentation/locking/locktypes: Fix local_locks documentation
2020-07-26 18:54 [PATCH] Documentation/locking/locktypes: fix local_locks documentation Marta Rybczynska
2020-08-21 11:53 ` Will Deacon
2020-08-24 21:56 ` Jonathan Corbet
@ 2020-08-27 7:54 ` tip-bot2 for Marta Rybczynska
2 siblings, 0 replies; 4+ messages in thread
From: tip-bot2 for Marta Rybczynska @ 2020-08-27 7:54 UTC (permalink / raw)
To: linux-tip-commits
Cc: Marta Rybczynska, Peter Zijlstra (Intel), Will Deacon, x86, LKML
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 92b4e9f11a636d1723cc0866bf8b9111b1e24339
Gitweb: https://git.kernel.org/tip/92b4e9f11a636d1723cc0866bf8b9111b1e24339
Author: Marta Rybczynska <rybczynska@gmail.com>
AuthorDate: Sun, 26 Jul 2020 20:54:40 +02:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 26 Aug 2020 12:42:02 +02:00
Documentation/locking/locktypes: Fix local_locks documentation
Fix issues with local_locks documentation:
- fix function names, local_lock.h has local_unlock_irqrestore(), not
local_lock_irqrestore()
- fix mapping table, local_unlock_irqrestore() maps to
local_irq_restore(), not _save()
Signed-off-by: Marta Rybczynska <rybczynska@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lkml.kernel.org/r/CAApg2=SKxQ3Sqwj6TZnV-0x0cKLXFKDaPvXT4N15MPDMKq724g@mail.gmail.com
---
Documentation/locking/locktypes.rst | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/Documentation/locking/locktypes.rst b/Documentation/locking/locktypes.rst
index 4cefed8..ddada4a 100644
--- a/Documentation/locking/locktypes.rst
+++ b/Documentation/locking/locktypes.rst
@@ -164,14 +164,14 @@ by disabling preemption or interrupts.
On non-PREEMPT_RT kernels local_lock operations map to the preemption and
interrupt disabling and enabling primitives:
- =========================== ======================
- local_lock(&llock) preempt_disable()
- local_unlock(&llock) preempt_enable()
- local_lock_irq(&llock) local_irq_disable()
- local_unlock_irq(&llock) local_irq_enable()
- local_lock_save(&llock) local_irq_save()
- local_lock_restore(&llock) local_irq_save()
- =========================== ======================
+ =============================== ======================
+ local_lock(&llock) preempt_disable()
+ local_unlock(&llock) preempt_enable()
+ local_lock_irq(&llock) local_irq_disable()
+ local_unlock_irq(&llock) local_irq_enable()
+ local_lock_irqsave(&llock) local_irq_save()
+ local_unlock_irqrestore(&llock) local_irq_restore()
+ =============================== ======================
The named scope of local_lock has two advantages over the regular
primitives:
@@ -353,14 +353,14 @@ protection scope. So the following substitution is wrong::
{
local_irq_save(flags); -> local_lock_irqsave(&local_lock_1, flags);
func3();
- local_irq_restore(flags); -> local_lock_irqrestore(&local_lock_1, flags);
+ local_irq_restore(flags); -> local_unlock_irqrestore(&local_lock_1, flags);
}
func2()
{
local_irq_save(flags); -> local_lock_irqsave(&local_lock_2, flags);
func3();
- local_irq_restore(flags); -> local_lock_irqrestore(&local_lock_2, flags);
+ local_irq_restore(flags); -> local_unlock_irqrestore(&local_lock_2, flags);
}
func3()
@@ -379,14 +379,14 @@ PREEMPT_RT-specific semantics of spinlock_t. The correct substitution is::
{
local_irq_save(flags); -> local_lock_irqsave(&local_lock, flags);
func3();
- local_irq_restore(flags); -> local_lock_irqrestore(&local_lock, flags);
+ local_irq_restore(flags); -> local_unlock_irqrestore(&local_lock, flags);
}
func2()
{
local_irq_save(flags); -> local_lock_irqsave(&local_lock, flags);
func3();
- local_irq_restore(flags); -> local_lock_irqrestore(&local_lock, flags);
+ local_irq_restore(flags); -> local_unlock_irqrestore(&local_lock, flags);
}
func3()
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-08-27 7:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-26 18:54 [PATCH] Documentation/locking/locktypes: fix local_locks documentation Marta Rybczynska
2020-08-21 11:53 ` Will Deacon
2020-08-24 21:56 ` Jonathan Corbet
2020-08-27 7:54 ` [tip: locking/core] Documentation/locking/locktypes: Fix " tip-bot2 for Marta Rybczynska
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).