From: Tiwei Bie Date: Thu, 28 Nov 2024 08:19:39 +0000 (+0800) Subject: um: Count iomem_size only once in physmem calculation X-Git-Tag: v6.14-rc1~25^2~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=06e0e6295957592cfceaa21124a49b55c98470c9;p=thirdparty%2Fkernel%2Flinux.git um: Count iomem_size only once in physmem calculation When calculating max_physmem, we've already factored in the space used by iomem. We don't need to subtract it again. Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20241128081939.2216246-4-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 8037a967225d8..c82e26baefc4f 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -376,9 +376,8 @@ int __init linux_main(int argc, char **argv, char **envp) iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK; max_physmem = TASK_SIZE - uml_physmem - iomem_size - MIN_VMALLOC; - - if (physmem_size + iomem_size > max_physmem) { - physmem_size = max_physmem - iomem_size; + if (physmem_size > max_physmem) { + physmem_size = max_physmem; os_info("Physical memory size shrunk to %llu bytes\n", physmem_size); }