[PATCH 2/2] reorder the partial_context initialization
From: Feng Tang
Date: Mon Oct 31 2022 - 04:19:12 EST
Signed-off-by: Feng Tang <feng.tang@xxxxxxxxx>
---
mm/slub.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 6fa3c24742b8..4265d293f4dd 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3010,6 +3010,11 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
unsigned long flags;
struct partial_context pc;
+ pc.flags = gfpflags;
+ pc.slab = &slab;
+ pc.orig_size = orig_size;
+ barrier();
+
stat(s, ALLOC_SLOWPATH);
reread_slab:
@@ -3122,9 +3127,6 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
new_objects:
- pc.flags = gfpflags;
- pc.slab = &slab;
- pc.orig_size = orig_size;
freelist = get_partial(s, node, &pc);
if (freelist)
goto check_new_slab;
--
2.34.1
--eA2WCFFyGaggxTCQ--