mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <llong@redhat.com>
To: buckzhang1212 <buckzhang1212@yeah.net>,
	"llong@redhat.com" <llong@redhat.com>
Cc: "peterz@infradead.org" <peterz@infradead.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"will@kernel.org" <will@kernel.org>,
	"boqun.feng@gmail.com" <boqun.feng@gmail.com>,
	"linux-kernel@vger.kernel…" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] locking/mutex: add MUTEX_WARN_ON to warn invalid mutex
Date: Sun, 28 Sep 2025 12:37:32 -0400	[thread overview]
Message-ID: <78676863-593f-4823-9dc2-c08a36f86378@redhat.com> (raw)
In-Reply-To: <73ba8425.3229c.19991241c52.Coremail.buckzhang1212@yeah.net>

On 9/28/25 12:24 PM, buckzhang1212 wrote:
> Hey Long
> you are right,lock->magic check can  help me to get what I want .
> It's a bit late for me, and I want to get the  warning when I first 
> use  the invalid mutex.
> Can I move the lock->magic check to  the mutex_lock?

All the mutex_lock*() functions will eventually call 
__mutex_lock_common() or __mutex_trylock_fast() which also has the check 
. There is no need to duplicate the check in each of them.

Cheers,
Longman


      parent reply	other threads:[~2025-09-28 16:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-27  8:00 buckzhang1212
2025-09-28 15:55 ` Waiman Long
     [not found]   ` <73ba8425.3229c.19991241c52.Coremail.buckzhang1212@yeah.net>
2025-09-28 16:37     ` Waiman Long [this message]

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=78676863-593f-4823-9dc2-c08a36f86378@redhat.com \
    --to=llong@redhat.com \
    --cc=boqun.feng@gmail.com \
    --cc=buckzhang1212@yeah.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=will@kernel.org \
    /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®