lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87eedac972.mognet@arm.com>
Date:   Thu, 10 Jun 2021 11:20:33 +0100
From:   Valentin Schneider <valentin.schneider@....com>
To:     Will Deacon <will@...nel.org>
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>,
        Quentin Perret <qperret@...gle.com>, Tejun Heo <tj@...nel.org>,
        Johannes Weiner <hannes@...xchg.org>,
        Ingo Molnar <mingo@...hat.com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        kernel-team@...roid.com
Subject: Re: [PATCH v8 11/19] sched: Allow task CPU affinity to be restricted on asymmetric systems

On 07/06/21 23:52, Will Deacon wrote:
> On Fri, Jun 04, 2021 at 06:12:32PM +0100, Valentin Schneider wrote:
>> On 02/06/21 17:47, Will Deacon wrote:
>> > +	/*
>> > +	 * Forcefully restricting the affinity of a deadline task is
>> > +	 * likely to cause problems, so fail and noisily override the
>> > +	 * mask entirely.
>> > +	 */
>> > +	if (task_has_dl_policy(p) && dl_bandwidth_enabled()) {
>> > +		err = -EPERM;
>> > +		goto err_unlock;
>> > +	}
>> > +
>> > +	if (!cpumask_and(new_mask, &p->cpus_mask, subset_mask)) {
>> > +		err = -EINVAL;
>> > +		goto err_unlock;
>> > +	}
>> > +
>> > +	/*
>> > +	 * We're about to butcher the task affinity, so keep track of what
>> > +	 * the user asked for in case we're able to restore it later on.
>> > +	 */
>> > +	if (user_mask) {
>> > +		cpumask_copy(user_mask, p->cpus_ptr);
>> > +		p->user_cpus_ptr = user_mask;
>> > +	}
>> > +
>>
>> Shouldn't that be done before any of the bailouts above, so we can
>> potentially restore the mask even if we end up forcefully expanding the
>> affinity?
>
> I don't think so. I deliberately only track the old mask if we've managed
> to take a subset for the 32-bit task. If we end up having to override the
> mask entirely, then I treat it the same way as an explicit affinity change
> (only with a warning printed) and don't then try to restore the old mask --
> it feels like we'd be overriding the affinity twice if we tried to do that.
>

Put in this way, it does make sense to me. Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ