All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* locking/mutex: Fix non debug version of mutex_lock_io_nested()
@ 2021-03-22  8:46 Thomas Gleixner
  2021-03-22  9:01 ` Peter Zijlstra
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Gleixner @ 2021-03-22  8:46 UTC (permalink / raw
  To: LKML; +Cc: Peter Zijlstra, Ingo Molnar, Will Deacon, Waiman Long, Boqun Feng

If CONFIG_DEBUG_LOCK_ALLOC=n then mutex_lock_io_nested() maps to
mutex_lock() which is clearly wrong because mutex_lock() lacks the
io_schedule_prepare()/finish() invocations.

Map it to mutex_lock_io().

Fixes: f21860bac05b ("locking/mutex, sched/wait: Fix the mutex_lock_io_nested() define")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
---
 include/linux/mutex.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -185,7 +185,7 @@ extern void mutex_lock_io(struct mutex *
 # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
 # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock)
 # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock)
-# define mutex_lock_io_nested(lock, subclass) mutex_lock(lock)
+# define mutex_lock_io_nested(lock, subclass) mutex_lock_io(lock)
 #endif
 
 /*

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

* Re: locking/mutex: Fix non debug version of mutex_lock_io_nested()
  2021-03-22  8:46 locking/mutex: Fix non debug version of mutex_lock_io_nested() Thomas Gleixner
@ 2021-03-22  9:01 ` Peter Zijlstra
  2021-03-23  8:16 ` [tip: locking/core] " tip-bot2 for Thomas Gleixner
  2021-03-23 11:25 ` [tip: locking/urgent] " tip-bot2 for Thomas Gleixner
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Zijlstra @ 2021-03-22  9:01 UTC (permalink / raw
  To: Thomas Gleixner; +Cc: LKML, Ingo Molnar, Will Deacon, Waiman Long, Boqun Feng

On Mon, Mar 22, 2021 at 09:46:13AM +0100, Thomas Gleixner wrote:
> If CONFIG_DEBUG_LOCK_ALLOC=n then mutex_lock_io_nested() maps to
> mutex_lock() which is clearly wrong because mutex_lock() lacks the
> io_schedule_prepare()/finish() invocations.
> 
> Map it to mutex_lock_io().

Thanks!

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

* [tip: locking/core] locking/mutex: Fix non debug version of mutex_lock_io_nested()
  2021-03-22  8:46 locking/mutex: Fix non debug version of mutex_lock_io_nested() Thomas Gleixner
  2021-03-22  9:01 ` Peter Zijlstra
@ 2021-03-23  8:16 ` tip-bot2 for Thomas Gleixner
  2021-03-23 11:25 ` [tip: locking/urgent] " tip-bot2 for Thomas Gleixner
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot2 for Thomas Gleixner @ 2021-03-23  8:16 UTC (permalink / raw
  To: linux-tip-commits
  Cc: Thomas Gleixner, Peter Zijlstra (Intel), stable, x86,
	linux-kernel

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     ebdbd41bf2536ac57bf315ce9690245e08c5e506
Gitweb:        https://git.kernel.org/tip/ebdbd41bf2536ac57bf315ce9690245e08c5e506
Author:        Thomas Gleixner <tglx@linutronix.de>
AuthorDate:    Mon, 22 Mar 2021 09:46:13 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Mon, 22 Mar 2021 21:43:57 +01:00

locking/mutex: Fix non debug version of mutex_lock_io_nested()

If CONFIG_DEBUG_LOCK_ALLOC=n then mutex_lock_io_nested() maps to
mutex_lock() which is clearly wrong because mutex_lock() lacks the
io_schedule_prepare()/finish() invocations.

Map it to mutex_lock_io().

Fixes: f21860bac05b ("locking/mutex, sched/wait: Fix the mutex_lock_io_nested() define")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/878s6fshii.fsf@nanos.tec.linutronix.de
---
 include/linux/mutex.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index 0cd631a..515cff7 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -185,7 +185,7 @@ extern void mutex_lock_io(struct mutex *lock);
 # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
 # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock)
 # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock)
-# define mutex_lock_io_nested(lock, subclass) mutex_lock(lock)
+# define mutex_lock_io_nested(lock, subclass) mutex_lock_io(lock)
 #endif
 
 /*

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

* [tip: locking/urgent] locking/mutex: Fix non debug version of mutex_lock_io_nested()
  2021-03-22  8:46 locking/mutex: Fix non debug version of mutex_lock_io_nested() Thomas Gleixner
  2021-03-22  9:01 ` Peter Zijlstra
  2021-03-23  8:16 ` [tip: locking/core] " tip-bot2 for Thomas Gleixner
@ 2021-03-23 11:25 ` tip-bot2 for Thomas Gleixner
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot2 for Thomas Gleixner @ 2021-03-23 11:25 UTC (permalink / raw
  To: linux-tip-commits
  Cc: Thomas Gleixner, Peter Zijlstra (Intel), Ingo Molnar, stable, x86,
	linux-kernel

The following commit has been merged into the locking/urgent branch of tip:

Commit-ID:     291da9d4a9eb3a1cb0610b7f4480f5b52b1825e7
Gitweb:        https://git.kernel.org/tip/291da9d4a9eb3a1cb0610b7f4480f5b52b1825e7
Author:        Thomas Gleixner <tglx@linutronix.de>
AuthorDate:    Mon, 22 Mar 2021 09:46:13 +01:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 23 Mar 2021 12:20:23 +01:00

locking/mutex: Fix non debug version of mutex_lock_io_nested()

If CONFIG_DEBUG_LOCK_ALLOC=n then mutex_lock_io_nested() maps to
mutex_lock() which is clearly wrong because mutex_lock() lacks the
io_schedule_prepare()/finish() invocations.

Map it to mutex_lock_io().

Fixes: f21860bac05b ("locking/mutex, sched/wait: Fix the mutex_lock_io_nested() define")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/878s6fshii.fsf@nanos.tec.linutronix.de
---
 include/linux/mutex.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index 0cd631a..515cff7 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -185,7 +185,7 @@ extern void mutex_lock_io(struct mutex *lock);
 # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
 # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock)
 # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock)
-# define mutex_lock_io_nested(lock, subclass) mutex_lock(lock)
+# define mutex_lock_io_nested(lock, subclass) mutex_lock_io(lock)
 #endif
 
 /*

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

end of thread, other threads:[~2021-03-23 11:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-22  8:46 locking/mutex: Fix non debug version of mutex_lock_io_nested() Thomas Gleixner
2021-03-22  9:01 ` Peter Zijlstra
2021-03-23  8:16 ` [tip: locking/core] " tip-bot2 for Thomas Gleixner
2021-03-23 11:25 ` [tip: locking/urgent] " tip-bot2 for Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.