diff options
author | Tiwei Bie <tiwei.btw@antgroup.com> | 2024-11-28 11:19:39 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2025-01-10 15:49:33 +0300 |
commit | 06e0e6295957592cfceaa21124a49b55c98470c9 (patch) | |
tree | 032b971f48046119091a631d9b1c812d2292ced2 /arch/um/kernel | |
parent | 5bfc4a3a0af3dcf53516e5f0dd9a2649bcd05bad (diff) | |
download | linux-06e0e6295957592cfceaa21124a49b55c98470c9.tar.xz |
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 <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20241128081939.2216246-4-tiwei.btw@antgroup.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'arch/um/kernel')
-rw-r--r-- | arch/um/kernel/um_arch.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 8037a967225d..c82e26baefc4 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); } |