[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201119164412.GE4582@willie-the-truck>
Date: Thu, 19 Nov 2020 16:44:13 +0000
From: Will Deacon <will@...nel.org>
To: Quentin Perret <qperret@...gle.com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-arch@...r.kernel.org,
linux-kernel@...r.kernel.org,
Catalin Marinas <catalin.marinas@....com>,
Marc Zyngier <maz@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Morten Rasmussen <morten.rasmussen@....com>,
Qais Yousef <qais.yousef@....com>,
Suren Baghdasaryan <surenb@...gle.com>,
Tejun Heo <tj@...nel.org>, Li Zefan <lizefan@...wei.com>,
Johannes Weiner <hannes@...xchg.org>,
Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
kernel-team@...roid.com
Subject: Re: [PATCH v3 11/14] sched: Reject CPU affinity changes based on
arch_cpu_allowed_mask()
On Thu, Nov 19, 2020 at 02:30:12PM +0000, Quentin Perret wrote:
> On Thursday 19 Nov 2020 at 11:07:24 (+0000), Will Deacon wrote:
> > Yeah, the cpuset code ignores the return value of set_cpus_allowed_ptr() in
> > update_tasks_cpumask() so the failure won't be propagated, but then again I
> > think that might be the right thing to do. Nothing prevents 32-bit and
> > 64-bit tasks from co-existing in the same cpuseti afaict, so forcing the
> > 64-bit tasks onto the 32-bit-capable cores feels much worse than the
> > approach taken here imo.
>
> Ack. And thinking about it more, failing the cgroup operation wouldn't
> guarantee that the task's affinity and the cpuset are aligned anyway. We
> could still exec into a 32 bit task from within a 64 bit-only cpuset.
>
> > The interesting case is what happens if the cpuset for a 32-bit task is
> > changed to contain only the 64-bit-only cores. I think that's a userspace
> > bug
>
> Maybe, but I think Android will do exactly that in some cases :/
>
> > but the fallback rq selection should avert disaster.
>
> I thought _this_ patch was 'fixing' this case by making the cpuset
> operation pretty much a nop on the task affinity? The fallback rq stuff
> is all about hotplug no?
Yeah, sorry, I wasn't clear. This patch postpones disaster until hotplug
off time, when cpuset_cpus_allowed_fallback() will fail and
select_fallback_rq() will have to step in.
Will
Powered by blists - more mailing lists