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:   Thu, 10 Jun 2021 11:36:36 +0300
From:   Cyrill Gorcunov <gorcunov@...il.com>
To:     Vlastimil Babka <vbabka@...e.cz>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Christoph Lameter <cl@...ux.com>,
        David Rientjes <rientjes@...gle.com>,
        Pekka Enberg <penberg@...nel.org>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Thomas Gleixner <tglx@...utronix.de>,
        Mel Gorman <mgorman@...hsingularity.net>,
        Jesper Dangaard Brouer <brouer@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Jann Horn <jannh@...gle.com>
Subject: Re: [RFC v2 29/34] mm: slub: Move flush_cpu_slab() invocations
 __free_slab() invocations out of IRQ context

On Thu, Jun 10, 2021 at 10:32:14AM +0200, Vlastimil Babka wrote:
> >>  static void flush_all(struct kmem_cache *s)
> >>  {
> >> -	on_each_cpu_cond(has_cpu_slab, flush_cpu_slab, s, 1);
> >> +	struct slub_flush_work *sfw;
> >> +	unsigned int cpu;
> >> +
> >> +	cpus_read_lock();
> >> +	mutex_lock(&flush_lock);
> >> +
> > 
> > Hi, Vlastimil! Could you please point why do you lock cpus first and
> > mutex only after? Why not mutex_lock + cpus_read_lock instead?
> 
> Good question! I must admit I didn't think about it much and just followed the
> order that was in the original Sebastian's patch [1]
> But there was a good reason for this order as some paths via
> __kmem_cache_shutdown() and __kmem_cache_shrink() were alreadu called under
> cpus_read_lock. Meanwhile mainline (me, actually) removed those, so now it
> doesn't seem to be a need to keep this order anymore and we could switch it.

I bet we should switch :) But we can do that on top later, once series is
settled down and merged.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ