Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kho: print which scratch buffer failed to be reserved

When scratch area fails to reserve, KHO prints a message indicating that.
But it doesn't say which scratch failed to allocate. This can be useful
information for debugging. Even more so when the failure is hard to
reproduce.

Along with the current message, also print which exact scratch area failed
to be reserved.

Link: https://lkml.kernel.org/r/20260116165416.1262531-1-pratyush@kernel.org
Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: David Matlack <dmatlack@google.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Pratyush Yadav <pratyush@kernel.org>
Cc: Samiullah Khawaja <skhawaja@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Pratyush Yadav (Google) and committed by
Andrew Morton
6ca9de36 08e8f1ef

+12 -4
+12 -4
kernel/liveupdate/kexec_handover.c
··· 637 637 kho_scratch_cnt = num_online_nodes() + 2; 638 638 size = kho_scratch_cnt * sizeof(*kho_scratch); 639 639 kho_scratch = memblock_alloc(size, PAGE_SIZE); 640 - if (!kho_scratch) 640 + if (!kho_scratch) { 641 + pr_err("Failed to reserve scratch array\n"); 641 642 goto err_disable_kho; 643 + } 642 644 643 645 /* 644 646 * reserve scratch area in low memory for lowmem allocations in the ··· 649 647 size = scratch_size_lowmem; 650 648 addr = memblock_phys_alloc_range(size, CMA_MIN_ALIGNMENT_BYTES, 0, 651 649 ARCH_LOW_ADDRESS_LIMIT); 652 - if (!addr) 650 + if (!addr) { 651 + pr_err("Failed to reserve lowmem scratch buffer\n"); 653 652 goto err_free_scratch_desc; 653 + } 654 654 655 655 kho_scratch[i].addr = addr; 656 656 kho_scratch[i].size = size; ··· 661 657 /* reserve large contiguous area for allocations without nid */ 662 658 size = scratch_size_global; 663 659 addr = memblock_phys_alloc(size, CMA_MIN_ALIGNMENT_BYTES); 664 - if (!addr) 660 + if (!addr) { 661 + pr_err("Failed to reserve global scratch buffer\n"); 665 662 goto err_free_scratch_areas; 663 + } 666 664 667 665 kho_scratch[i].addr = addr; 668 666 kho_scratch[i].size = size; ··· 675 669 addr = memblock_alloc_range_nid(size, CMA_MIN_ALIGNMENT_BYTES, 676 670 0, MEMBLOCK_ALLOC_ACCESSIBLE, 677 671 nid, true); 678 - if (!addr) 672 + if (!addr) { 673 + pr_err("Failed to reserve nid %d scratch buffer\n", nid); 679 674 goto err_free_scratch_areas; 675 + } 680 676 681 677 kho_scratch[i].addr = addr; 682 678 kho_scratch[i].size = size;