slub: Keep track of whether slub is on the per-node partial list
authorChengming Zhou <zhouchengming@bytedance.com>
Thu, 2 Nov 2023 03:23:24 +0000 (03:23 +0000)
committerVlastimil Babka <vbabka@suse.cz>
Wed, 22 Nov 2023 14:36:25 +0000 (15:36 +0100)
commit8a399e2f60037ed07a55278e39b20e43dea4f0c2
tree582b006faaae0f1a0ecff398ebe86b1b3510a878
parent43c4c349149c77f27c8e5801755a7b8883a70ebe
slub: Keep track of whether slub is on the per-node partial list

Now we rely on the "frozen" bit to see if we should manipulate the
slab->slab_list, which will be changed in the following patch.

Instead we introduce another way to keep track of whether slub is on
the per-node partial list, here we reuse the PG_workingset bit.

We have to use the atomic set_bit() and clear_bit() variants and change
slab_unlock() to bit_spin_unlock() because when cmpxchg is not available
and PG_lock is used, there may be concurrent operations on the two bits.
Thanks to Mark Brown for reporting a hang and testing of a previous
version where the non-atomic operations were used.

Suggested-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/slub.c