lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-T9K80wB4xw99jR@gmail.com>
Date: Thu, 27 Mar 2025 08:24:27 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Boqun Feng <boqun.feng@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Will Deacon <will@...nel.org>,
	Waiman Long <longman@...hat.com>, linux-kernel@...r.kernel.org,
	stable@...r.kernel.org, Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH] locking: lockdep: Decrease nr_unused_locks if lock
 unused in zap_class()


* Boqun Feng <boqun.feng@...il.com> wrote:

> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index b15757e63626..686546d52337 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -6264,6 +6264,9 @@ static void zap_class(struct pending_free *pf, struct lock_class *class)
>  		hlist_del_rcu(&class->hash_entry);
>  		WRITE_ONCE(class->key, NULL);
>  		WRITE_ONCE(class->name, NULL);
> +		/* class allocated but not used, -1 in nr_unused_locks */
> +		if (class->usage_mask == 0)
> +			debug_atomic_dec(nr_unused_locks);

Nit: capitalization in comments should follow the style of the 
surrounding code - ie. I did the change below.

Thanks,

	Ingo

======================>
 kernel/locking/lockdep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 686546d52337..58d78a33ac65 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -6264,7 +6264,7 @@ static void zap_class(struct pending_free *pf, struct lock_class *class)
 		hlist_del_rcu(&class->hash_entry);
 		WRITE_ONCE(class->key, NULL);
 		WRITE_ONCE(class->name, NULL);
-		/* class allocated but not used, -1 in nr_unused_locks */
+		/* Class allocated but not used, -1 in nr_unused_locks */
 		if (class->usage_mask == 0)
 			debug_atomic_dec(nr_unused_locks);
 		nr_lock_classes--;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ