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: 07814a9439 ("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
30c0d6e778
commit
28401a63c0
@@ -4530,7 +4530,7 @@ unlock:
|
||||
|
||||
static void free_exit_info(struct scx_exit_info *ei)
|
||||
{
|
||||
kfree(ei->dump);
|
||||
kvfree(ei->dump);
|
||||
kfree(ei->msg);
|
||||
kfree(ei->bt);
|
||||
kfree(ei);
|
||||
@@ -4546,7 +4546,7 @@ static struct scx_exit_info *alloc_exit_info(size_t exit_dump_len)
|
||||
|
||||
ei->bt = kcalloc(SCX_EXIT_BT_LEN, sizeof(ei->bt[0]), GFP_KERNEL);
|
||||
ei->msg = kzalloc(SCX_EXIT_MSG_LEN, GFP_KERNEL);
|
||||
ei->dump = kzalloc(exit_dump_len, GFP_KERNEL);
|
||||
ei->dump = kvzalloc(exit_dump_len, GFP_KERNEL);
|
||||
|
||||
if (!ei->bt || !ei->msg || !ei->dump) {
|
||||
free_exit_info(ei);
|
||||
|
||||
Reference in New Issue
Block a user