author: Vlastimil Babka <vbabka@suse.cz> 2021-06-03 19:17:42 +0200
committer: Vlastimil Babka <vbabka@suse.cz> 2021-09-04 01:12:22 +0200
commit: 08beb547a1f7b66fbeaf40f2d3675a3ea0060c0b
parent: 0e7ac738f785e695acfa1203a87f6a505305542a
Commit Summary:
Diffstat:
1 file changed, 9 insertions, 2 deletions
diff --git a/mm/slub.c b/mm/slub.c
index c4a9b8901576..fa9a366d2d9c 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2511,9 +2511,17 @@ static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c)
static inline void __flush_cpu_slab(struct kmem_cache *s, int cpu)
{
struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu);
+ void *freelist = c->freelist;
+ struct page *page = c->page;
- if (c->page)
- flush_slab(s, c);
+ c->page = NULL;
+ c->freelist = NULL;
+ c->tid = next_tid(c->tid);
+
+ if (page) {
+ deactivate_slab(s, page, freelist);
+ stat(s, CPUSLAB_FLUSH);
+ }
unfreeze_partials_cpu(s, c);
}