[RFC 25/26] mm, slub: use migrate_disable() in put_cpu_partial()
From: Vlastimil Babka
Date: Mon May 24 2021 - 19:42:06 EST
In put_cpu_partial, we need a stable cpu, but being preempted is not an issue.
So, disable migration instead of preemption.
Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx>
---
mm/slub.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index bfa5e7c4da1b..8818c210cb97 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2417,7 +2417,7 @@ static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain)
int pages;
int pobjects;
- preempt_disable();
+ migrate_disable();
do {
pages = 0;
pobjects = 0;
@@ -2451,7 +2451,7 @@ static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain)
if (unlikely(!slub_cpu_partial(s)))
unfreeze_partials(s);
- preempt_enable();
+ migrate_enable();
#endif /* CONFIG_SLUB_CPU_PARTIAL */
}
--
2.31.1