public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Zhipeng Shi <zhipeng.shi0@gmail.com>
Cc: peterz@infradead.org, mingo@redhat.comb, will@kernel.org,
	longman@redhat.com, boqun.feng@gmail.com, tglx@linutronix.de,
	schspa@gmail.com, shengjian.xu@horizon.ai,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] locking/rtmutex: Provide proper spin_is_contended
Date: Tue, 7 Jun 2022 11:24:56 +0200	[thread overview]
Message-ID: <Yp8ZaHHBrHzg+o49@linutronix.de> (raw)
In-Reply-To: <20220607091514.897833-1-zhipeng.shi0@gmail.com>

On 2022-06-07 17:15:14 [+0800], Zhipeng Shi wrote:
> Commit d89c70356acf ("locking/core: Remove break_lock field when
> CONFIG_GENERIC_LOCKBREAK=y") removed GENERIC_LOCKBREAK, which caused
> spin_is_contended depend on the implementation of arch_spin_is_contended.
> But now in rt-spinlock, spin_is_contended returns 0 directly.
> 
> This causes cond_resched_lock to fail to correctly detect lock contention
> in RT-linux. In some scenarios (such as __purge_vmap_area_lazy in vmalloc),
> this will cause a large latency.
> 
> This patch provides the implementation of spin_is_contended for
> rt-spinlock.

Do you have a test-case or an example?

The thing if _this_ task has higher priority than other tasks waiting on
this lock then a simple unlock+lock won't do a thing. That is why I
ripped it all out while it was half way done.

> Signed-off-by: Zhipeng Shi <zhipeng.shi0@gmail.com>

Sebastian

  reply	other threads:[~2022-06-07  9:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07  9:15 [PATCH] locking/rtmutex: Provide proper spin_is_contended Zhipeng Shi
2022-06-07  9:24 ` Sebastian Andrzej Siewior [this message]
2022-06-08 14:24   ` Zhipeng Shi
  -- strict thread matches above, loose matches on Subject: below --
2022-06-07  9:24 Zhipeng Shi

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=Yp8ZaHHBrHzg+o49@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=boqun.feng@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.comb \
    --cc=peterz@infradead.org \
    --cc=schspa@gmail.com \
    --cc=shengjian.xu@horizon.ai \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=zhipeng.shi0@gmail.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