slub: tidy up initialization ordering
Subsystems (2)
[email protected]
maintainerPATCH 13/119 slub: tidy up initialization ordering
From: Alexander Potapenko <[email protected]>
Subject: slub: tidy up initialization ordering
- free_kmem_cache_nodes() frees the cache node before nulling out a reference to it
- init_kmem_cache_nodes() publishes the cache node before initializing it
Neither of these matter at runtime because the cache nodes cannot be looked up by any other thread. But it's neater and more consistent to reorder these.
Signed-off-by Alexander Potapenko <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc David Rientjes <[email protected]>
Cc Joonsoo Kim <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/slub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/slub.c renamed from mm/slub.c~slub-make-sure-struct-kmem_cache_node-is-initialized-before-publication +2 -2
@@ -3358,8 +3358,8 @@ static void free_kmem_cache_nodes(structstruct kmem_cache_node *n;for_each_kmem_cache_node (s, node, n) { -kmem_cache_free (kmem_cache_node, n); s->node[node] =NULL ; +kmem_cache_free (kmem_cache_node, n); } }
@@ -3389,8 +3389,8 @@ static int init_kmem_cache_nodes(structreturn 0 ; } - s->node[node] = n;init_kmem_cache_node (n); + s->node[node] = n; }return 1 ; }
_