Skip to content

Commit 06e0e62

Browse files
btw616jmberg-intel
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 5bfc4a3 commit 06e0e62

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/um/kernel/um_arch.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,8 @@ int __init linux_main(int argc, char **argv, char **envp)
376376
iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK;
377377

378378
max_physmem = TASK_SIZE - uml_physmem - iomem_size - MIN_VMALLOC;
379-
380-
if (physmem_size + iomem_size > max_physmem) {
381-
physmem_size = max_physmem - iomem_size;
379+
if (physmem_size > max_physmem) {
380+
physmem_size = max_physmem;
382381
os_info("Physical memory size shrunk to %llu bytes\n",
383382
physmem_size);
384383
}

0 commit comments

Comments
 (0)