]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
s390/mm: Add cond_resched() to cmm_alloc/free_pages()
authorGerald Schaefer <gerald.schaefer@linux.ibm.com>
Mon, 2 Sep 2024 12:02:19 +0000 (14:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:49 +0000 (15:11 +0200)
commit02e5e382885c8b9676c0da4217f7654db0284e6a
tree60e24fb43132e3f14f59b45c0efd66a7bd451130
parent4a749c14fa2b86f9b4f6457b81ee8889cf61018c
s390/mm: Add cond_resched() to cmm_alloc/free_pages()

[ Upstream commit 131b8db78558120f58c5dc745ea9655f6b854162 ]

Adding/removing large amount of pages at once to/from the CMM balloon
can result in rcu_sched stalls or workqueue lockups, because of busy
looping w/o cond_resched().

Prevent this by adding a cond_resched(). cmm_free_pages() holds a
spin_lock while looping, so it cannot be added directly to the existing
loop. Instead, introduce a wrapper function that operates on maximum 256
pages at once, and add it there.

Signed-off-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/s390/mm/cmm.c