From: Waiman Long <longman@redhat.com>
To: Bart Van Assche <bvanassche@acm.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will.deacon@arm.com>,
Boqun Feng <boqun.feng@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Subject: Re: [PATCH] locking/lockdep: Avoid potential access of invalid memory in lock_class
Date: Mon, 3 Jan 2022 13:17:01 -0500 [thread overview]
Message-ID: <4d3b818e-2aca-a596-644f-28e9e52c27bd@redhat.com> (raw)
In-Reply-To: <954086c4-d679-57d7-cc46-9ce6af2872a4@acm.org>
On 1/3/22 12:47, Bart Van Assche wrote:
> On 1/2/22 18:35, Waiman Long wrote:
>> - WARN_ON_ONCE(!found);
>> - __lockdep_free_key_range(pf, key, 1);
>> - call_rcu_zapped(pf);
>> - graph_unlock();
>> -out_irq:
>> + WARN_ON_ONCE(!found && debug_locks);
>
> lockdep_unregister_key() should only be called for a registered key so
> I'd
> like to keep the WARN_ON_ONCE(!found) here instead of changing it into
> WARN_ON_ONCE(!found && debug_locks). Otherwise this patch looks good
> to me.
The reason for this change is to handle the case that a
lockdep_register_key()/lockdep_unregister_key() pair may be called after
debug_locks is turned off. Without that change, we are going to get the
warning in lockdep_unregister_key(). That is the motivation of your
original commit 8b39adbee805 ("locking/lockdep: Make
lockdep_unregister_key() honor 'debug_locks' again").
Cheers,
Longman
next prev parent reply other threads:[~2022-01-03 18:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-03 2:35 Waiman Long
2022-01-03 17:47 ` Bart Van Assche
2022-01-03 18:17 ` Waiman Long [this message]
2022-01-03 21:26 ` Bart Van Assche
2022-01-26 13:30 ` [tip: locking/core] " tip-bot2 for Waiman Long
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4d3b818e-2aca-a596-644f-28e9e52c27bd@redhat.com \
--to=longman@redhat.com \
--cc=boqun.feng@gmail.com \
--cc=bvanassche@acm.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=peterz@infradead.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®