sched_ext: Use kvzalloc for large exit_dump allocation
authorBreno Leitao <leitao@debian.org>
Tue, 8 Apr 2025 16:50:42 +0000 (09:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:59:05 +0000 (07:59 +0200)
commit28401a63c01abd6f754c4cd513c6946aecc0a06f
treec5884a7f08ec490bcc97ffc27e83442508235936
parent30c0d6e778da74308303ba82c13dc51e0a25ccc3
sched_ext: Use kvzalloc for large exit_dump allocation

commit 47068309b5777313b6ac84a77d8d10dc7312260a upstream.

Replace kzalloc with kvzalloc for the exit_dump buffer allocation, which
can require large contiguous memory depending on the implementation.
This change prevents allocation failures by allowing the system to fall
back to vmalloc when contiguous memory allocation fails.

Since this buffer is only used for debugging purposes, physical memory
contiguity is not required, making vmalloc a suitable alternative.

Cc: stable@vger.kernel.org
Fixes: 07814a9439a3b0 ("sched_ext: Print debug dump after an error exit")
Suggested-by: Rik van Riel <riel@surriel.com>
Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/sched/ext.c