mm, slab: periodically resched in drain_freelist()
authorDavid Rientjes <rientjes@google.com>
Wed, 28 Dec 2022 06:05:48 +0000 (22:05 -0800)
committerVlastimil Babka <vbabka@suse.cz>
Mon, 2 Jan 2023 08:31:05 +0000 (09:31 +0100)
commitcc2e9d2b26c86c1dd8687f6916e5f621bcacd6f7
tree51af4df8df89ddb5322e276d1ec57648268893ef
parent88603b6dc419445847923fcb7fe5080067a30f98
mm, slab: periodically resched in drain_freelist()

drain_freelist() can be called with a very large number of slabs to free,
such as for kmem_cache_shrink(), or depending on various settings of the
slab cache when doing periodic reaping.

If there is a potentially long list of slabs to drain, periodically
schedule to ensure we aren't saturating the cpu for too long.

Signed-off-by: David Rientjes <rientjes@google.com>
Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/slab.c