Merge tag 'mm-hotfixes-stable-2025-08-21-18-17' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc fixes from Andrew Morton: "20 hotfixes. 10 are cc:stable and the remainder address post-6.16 issues or aren't considered necessary for -stable kernels. 17 of these fixes are for MM. As usual, singletons all over the place, apart from a three-patch series of KHO followup work from Pasha which is actually also a bunch of singletons" * tag 'mm-hotfixes-stable-2025-08-21-18-17' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mm/mremap: fix WARN with uffd that has remap events disabled mm/damon/sysfs-schemes: put damos dests dir after removing its files mm/migrate: fix NULL movable_ops if CONFIG_ZSMALLOC=m mm/damon/core: fix damos_commit_filter not changing allow mm/memory-failure: fix infinite UCE for VM_PFNMAP pfn MAINTAINERS: mark MGLRU as maintained mm: rust: add page.rs to MEMORY MANAGEMENT - RUST iov_iter: iterate_folioq: fix handling of offset >= folio size selftests/damon: fix selftests by installing drgn related script .mailmap: add entry for Easwar Hariharan selftests/mm: add test for invalid multi VMA operations mm/mremap: catch invalid multi VMA moves earlier mm/mremap: allow multi-VMA move when filesystem uses thp_get_unmapped_area mm/damon/core: fix commit_ops_filters by using correct nth function tools/testing: add linux/args.h header and fix radix, VMA tests mm/debug_vm_pgtable: clear page table entries at destroy_args() squashfs: fix memory leak in squashfs_fill_super kho: warn if KHO is disabled due to an error kho: mm: don't allow deferred struct page with KHO kho: init new_physxa->phys_bits to fix lockdep
This commit is contained in:
@@ -97,6 +97,7 @@ config KEXEC_JUMP
|
||||
config KEXEC_HANDOVER
|
||||
bool "kexec handover"
|
||||
depends on ARCH_SUPPORTS_KEXEC_HANDOVER && ARCH_SUPPORTS_KEXEC_FILE
|
||||
depends on !DEFERRED_STRUCT_PAGE_INIT
|
||||
select MEMBLOCK_KHO_SCRATCH
|
||||
select KEXEC_FILE
|
||||
select DEBUG_FS
|
||||
|
||||
+25
-4
@@ -144,14 +144,34 @@ static int __kho_preserve_order(struct kho_mem_track *track, unsigned long pfn,
|
||||
unsigned int order)
|
||||
{
|
||||
struct kho_mem_phys_bits *bits;
|
||||
struct kho_mem_phys *physxa;
|
||||
struct kho_mem_phys *physxa, *new_physxa;
|
||||
const unsigned long pfn_high = pfn >> order;
|
||||
|
||||
might_sleep();
|
||||
|
||||
physxa = xa_load_or_alloc(&track->orders, order, sizeof(*physxa));
|
||||
if (IS_ERR(physxa))
|
||||
return PTR_ERR(physxa);
|
||||
physxa = xa_load(&track->orders, order);
|
||||
if (!physxa) {
|
||||
int err;
|
||||
|
||||
new_physxa = kzalloc(sizeof(*physxa), GFP_KERNEL);
|
||||
if (!new_physxa)
|
||||
return -ENOMEM;
|
||||
|
||||
xa_init(&new_physxa->phys_bits);
|
||||
physxa = xa_cmpxchg(&track->orders, order, NULL, new_physxa,
|
||||
GFP_KERNEL);
|
||||
|
||||
err = xa_err(physxa);
|
||||
if (err || physxa) {
|
||||
xa_destroy(&new_physxa->phys_bits);
|
||||
kfree(new_physxa);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
physxa = new_physxa;
|
||||
}
|
||||
}
|
||||
|
||||
bits = xa_load_or_alloc(&physxa->phys_bits, pfn_high / PRESERVE_BITS,
|
||||
sizeof(*bits));
|
||||
@@ -544,6 +564,7 @@ err_free_scratch_areas:
|
||||
err_free_scratch_desc:
|
||||
memblock_free(kho_scratch, kho_scratch_cnt * sizeof(*kho_scratch));
|
||||
err_disable_kho:
|
||||
pr_warn("Failed to reserve scratch area, disabling kexec handover\n");
|
||||
kho_enable = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user