From: Juri Lelli <juri.lelli@redhat.com>
To: Valentin Schneider <vschneid@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
linux-rt-users <linux-rt-users@vger.kernel.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Bruno Goncalves <bgoncalv@redhat.com>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Daniel Bristot de Oliveira <bristot@redhat.com>
Subject: Re: [PATCH] linux/wait: Fix __wait_event_hrtimeout for RT/DL tasks
Date: Tue, 12 Jul 2022 07:42:43 +0200 [thread overview]
Message-ID: <Ys0J00yyLlT2Q/vM@localhost.localdomain> (raw)
In-Reply-To: <xhsmhtu7weytl.mognet@vschneid.remote.csb>
On 05/07/22 09:41, Valentin Schneider wrote:
> On 27/06/22 11:50, Juri Lelli wrote:
> > Changes to hrtimer mode (potentially made by __hrtimer_init_sleeper on
> > PREEMPT_RT) are not visible to hrtimer_start_range_ns, thus not
> > accounted for by hrtimer_start_expires call paths. In particular,
> > __wait_event_hrtimeout suffers from this problem as we have, for
> > example:
> >
> > fs/aio.c::read_events
> > wait_event_interruptible_hrtimeout
> > __wait_event_hrtimeout
> > hrtimer_init_sleeper_on_stack <- this might "mode |= HRTIMER_MODE_HARD"
> > on RT if task runs at RT/DL priority
> > hrtimer_start_range_ns
> > WARN_ON_ONCE(!(mode & HRTIMER_MODE_HARD) ^ !timer->is_hard)
> > fires since the latter doesn't see the change of mode done by
> > init_sleeper
> >
> > Fix it by making __wait_event_hrtimeout call hrtimer_sleeper_start_expires,
> > which is aware of the special RT/DL case, instead of hrtimer_start_range_ns.
> >
> > Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> > Reported-by: Bruno Goncalves <bgoncalv@redhat.com>
> > Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
>
> Makes sense, that's now aligned with what e.g.
> schedule_hrtimer_range_clock() does.
>
> Reviewed-by: Valentin Schneider <vschneid@redhat.com>
Thanks!
Gentle ping to the others about this one.
Best,
Juri
next prev parent reply other threads:[~2022-07-12 5:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-27 9:50 Juri Lelli
2022-07-05 8:41 ` Valentin Schneider
2022-07-12 5:42 ` Juri Lelli [this message]
2022-07-19 8:47 ` Daniel Bristot de Oliveira
2022-07-28 10:43 ` [tip: timers/core] wait: " tip-bot2 for Juri Lelli
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=Ys0J00yyLlT2Q/vM@localhost.localdomain \
--to=juri.lelli@redhat.com \
--cc=bgoncalv@redhat.com \
--cc=bigeasy@linutronix.de \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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
all inboxes | Powered by JetHome®