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] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+PUx8M6mrsMilZg@smile.fi.intel.com>
Date:   Wed, 8 Feb 2023 18:58:47 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Yury Norov <yury.norov@...il.com>
Cc:     Pawel Chmielewski <pawel.chmielewski@...el.com>,
        Jonathan.Cameron@...wei.com, baohua@...nel.org, bristot@...hat.com,
        bsegall@...gle.com, davem@...emloft.net, dietmar.eggemann@....com,
        gal@...dia.com, gregkh@...uxfoundation.org, hca@...ux.ibm.com,
        jacob.e.keller@...el.com, jesse.brandeburg@...el.com,
        jgg@...dia.com, juri.lelli@...hat.com, kuba@...nel.org,
        leonro@...dia.com, linux-crypto@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-rdma@...r.kernel.org,
        linux@...musvillemoes.dk, mgorman@...e.de, mingo@...hat.com,
        netdev@...r.kernel.org, peter@...jl.ca, peterz@...radead.org,
        rostedt@...dmis.org, saeedm@...dia.com, tariqt@...dia.com,
        tony.luck@...el.com, torvalds@...ux-foundation.org,
        ttoukan.linux@...il.com, vincent.guittot@...aro.org,
        vschneid@...hat.com
Subject: Re: [PATCH 1/1] ice: Change assigning method of the CPU affinity
 masks

On Wed, Feb 08, 2023 at 08:39:20AM -0800, Yury Norov wrote:
> On Wed, Feb 08, 2023 at 04:39:05PM +0100, Pawel Chmielewski wrote:

...

> > +	v_idx = 0;
> > +	for_each_numa_hop_mask(aff_mask, numa_node) {
> > +		for_each_cpu_andnot(cpu, aff_mask, last_aff_mask)
> > +			if (v_idx < vsi->num_q_vectors) {
> > +				if (cpu_online(cpu))
> > +					cpumask_set_cpu(cpu, &vsi->q_vectors[v_idx]->affinity_mask);
> > +				v_idx++;
> > +			}

>                         else
>                                 goto out;

In this case the inverted conditional makes more sense:

			if (v_idx >= vsi->num_q_vectors)
				goto out;

			if (cpu_online(cpu))
				cpumask_set_cpu(cpu, &vsi->q_vectors[v_idx]->affinity_mask);
			v_idx++;

(indentation level will be decreased).

> > +		last_aff_mask = aff_mask;
> > +	}
> > +
>         out:
> 
> >  	return 0;

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ