[4/4] locking/rwsem: Make DEBUG_RWSEMS and PREEMPT_RT mutually exclusive

Message ID 20240213031656.1375951-5-longman@redhat.com
State New
Headers
Series locking: Some locking code cleanups |

Commit Message

Waiman Long Feb. 13, 2024, 3:16 a.m. UTC
  The debugging code enabled by CONFIG_DEBUG_RWSEMS will only be
compiled in when CONFIG_PREEMPT_RT isn't set. There is no point to
allow CONFIG_DEBUG_RWSEMS to be set in a kernel configuration where
CONFIG_PREEMPT_RT is also set. Make them mutually exclusive.

Signed-off-by: Waiman Long <longman@redhat.com>
---
 lib/Kconfig.debug | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Boqun Feng Feb. 22, 2024, 4:36 a.m. UTC | #1
On Mon, Feb 12, 2024 at 10:16:56PM -0500, Waiman Long wrote:
> The debugging code enabled by CONFIG_DEBUG_RWSEMS will only be
> compiled in when CONFIG_PREEMPT_RT isn't set. There is no point to
> allow CONFIG_DEBUG_RWSEMS to be set in a kernel configuration where
> CONFIG_PREEMPT_RT is also set. Make them mutually exclusive.
> 
> Signed-off-by: Waiman Long <longman@redhat.com>

Reviewed-by: Boqun Feng <boqun.feng@gmail.com>

Regards,
Boqun

> ---
>  lib/Kconfig.debug | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index 975a07f9f1cc..cb695bc76d30 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -1303,7 +1303,7 @@ config PROVE_LOCKING
>  	select DEBUG_SPINLOCK
>  	select DEBUG_MUTEXES if !PREEMPT_RT
>  	select DEBUG_RT_MUTEXES if RT_MUTEXES
> -	select DEBUG_RWSEMS
> +	select DEBUG_RWSEMS if !PREEMPT_RT
>  	select DEBUG_WW_MUTEX_SLOWPATH
>  	select DEBUG_LOCK_ALLOC
>  	select PREEMPT_COUNT if !ARCH_NO_PREEMPT
> @@ -1426,7 +1426,7 @@ config DEBUG_WW_MUTEX_SLOWPATH
>  
>  config DEBUG_RWSEMS
>  	bool "RW Semaphore debugging: basic checks"
> -	depends on DEBUG_KERNEL
> +	depends on DEBUG_KERNEL && !PREEMPT_RT
>  	help
>  	  This debugging feature allows mismatched rw semaphore locks
>  	  and unlocks to be detected and reported.
> -- 
> 2.39.3
>
  

Patch

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 975a07f9f1cc..cb695bc76d30 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1303,7 +1303,7 @@  config PROVE_LOCKING
 	select DEBUG_SPINLOCK
 	select DEBUG_MUTEXES if !PREEMPT_RT
 	select DEBUG_RT_MUTEXES if RT_MUTEXES
-	select DEBUG_RWSEMS
+	select DEBUG_RWSEMS if !PREEMPT_RT
 	select DEBUG_WW_MUTEX_SLOWPATH
 	select DEBUG_LOCK_ALLOC
 	select PREEMPT_COUNT if !ARCH_NO_PREEMPT
@@ -1426,7 +1426,7 @@  config DEBUG_WW_MUTEX_SLOWPATH
 
 config DEBUG_RWSEMS
 	bool "RW Semaphore debugging: basic checks"
-	depends on DEBUG_KERNEL
+	depends on DEBUG_KERNEL && !PREEMPT_RT
 	help
 	  This debugging feature allows mismatched rw semaphore locks
 	  and unlocks to be detected and reported.