[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1604121137470.14315@east.gentwo.org>
Date: Tue, 12 Apr 2016 11:38:39 -0500 (CDT)
From: Christoph Lameter <cl@...ux.com>
To: js1304@...il.com
cc: Andrew Morton <akpm@...ux-foundation.org>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Jesper Dangaard Brouer <brouer@...hat.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Joonsoo Kim <iamjoonsoo.kim@....com>
Subject: Re: [PATCH v2 01/11] mm/slab: fix the theoretical race by holding
proper lock
On Tue, 12 Apr 2016, js1304@...il.com wrote:
> @@ -2222,6 +2241,7 @@ static void drain_cpu_caches(struct kmem_cache *cachep)
> {
> struct kmem_cache_node *n;
> int node;
> + LIST_HEAD(list);
>
> on_each_cpu(do_drain, cachep, 1);
> check_irq_on();
> @@ -2229,8 +2249,13 @@ static void drain_cpu_caches(struct kmem_cache *cachep)
> if (n->alien)
> drain_alien_cache(cachep, n->alien);
>
> - for_each_kmem_cache_node(cachep, node, n)
> - drain_array(cachep, n, n->shared, 1, node);
> + for_each_kmem_cache_node(cachep, node, n) {
> + spin_lock_irq(&n->list_lock);
> + drain_array_locked(cachep, n->shared, node, true, &list);
> + spin_unlock_irq(&n->list_lock);
> +
> + slabs_destroy(cachep, &list);
Can the slabs_destroy() call be moved outside of the loop? It may be
faster then?
Powered by blists - more mailing lists