From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
Juri Lelli <juri.lelli@redhat.com>,
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>,
Borislav Petkov <bp@alien8.de>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Jens Axboe <axboe@kernel.dk>, Alasdair Kergon <agk@redhat.com>,
Mike Snitzer <snitzer@redhat.com>,
dm-devel@redhat.com, "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Felipe Balbi <balbi@kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Tejun Heo <tj@kernel.org>, Zefan Li <lizefan.x@bytedance.com>
Subject: Re: [PATCH 1/6] sched: Unbreak wakeups
Date: Wed, 2 Jun 2021 15:58:04 +0200 [thread overview]
Message-ID: <YLeObHTKKDGd3pdA@kroah.com> (raw)
In-Reply-To: <20210602133040.271625424@infradead.org>
On Wed, Jun 02, 2021 at 03:12:26PM +0200, Peter Zijlstra wrote:
> Remove broken task->state references and let wake_up_process() DTRT.
>
> The anti-pattern in these patches breaks the ordering of ->state vs
> COND as described in the comment near set_current_state() and can lead
> to missed wakeups:
>
> (OoO load, observes RUNNING)<-.
> for (;;) { |
> t->state = UNINTERRUPTIBLE; |
> smp_mb(); ,-----> ,' (OoO load, observed !COND)
> | |
> | | COND = 1;
> | `- if (t->state != RUNNING)
> | wake_up_process(t); // not done
> if (COND) ---------'
> break;
> schedule(); // forever waiting
> }
> t->state = TASK_RUNNING;
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
> drivers/net/ethernet/qualcomm/qca_spi.c | 6 ++----
> drivers/usb/gadget/udc/max3420_udc.c | 15 +++++----------
> drivers/usb/host/max3421-hcd.c | 3 +--
> kernel/softirq.c | 2 +-
> 4 files changed, 9 insertions(+), 17 deletions(-)
For USB stuff:
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
next prev parent reply other threads:[~2021-06-02 13:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-02 13:12 [PATCH 0/6] sched: Cleanup task_struct::state Peter Zijlstra
2021-06-02 13:12 ` [PATCH 1/6] sched: Unbreak wakeups Peter Zijlstra
2021-06-02 13:58 ` Greg Kroah-Hartman [this message]
[not found] ` <20210602133040.271625424-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2021-06-02 14:47 ` Will Deacon
2021-06-02 19:43 ` Davidlohr Bueso
2021-06-02 13:12 ` [PATCH 2/6] sched: Introduce task_is_running() Peter Zijlstra
2021-06-02 14:59 ` Will Deacon
2021-06-02 16:46 ` Peter Zijlstra
2021-06-02 23:15 ` Davidlohr Bueso
2021-06-02 13:12 ` [PATCH 3/6] sched,perf,kvm: Fix preemption condition Peter Zijlstra
2021-06-02 13:59 ` Mathieu Desnoyers
2021-06-02 14:10 ` Peter Zijlstra
[not found] ` <YLeRVQbXt2hCiO8f-Nxj+rRp3nVydTX5a5knrm8zTDFooKrT+cvkQGrU6aU0@public.gmane.org>
2021-06-02 14:30 ` Mark Rutland
[not found] ` <20210602133040.398289363-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2021-06-02 14:15 ` Mathieu Desnoyers
2021-06-02 14:23 ` Peter Zijlstra
2021-06-02 13:12 ` [PATCH 4/6] sched: Add get_current_state() Peter Zijlstra
[not found] ` <20210602133040.461908001-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2021-06-02 14:01 ` Mathieu Desnoyers
2021-06-02 14:12 ` Peter Zijlstra
2021-06-02 15:02 ` Will Deacon
2021-06-02 13:12 ` [PATCH 5/6] sched,timer: Use __set_current_state() Peter Zijlstra
[not found] ` <20210602133040.524487671-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2021-06-02 15:06 ` Will Deacon
2021-06-02 19:54 ` Davidlohr Bueso
2021-06-03 6:39 ` Peter Zijlstra
2021-06-18 20:42 ` Thomas Gleixner
2021-06-02 13:12 ` [PATCH 6/6] sched: Change task_struct::state Peter Zijlstra
[not found] ` <20210602133040.587042016-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2021-06-02 14:06 ` Mathieu Desnoyers
2021-06-02 14:20 ` Peter Zijlstra
2021-06-02 15:10 ` Will Deacon
2021-06-07 10:45 ` Daniel Thompson
[not found] ` <20210607104500.sopvslejuoxwzhrs-DWWWtol72k3/PtFMR13I2A@public.gmane.org>
2021-06-07 11:10 ` Peter Zijlstra
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=YLeObHTKKDGd3pdA@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=agk@redhat.com \
--cc=axboe@kernel.dk \
--cc=balbi@kernel.org \
--cc=bp@alien8.de \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=davem@davemloft.net \
--cc=dietmar.eggemann@arm.com \
--cc=dm-devel@redhat.com \
--cc=hpa@zytor.com \
--cc=juri.lelli@redhat.com \
--cc=kuba@kernel.org \
--cc=lizefan.x@bytedance.com \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=snitzer@redhat.com \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=viro@zeniv.linux.org.uk \
--cc=x86@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