Skip to contentSkip to conversation

locking/rtmutex: switch to EXPORT_SYMBOL() for ww_mutex_lock{,_interruptible}()

PATCH In review Yajun Deng 3 participants 3 messages Aug 3, 2022 – Aug 18, 2022 Locking primitives

lore
Share & tools
lore

Yajun Deng

author
#0 lore raw

PATCH 1/1 locking/rtmutex: switch to EXPORT_SYMBOL() for ww_mutex_lock{,_interruptible}()

We can use EXPORT_SYMBOL() instead of EXPORT_SYMBOL_GPL() in ww_mutex_lock_interruptible() and ww_mutex_lock(). That match ww_mutex_unlock() well. And also good for 3rd kernel modules.

---
 kernel/locking/rtmutex.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/locking/rtmutex.c +2 -2
index 31b374d36d04..b110fc57f733 100644
@@ -2513,7 +2513,7 @@ ww_mutex_lock_interruptible(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
 
 	return ret;
 }
-EXPORT_SYMBOL_GPL(ww_mutex_lock_interruptible);
+EXPORT_SYMBOL(ww_mutex_lock_interruptible);
 
 int __sched
 ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
@@ -2533,7 +2533,7 @@ ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
 
 	return ret;
 }
-EXPORT_SYMBOL_GPL(ww_mutex_lock);
+EXPORT_SYMBOL(ww_mutex_lock);
 
 void __sched ww_mutex_unlock(struct ww_mutex *lock)
 {
Signature · 1 line
2.25.1
#1 lore raw
Quoted 3 lines · Yajun Deng

We can use EXPORT_SYMBOL() instead of EXPORT_SYMBOL_GPL() in ww_mutex_lock_interruptible() and ww_mutex_lock(). That match ww_mutex_unlock() well. And also good for 3rd kernel modules.

Not that I am fan of this but it will sync the symbols with what landed upstream as of commit
f8635d509d807 ("locking/ww_mutex: Implement rtmutex based ww_mutex API functions")

therefore it would be good to have.
Luis?

Quoted 1 line

Sebastian

#2 lore raw
Quoted 11 lines · Sebastian Andrzej Siewior
Quoted 3 lines · Yajun Deng

We can use EXPORT_SYMBOL() instead of EXPORT_SYMBOL_GPL() in ww_mutex_lock_interruptible() and ww_mutex_lock(). That match ww_mutex_unlock() well. And also good for 3rd kernel modules.

Not that I am fan of this but it will sync the symbols with what landed upstream as of commit
f8635d509d807 ("locking/ww_mutex: Implement rtmutex based ww_mutex API functions")

therefore it would be good to have.
Luis?

Looks good to me. I can add that to my next update.

Luis

Quoted 4 lines
Quoted 1 line

Sebastian

---end quoted text---