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: <20200120085849.GA21740@ming.t460p>
Date:   Mon, 20 Jan 2020 16:58:49 +0800
From:   Ming Lei <ming.lei@...hat.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Peter Xu <peterx@...hat.com>,
        Juri Lelli <juri.lelli@...hat.com>
Subject: Re: [PATCH V3] sched/isolation: isolate from handling managed
 interrupt

Hello Thomas,

On Sun, Jan 19, 2020 at 05:50:17PM +0100, Thomas Gleixner wrote:
> Ming,
> 
> Ming Lei <ming.lei@...hat.com> writes:
> >  
> > +static bool hk_should_isolate(struct irq_data *data,
> > +		const struct cpumask *affinity, unsigned int cpu)
> 
> Please align the first argument on the second line with the first
> argument on the first line.
> 
> > +{
> > +	const struct cpumask *hk_mask;
> > +
> > +	if (!housekeeping_enabled(HK_FLAG_MANAGED_IRQ))
> > +		return false;
> > +
> > +	if (!irqd_affinity_is_managed(data))
> > +		return false;
> 
> Pointless. That's already checked at the begin of the calling function.
> 
> > +
> > +	if (!cpumask_test_cpu(cpu, affinity))
> > +		return false;
> 
> Ditto.
> 
> > +	hk_mask = housekeeping_cpumask(HK_FLAG_MANAGED_IRQ);
> > +	if (cpumask_subset(affinity, hk_mask))
> > +		return false;
> > +
> > +	if (cpumask_intersects(irq_data_get_effective_affinity_mask(data),
> > +				hk_mask))
> 
> I really had to think twice why this is correct. The example I gave you
> is far more intuitive. It's just missing the check below.

Your example uses isolation mask, which has to be allocated and built
from housekeeping_cpumask(HK_FLAG_MANAGED_IRQ), that is why I use the
above way so that we can avoid the allocation.

IMO, the above is intuitive too, given it can be thought as effective
affinity including hk CPUs.

Thanks,
Ming

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ