From: Peter Zijlstra <peterz@infradead.org>
To: Mukesh Ojha <quic_mojha@quicinc.com>
Cc: mingo@redhat.com, will@kernel.org, longman@redhat.com,
boqun.feng@gmail.com, linux-kernel@vger.kernel.org,
Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
Subject: Re: [PATCH] locking/rwsem: Disable preemption while trying for rwsem lock
Date: Thu, 8 Sep 2022 19:03:41 +0200 [thread overview]
Message-ID: <YxogbSDYhsmp3CNC@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <0aafd6bd-6c4c-bb77-7b33-a6d04ee6e5b3@quicinc.com>
On Thu, Sep 08, 2022 at 09:18:29PM +0530, Mukesh Ojha wrote:
> Hi Peter,
>
> Thanks for your time in reviewing this patch.
>
> On 9/8/2022 8:02 PM, Peter Zijlstra wrote:
> > On Thu, Sep 01, 2022 at 03:58:10PM +0530, Mukesh Ojha wrote:
> > > From: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
> > >
> > > Make the region inside the rwsem_write_trylock non preemptible.
> > >
> > > We observe RT task is hogging CPU when trying to acquire rwsem lock
> > > which was acquired by a kworker task but before the rwsem owner was set.
> > >
> > > Here is the scenario:
> > > 1. CFS task (affined to a particular CPU) takes rwsem lock.
> > >
> > > 2. CFS task gets preempted by a RT task before setting owner.
> > >
> > > 3. RT task (FIFO) is trying to acquire the lock, but spinning until
> > > RT throttling happens for the lock as the lock was taken by CFS task.
> > >
> > > This patch attempts to fix the above issue by disabling preemption
> > > until owner is set for the lock. while at it also fix this issue
> > > at the place where owner being set/cleared.
> > >
> > > Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
> > > Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
> >
> > This is not a valid SoB chain.
>
> Since this patch of adding preempt disable() at rwsem_write_trylock() is
> originated from Gokul.
>
> Would be adding him in
> Original-patch-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
>
> Convert myself to the author/SoB.
>
Oh, my bad, I missed From is actually Gokul. So yeah, all good, ignore
that.
prev parent reply other threads:[~2022-09-08 17:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 10:28 [PATCH] locking/rwsem: Disable preemption while trying for rwsem lock Mukesh Ojha
2022-09-02 20:55 ` Waiman Long
2022-09-06 12:43 ` Mukesh Ojha
2022-09-08 14:32 ` Peter Zijlstra
2022-09-08 15:48 ` Mukesh Ojha
2022-09-08 17:03 ` Peter Zijlstra [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=YxogbSDYhsmp3CNC@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=boqun.feng@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=quic_gokukris@quicinc.com \
--cc=quic_mojha@quicinc.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