kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtmutex_api: remove definition of mutex_lock_killable_nested
@ 2025-05-30  7:51 Paolo Bonzini
  2025-05-30 14:14 ` Randy Dunlap
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2025-05-30  7:51 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: Randy Dunlap, Peter Zijlstra

Commit fb49f07ba1d9 ("locking/mutex: implement mutex_lock_killable_nest_lock")
removed the "extern" declaration of mutex_lock_killable_nested from
include/linux/mutex.h, and replaced it with a macro since it could be
treated as a special case of _mutex_lock_killable.  It also removed a
definition of the function in kernel/locking/mutex.c.

However, it left the definition in place in kernel/locking/rtmutex_api.c,
which causes a failure when building with CONFIG_RT_MUTEXES=y.  Drop it as
well now.

Fixes: fb49f07ba1d9 ("locking/mutex: implement mutex_lock_killable_nest_lock")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 kernel/locking/rtmutex_api.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/kernel/locking/rtmutex_api.c b/kernel/locking/rtmutex_api.c
index 191e4720e546..0c26b52dd417 100644
--- a/kernel/locking/rtmutex_api.c
+++ b/kernel/locking/rtmutex_api.c
@@ -544,13 +544,6 @@ int __sched mutex_lock_interruptible_nested(struct mutex *lock,
 }
 EXPORT_SYMBOL_GPL(mutex_lock_interruptible_nested);
 
-int __sched mutex_lock_killable_nested(struct mutex *lock,
-					    unsigned int subclass)
-{
-	return __mutex_lock_common(lock, TASK_KILLABLE, subclass, NULL, _RET_IP_);
-}
-EXPORT_SYMBOL_GPL(mutex_lock_killable_nested);
-
 void __sched mutex_lock_io_nested(struct mutex *lock, unsigned int subclass)
 {
 	int token;
-- 
2.43.5


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

* Re: [PATCH] rtmutex_api: remove definition of mutex_lock_killable_nested
  2025-05-30  7:51 [PATCH] rtmutex_api: remove definition of mutex_lock_killable_nested Paolo Bonzini
@ 2025-05-30 14:14 ` Randy Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: Randy Dunlap @ 2025-05-30 14:14 UTC (permalink / raw)
  To: Paolo Bonzini, linux-kernel, kvm; +Cc: Peter Zijlstra

Hi,

On 5/30/25 12:51 AM, Paolo Bonzini wrote:
> Commit fb49f07ba1d9 ("locking/mutex: implement mutex_lock_killable_nest_lock")
> removed the "extern" declaration of mutex_lock_killable_nested from
> include/linux/mutex.h, and replaced it with a macro since it could be
> treated as a special case of _mutex_lock_killable.  It also removed a
> definition of the function in kernel/locking/mutex.c.
> 
> However, it left the definition in place in kernel/locking/rtmutex_api.c,
> which causes a failure when building with CONFIG_RT_MUTEXES=y.  Drop it as
> well now.
> 
> Fixes: fb49f07ba1d9 ("locking/mutex: implement mutex_lock_killable_nest_lock")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

This patch fixes part of the build errors that I was seeing, but I
still have these:

In file included from ../include/uapi/linux/posix_types.h:5,
                 from ../include/uapi/linux/types.h:14,
                 from ../include/linux/types.h:6,
                 from ../include/linux/kasan-checks.h:5,
                 from ../include/asm-generic/rwonce.h:26,
                 from ./arch/x86/include/generated/asm/rwonce.h:1,
                 from ../include/linux/compiler.h:390,
                 from ../include/linux/export.h:5,
                 from ../include/linux/linkage.h:7,
                 from ../include/linux/preempt.h:10,
                 from ../include/linux/spinlock.h:56,
                 from ../kernel/locking/rtmutex_api.c:5:
../include/linux/stddef.h:8:14: error: expected declaration specifiers or ‘...’ before ‘(’ token
    8 | #define NULL ((void *)0)
      |              ^
../include/linux/mutex.h:215:60: note: in expansion of macro ‘NULL’
  215 | #define mutex_trylock(lock) _mutex_trylock_nest_lock(lock, NULL)
      |                                                            ^~~~
../kernel/locking/rtmutex_api.c:589:13: note: in expansion of macro ‘mutex_trylock’
  589 | int __sched mutex_trylock(struct mutex *lock)
      |             ^~~~~~~~~~~~~
../kernel/locking/rtmutex_api.c:602:15: error: ‘mutex_trylock’ undeclared here (not in a function); did you mean ‘ww_mutex_trylock’?
  602 | EXPORT_SYMBOL(mutex_trylock);
      |               ^~~~~~~~~~~~~
../include/linux/export.h:76:23: note: in definition of macro ‘__EXPORT_SYMBOL’
   76 |         extern typeof(sym) sym;                                 \
      |                       ^~~
../include/linux/export.h:89:41: note: in expansion of macro ‘_EXPORT_SYMBOL’
   89 | #define EXPORT_SYMBOL(sym)              _EXPORT_SYMBOL(sym, "")
      |                                         ^~~~~~~~~~~~~~
../kernel/locking/rtmutex_api.c:602:1: note: in expansion of macro ‘EXPORT_SYMBOL’
  602 | EXPORT_SYMBOL(mutex_trylock);
      | ^~~~~~~~~~~~~



> ---
>  kernel/locking/rtmutex_api.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/kernel/locking/rtmutex_api.c b/kernel/locking/rtmutex_api.c
> index 191e4720e546..0c26b52dd417 100644
> --- a/kernel/locking/rtmutex_api.c
> +++ b/kernel/locking/rtmutex_api.c
> @@ -544,13 +544,6 @@ int __sched mutex_lock_interruptible_nested(struct mutex *lock,
>  }
>  EXPORT_SYMBOL_GPL(mutex_lock_interruptible_nested);
>  
> -int __sched mutex_lock_killable_nested(struct mutex *lock,
> -					    unsigned int subclass)
> -{
> -	return __mutex_lock_common(lock, TASK_KILLABLE, subclass, NULL, _RET_IP_);
> -}
> -EXPORT_SYMBOL_GPL(mutex_lock_killable_nested);
> -
>  void __sched mutex_lock_io_nested(struct mutex *lock, unsigned int subclass)
>  {
>  	int token;

-- 
~Randy


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

end of thread, other threads:[~2025-05-30 14:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-30  7:51 [PATCH] rtmutex_api: remove definition of mutex_lock_killable_nested Paolo Bonzini
2025-05-30 14:14 ` Randy Dunlap

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).