From: Valentin Schneider <valentin.schneider@arm.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Scott Wood <swood@redhat.com>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
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>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] sched: __set_cpus_allowed_ptr(): Check cpus_mask, not cpus_ptr
Date: Thu, 18 Jun 2020 09:51:18 +0100 [thread overview]
Message-ID: <jhj366seozd.mognet@arm.com> (raw)
In-Reply-To: <20200618080700.cig4x4y7n3thmneu@linutronix.de>
On 18/06/20 09:07, Sebastian Andrzej Siewior wrote:
> On 2020-06-17 17:49:48 [-0500], Scott Wood wrote:
>> > Makes sense, but what about the rest of the checks? Further down there is
>> >
>> > /* Can the task run on the task's current CPU? If so, we're done
>> > */
>> > if (cpumask_test_cpu(task_cpu(p), new_mask))
>> > goto out;
>> >
>> > If the task is currently migrate disabled and for some stupid reason it
>> > gets affined elsewhere, we could try to move it out - which AFAICT we
>> > don't
>> > want to do because migrate disabled. So I suppose you'd want an extra
>> > bailout condition here when the task is migrate disabled.
>> >
>> > ISTR in RT you do re-check the affinity and potentially move the task away
>> > when re-enabling migration, so that should work out all fine.
>>
>> On RT the above test is:
>>
>> /* Can the task run on the task's current CPU? If so, we're done */
>> if (cpumask_test_cpu(task_cpu(p), new_mask) ||
>> p->cpus_ptr != &p->cpus_mask)
>> goto out;
>>
>> ...so we do bail out if we're migrate disabled.
>
> correct. There is a complete migrate_disable() patch in the RT queue
> which has to wait. This patch however looked to be independent of that
> and could "fix" the pointer part which is already here so I sent it.
>
Okay, thanks. I don't see any harm in including that extra check with the
patch, but either way:
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
>> -Scott
>
> Sebastian
next prev parent reply other threads:[~2020-06-18 8:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-17 12:17 [PATCH] sched: __set_cpus_allowed_ptr(): Check cpus_mask, not cpus_ptr Sebastian Andrzej Siewior
2020-06-17 14:15 ` Valentin Schneider
2020-06-17 22:49 ` Scott Wood
2020-06-18 8:07 ` Sebastian Andrzej Siewior
2020-06-18 8:51 ` Valentin Schneider [this message]
2020-06-23 7:19 ` [tip: sched/urgent] " tip-bot2 for Scott Wood
2020-06-23 8:48 ` [tip: sched/urgent] sched/core: Check cpus_mask, not cpus_ptr in __set_cpus_allowed_ptr(), to fix mask corruption tip-bot2 for Scott Wood
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=jhj366seozd.mognet@arm.com \
--to=valentin.schneider@arm.com \
--cc=bigeasy@linutronix.de \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=swood@redhat.com \
--cc=tglx@linutronix.de \
--cc=vincent.guittot@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.