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]
Date:   Mon, 18 Jul 2022 23:24:57 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Tariq Toukan <ttoukan.linux@...il.com>
Cc:     Tariq Toukan <tariqt@...dia.com>,
        "David S. Miller" <davem@...emloft.net>,
        Saeed Mahameed <saeedm@...dia.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Ingo Molnar <mingo@...hat.com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>,
        Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
        Gal Pressman <gal@...dia.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next V2 2/2] net/mlx5e: Improve remote NUMA
 preferences used for the IRQ affinity hints

On Mon, Jul 18, 2022 at 10:49:21PM +0300, Tariq Toukan wrote:

> > > +	first = cpumask_local_spread(0, dev->priv.numa_node);
> > 
> > Arguably you want something like:
> > 
> > 	first = cpumask_any(cpumask_of_node(dev->priv.numa_node));
> 
> Any doesn't sound like what I'm looking for, I'm looking for first.
> I do care about the order within the node, so it's more like
> cpumask_first(cpumask_of_node(dev->priv.numa_node));
> 
> Do you think this has any advantage over cpumask_local_spread, if used only
> during the setup phase of the driver?

Only for the poor sod trying to read this code ;-) That is, I had no
idea what cpumask_local_spread() does, while cpumask_first() is fairly
obvious.

> > > @@ -830,8 +887,7 @@ static int comp_irqs_request(struct mlx5_core_dev *dev)
> > >   		ret = -ENOMEM;
> > >   		goto free_irqs;
> > >   	}
> > > -	for (i = 0; i < ncomp_eqs; i++)
> > > -		cpus[i] = cpumask_local_spread(i, dev->priv.numa_node);
> > > +	mlx5_set_eqs_cpus(dev, cpus, ncomp_eqs);
> > 
> > So you change this for mlx5, what about the other users of
> > cpumask_local_spread() ?
> 
> I took a look at the different netdev users.
> While some users have similar use case to ours (affinity hints), many others
> use cpumask_local_spread in other flows (XPS setting, ring allocations,
> etc..).
> 
> Moving them to use the newly exposed API needs some deeper dive into their
> code, especially due to the possible undesired side-effects.
> 
> I prefer not to include these changes in my series for now, but probably
> contribute it in a followup work.

Fair enough.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ