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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <yi422qqkfhf23x4wekpycxmsjodbwcw7aw2avjfh37dkapocg7@f7nn3mtdldbq>
Date: Fri, 8 Mar 2024 10:42:29 -0500
From: Daniel Jordan <daniel.m.jordan@...cle.com>
To: Gang Li <gang.li@...ux.dev>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
        David Hildenbrand <david@...hat.com>,
        David Rientjes <rientjes@...gle.com>,
        Muchun Song <muchun.song@...ux.dev>,
        Tim Chen <tim.c.chen@...ux.intel.com>,
        Steffen Klassert <steffen.klassert@...unet.com>,
        Jane Chu <jane.chu@...cle.com>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        Randy Dunlap <rdunlap@...radead.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, ligang.bdlg@...edance.com
Subject: Re: [PATCH v6 4/8] padata: dispatch works on different nodes

Hello Gang,

On Tue, Mar 05, 2024 at 10:49:47AM +0800, Gang Li wrote:
> On 2024/2/28 05:24, Daniel Jordan wrote:
> > On Thu, Feb 22, 2024 at 10:04:17PM +0800, Gang Li wrote:
> > > @@ -517,7 +518,16 @@ void __init padata_do_multithreaded(struct padata_mt_job *job)
> > >   	ps.chunk_size = roundup(ps.chunk_size, job->align);
> > >   	list_for_each_entry(pw, &works, pw_list)
> > > -		queue_work(system_unbound_wq, &pw->pw_work);
> > > +		if (job->numa_aware) {
> > > +			int old_node = atomic_read(&last_used_nid);
> > > +
> > > +			do {
> > > +				nid = next_node_in(old_node, node_states[N_CPU]);
> > > +			} while (!atomic_try_cmpxchg(&last_used_nid, &old_node, nid));
> > 
> > There aren't concurrent NUMA-aware _do_multithreaded calls now, so an
> > atomic per work seems like an unnecessary expense for guarding against
> 
> Hi Daniel,
> 
> Yes, this is not necessary. But I think this operation is infrequent, so
> the burden shouldn't be too great?

I can only guess, but I bet you're right.  It's also that people might
wonder what the atomic guards against, so non-atomic would make the code
a bit easier to understand.  Either way, looks fine.

Acked-by: Daniel Jordan <daniel.m.jordan@...cle.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ