public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Georgi Djakov' <djakov@kernel.org>,
	Mike Tipton <quic_mdtipton@quicinc.com>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"quic_okukatla@quicinc.com" <quic_okukatla@quicinc.com>
Subject: RE: [PATCH] interconnect: Replace mutex with rt_mutex
Date: Wed, 7 Sep 2022 08:15:21 +0000	[thread overview]
Message-ID: <760fed2808aa46729eab9d0037d0904e@AcuMS.aculab.com> (raw)
In-Reply-To: <3c8965c0-3bc0-252e-381d-bd057fd02af5@kernel.org>

From: Georgi Djakov
> Sent: 07 September 2022 08:35
> 
> Hi Mike,
> 
> Thanks for the patch!
> 
> On 6.09.22 22:14, Mike Tipton wrote:
> > Replace mutex with rt_mutex to prevent priority inversion between
> > clients, which can cause unacceptable delays in some cases.
> 
> It would be nice if you have any numbers to share in the commit text.
> 
> > Signed-off-by: Mike Tipton <quic_mdtipton@quicinc.com>
> > ---
> >
> > We've run into a number of cases internally and from customers where
> > high priority, RT clients (typically display) become blocked for long
> > periods of time on lower priority, non-RT clients. Switching to rt_mutex
> > has proven to help performance in these cases.
> 
> I am wondering if avoiding the inversion on this specific lock is the right
> solution, as there could be other locks that may cause similar issues. Do we
> see similar issue with clocks for example or is it just with interconnects?

My thoughts exactly.

Although I've not tried to use the RT kernel I have tried to
get a highly threaded RT (audio) userspace application to
run reliable.

Userspace only has sleep locks so you get all the priority
inversion problems.
This big problems arise with a highly contended lock that
is never held for very long - a prime candidate for spin lock.
If a process is even interrupted while holding the lock the
entire application stops.
The only way I found to avoid this is to replace all the locking
with atomic operations.

I can't see why the RT kernel doesn't have exactly the same issues.
Given how long a process switch takes I really suspect that most
spinlocks should remain spinlocks.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

  reply	other threads:[~2022-09-07  8:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06 19:14 [PATCH] interconnect: Replace mutex with rt_mutex Mike Tipton
2022-09-07  7:35 ` Georgi Djakov
2022-09-07  8:15   ` David Laight [this message]
2022-09-07 14:59   ` Mike Tipton
2025-04-17 11:13     ` Aiqun(Maria) Yu
2025-04-18  0:32       ` Mike Tipton

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=760fed2808aa46729eab9d0037d0904e@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=djakov@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=quic_mdtipton@quicinc.com \
    --cc=quic_okukatla@quicinc.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