[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <baf4b8d9-5801-45a8-d92a-be45a918e855@redhat.com>
Date: Wed, 16 Jun 2021 15:24:10 +0200
From: Daniel Bristot de Oliveira <bristot@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>
Cc: Borislav Petkov <bp@...en8.de>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, Jens Axboe <axboe@...nel.dk>,
Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...hat.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Felipe Balbi <balbi@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Tejun Heo <tj@...nel.org>, Zefan Li <lizefan.x@...edance.com>,
Johannes Weiner <hannes@...xchg.org>,
Jason Wessel <jason.wessel@...driver.com>,
Daniel Thompson <daniel.thompson@...aro.org>,
Douglas Anderson <dianders@...omium.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Pavel Machek <pavel@....cz>, Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>,
Boqun Feng <boqun.feng@...il.com>,
Oleg Nesterov <oleg@...hat.com>,
Davidlohr Bueso <dave@...olabs.net>,
"Paul E. McKenney" <paulmck@...nel.org>,
Josh Triplett <josh@...htriplett.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
Joel Fernandes <joel@...lfernandes.org>,
John Stultz <john.stultz@...aro.org>,
Stephen Boyd <sboyd@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: [PATCH v2 7/7] sched: Change task_struct::state
On 6/11/21 10:28 AM, Peter Zijlstra wrote:
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -348,10 +348,10 @@ static void task_non_contending(struct t
> if ((zerolag_time < 0) || hrtimer_active(&dl_se->inactive_timer)) {
> if (dl_task(p))
> sub_running_bw(dl_se, dl_rq);
> - if (!dl_task(p) || p->state == TASK_DEAD) {
> + if (!dl_task(p) || READ_ONCE(p->__state) == TASK_DEAD) {
> struct dl_bw *dl_b = dl_bw_of(task_cpu(p));
>
> - if (p->state == TASK_DEAD)
> + if (READ_ONCE(p->__state) == TASK_DEAD)
> sub_rq_bw(&p->dl, &rq->dl);
> raw_spin_lock(&dl_b->lock);
> __dl_sub(dl_b, p->dl.dl_bw, dl_bw_cpus(task_cpu(p)));
> @@ -1355,10 +1355,10 @@ static enum hrtimer_restart inactive_tas
> sched_clock_tick();
> update_rq_clock(rq);
>
> - if (!dl_task(p) || p->state == TASK_DEAD) {
> + if (!dl_task(p) || READ_ONCE(p->__state) == TASK_DEAD) {
> struct dl_bw *dl_b = dl_bw_of(task_cpu(p));
>
> - if (p->state == TASK_DEAD && dl_se->dl_non_contending) {
> + if (READ_ONCE(p->__state) == TASK_DEAD && dl_se->dl_non_contending) {
> sub_running_bw(&p->dl, dl_rq_of_se(&p->dl));
> sub_rq_bw(&p->dl, dl_rq_of_se(&p->dl));
> dl_se->dl_non_contending = 0;
> @@ -1722,7 +1722,7 @@ static void migrate_task_rq_dl(struct ta
> {
> struct rq *rq;
>
> - if (p->state != TASK_WAKING)
> + if (READ_ONCE(p->__state) != TASK_WAKING)
> return;
>
> rq = task_rq(p);
Reviewed-by: Daniel Bristot de Oliveira <bristot@...hat.com>
Feel free to add it to the other patches as well.
Thanks!
-- Daniel
Powered by blists - more mailing lists