mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Zqiang <qiang1.zhang@intel.com>,
	peterz@infradead.org, mingo@redhat.com, will@kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] locking/rtmutex: Fix incorrect spinning condition
Date: Sun, 19 Dec 2021 16:09:20 -0500	[thread overview]
Message-ID: <71c5ca50-1bf9-4ef7-eea0-634f66838d4a@redhat.com> (raw)
In-Reply-To: <20211217074207.77425-1-qiang1.zhang@intel.com>

On 12/17/21 02:42, Zqiang wrote:
> When the lock owner is on CPU and not need resched, the current waiter
> need to be checked, if it not longer top the waiter, stop spinning.

Incorrect grammar, should be "if it is no longer the top waiter". There 
is a similar typo in the existing code comment too.

You can modify the subject line to [PATCH-tip ...] to indicate that it 
is supposed to be apply on top of the tip tree. Other than that, the 
patch looks good.

Cheers,
Longman

>
> Fixes: c3123c431447 ("locking/rtmutex: Dont dereference waiter lockless")
> Signed-off-by: Zqiang <qiang1.zhang@intel.com>
> ---
>   v1->v2:
>   Modify description information.
>
>   kernel/locking/rtmutex.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
> index 0c1f2e3f019a..8555c4efe97c 100644
> --- a/kernel/locking/rtmutex.c
> +++ b/kernel/locking/rtmutex.c
> @@ -1383,7 +1383,7 @@ static bool rtmutex_spin_on_owner(struct rt_mutex_base *lock,
>   		 *  - the VCPU on which owner runs is preempted
>   		 */
>   		if (!owner_on_cpu(owner) || need_resched() ||
> -		    rt_mutex_waiter_is_top_waiter(lock, waiter)) {
> +		    !rt_mutex_waiter_is_top_waiter(lock, waiter)) {
>   			res = false;
>   			break;
>   		}


  parent reply	other threads:[~2021-12-19 21:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17  7:42 Zqiang
2021-12-17 20:53 ` Thomas Gleixner
2021-12-18  7:24   ` Zhang, Qiang1
2021-12-18  9:34     ` Thomas Gleixner
2021-12-20  1:45       ` Zhang, Qiang1
2021-12-18 10:01 ` [tip: locking/core] locking/rtmutex: Fix incorrect condition in rtmutex_spin_on_owner() tip-bot2 for Zqiang
2021-12-19 21:09 ` Waiman Long [this message]
2021-12-20  1:54   ` [PATCH v2] locking/rtmutex: Fix incorrect spinning condition Zhang, Qiang1

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=71c5ca50-1bf9-4ef7-eea0-634f66838d4a@redhat.com \
    --to=longman@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=qiang1.zhang@intel.com \
    --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®