mutex: nuke mutex_trylock_recursive
Subsystems (2)
PATCH 1/1 mutex: nuke mutex_trylock_recursive
The last user went away in the 5.11 cycle.
--- include/linux/mutex.h | 25 ------------------------- kernel/locking/mutex.c | 10 ---------- scripts/checkpatch.pl | 6 ------ 3 files changed, 41 deletions(-)
include/linux/mutex.h +0 -25
@@ -199,29 +199,4 @@ extern void mutex_unlock(struct mutex *lock);extern int atomic_dec_and_mutex_lock (atomic_t *cnt,struct mutex *lock); -/* -* These values are chosen such that FAIL and SUCCESS match the -* values of the regular mutex_trylock(). -*/ -enum mutex_trylock_recursive_enum { -MUTEX_TRYLOCK_FAILED =0 , -MUTEX_TRYLOCK_SUCCESS =1 , -MUTEX_TRYLOCK_RECURSIVE , -}; - -/** -* mutex_trylock_recursive - trylock variant that allows recursive locking -* @lock: mutex to be locked -* -* This function should not be used, _ever_. It is purely for hysterical GEM -* raisins, and once those are gone this will be removed. -* -* Returns: -* - MUTEX_TRYLOCK_FAILED - trylock failed, -* - MUTEX_TRYLOCK_SUCCESS - lock acquired, -* - MUTEX_TRYLOCK_RECURSIVE - we already owned the lock. -*/ -extern /* __deprecated */ __must_check enum mutex_trylock_recursive_enum -mutex_trylock_recursive (struct mutex *lock); -#endif /* __LINUX_MUTEX_H */
kernel/locking/mutex.c +0 -10
@@ -86,16 +86,6 @@ bool mutex_is_locked(struct mutex *lock) }EXPORT_SYMBOL (mutex_is_locked); -__must_check enum mutex_trylock_recursive_enum -mutex_trylock_recursive (struct mutex *lock) -{ -if (unlikely (__mutex_owner (lock) == current)) -return MUTEX_TRYLOCK_RECURSIVE ; - -return mutex_trylock (lock); -} -EXPORT_SYMBOL (mutex_trylock_recursive); -static inline unsigned long __owner_flags (unsigned long owner) {return owner &MUTEX_FLAGS ;
scripts/checkpatch.pl +0 -6
@@ -7069,12 +7069,6 @@ sub process { } } -# check for mutex_trylock_recursive usage - if ($line =~ /mutex_trylock_recursive/) { - ERROR("LOCKING", - "recursive locking is bad, do not use this ever.\n" . $herecurr); - } - # check for lockdep_set_novalidate_class if ($line =~ /^.\s*lockdep_set_novalidate_class\s*\(/ || $line =~ /__lockdep_no_validate__\s*\)/ ) {
Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 3 lines · Christian König
The last user went away in the 5.11 cycle.
Signed-off-by Christian König <[email protected]>
Nice.
I think would be good to still stuff this into 5.12 before someone resurrects this zombie.
-Daniel
Quoted 85 lines
--- include/linux/mutex.h | 25 ------------------------- kernel/locking/mutex.c | 10 ---------- scripts/checkpatch.pl | 6 ------ 3 files changed, 41 deletions(-)include/linux/mutex.h +0
-25@@ -199,29 +199,4 @@ extern void mutex_unlock(struct mutex *lock);extern int atomic_dec_and_mutex_lock (atomic_t *cnt,struct mutex *lock); -/* -* These values are chosen such that FAIL and SUCCESS match the -* values of the regular mutex_trylock(). -*/ -enum mutex_trylock_recursive_enum { -MUTEX_TRYLOCK_FAILED =0 , -MUTEX_TRYLOCK_SUCCESS =1 , -MUTEX_TRYLOCK_RECURSIVE , -}; - -/** -* mutex_trylock_recursive - trylock variant that allows recursive locking -* @lock: mutex to be locked -* -* This function should not be used, _ever_. It is purely for hysterical GEM -* raisins, and once those are gone this will be removed. -* -* Returns: -* - MUTEX_TRYLOCK_FAILED - trylock failed, -* - MUTEX_TRYLOCK_SUCCESS - lock acquired, -* - MUTEX_TRYLOCK_RECURSIVE - we already owned the lock. -*/ -extern /* __deprecated */ __must_check enum mutex_trylock_recursive_enum -mutex_trylock_recursive (struct mutex *lock); -#endif /* __LINUX_MUTEX_H */ kernel/locking/mutex.c +0
-10@@ -86,16 +86,6 @@ bool mutex_is_locked(struct mutex *lock) }EXPORT_SYMBOL (mutex_is_locked); -__must_check enum mutex_trylock_recursive_enum -mutex_trylock_recursive (struct mutex *lock) -{ -if (unlikely (__mutex_owner (lock) == current)) -return MUTEX_TRYLOCK_RECURSIVE ; - -return mutex_trylock (lock); -} -EXPORT_SYMBOL (mutex_trylock_recursive); -static inline unsigned long __owner_flags (unsigned long owner) {return owner &MUTEX_FLAGS ;scripts/checkpatch.pl +0
-6@@ -7069,12 +7069,6 @@ sub process { } } -# check for mutex_trylock_recursive usage - if ($line =~ /mutex_trylock_recursive/) { - ERROR("LOCKING", - "recursive locking is bad, do not use this ever.\n" . $herecurr); - } - # check for lockdep_set_novalidate_class if ($line =~ /^.\s*lockdep_set_novalidate_class\s*\(/ || $line =~ /__lockdep_no_validate__\s*\)/ ) {Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Peter Zijlstra
maintainerQuoted 11 lines · Daniel Vetter
Quoted 3 lines · Christian König
The last user went away in the 5.11 cycle.
Signed-off-by Christian König <[email protected]>Nice.
Reviewed-by Daniel Vetter <[email protected]>I think would be good to still stuff this into 5.12 before someone resurrects this zombie.
Already done:
https://lkml.kernel.org/r/161296556531.23325.10473355259841906876.tip-bot2@tip-bot2
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Am 16.02.21 um 11:13 schrieb Peter Zijlstra:
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Christian König
Quoted 3 lines
The last user went away in the 5.11 cycle.
Signed-off-by Christian König <[email protected]>Nice.
Quoted 7 lines
Quoted 4 lines
Reviewed-by Daniel Vetter <[email protected]>I think would be good to still stuff this into 5.12 before someone resurrects this zombie.
Already done:
https://lkml.kernel.org/r/161296556531.23325.10473355259841906876.tip-bot2@tip-bot2
One less bad concept to worry about.
But your patch is missing to remove the checkpatch.pl check for this :)
Cheers,
Christian.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Peter Zijlstra
maintainerQuoted 14 lines · Christian König
Am 16.02.21 um 11:13 schrieb Peter Zijlstra:
Quoted 11 lines · Daniel Vetter
Quoted 10 lines · Christian König
Quoted 3 lines
The last user went away in the 5.11 cycle.
Signed-off-by Christian König <[email protected]>Nice.
Reviewed-by Daniel Vetter <[email protected]>I think would be good to still stuff this into 5.12 before someone resurrects this zombie.
Quoted 7 lines
Quoted 3 lines
Already done:
https://lkml.kernel.org/r/161296556531.23325.10473355259841906876.tip-bot2@tip-bot2One less bad concept to worry about.
But your patch is missing to remove the checkpatch.pl check for this :)
The next patch does that, look at the "Thread overview:" at the bottom of the things.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel