[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251219152548.3861707-2-clopez@suse.de>
Date: Fri, 19 Dec 2025 16:25:49 +0100
From: Carlos López <clopez@...e.de>
To: linux-kernel@...r.kernel.org
Cc: Carlos López <clopez@...e.de>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Will Deacon <will@...nel.org>,
Boqun Feng <boqun.feng@...il.com>,
Waiman Long <longman@...hat.com>
Subject: [PATCH] locking/mutex: define conditional guard for for mutex_lock_killable()
Allow using guards with mutex_lock_killable(), just like we currently do
with mutex_lock_interruptable(), e.g.
scoped_guard(mutex_killable, &my_mutex) {
...
}
Signed-off-by: Carlos López <clopez@...e.de>
---
include/linux/mutex.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index bf535f0118bb..931a139e6176 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -253,6 +253,7 @@ extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
DEFINE_GUARD(mutex, struct mutex *, mutex_lock(_T), mutex_unlock(_T))
DEFINE_GUARD_COND(mutex, _try, mutex_trylock(_T))
DEFINE_GUARD_COND(mutex, _intr, mutex_lock_interruptible(_T), _RET == 0)
+DEFINE_GUARD_COND(mutex, _killable, mutex_lock_killable(_T), _RET == 0)
extern unsigned long mutex_get_owner(struct mutex *lock);
--
2.51.0
Powered by blists - more mailing lists