]> git.baikalelectronics.ru Git - kernel.git/commit
sparc64: simplify reduce_memory() function
authorMike Rapoport <rppt@linux.ibm.com>
Tue, 12 Feb 2019 09:32:36 +0000 (11:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 May 2019 21:26:17 +0000 (14:26 -0700)
commit7f46c480b587cac3e3e162055525a3bd617b0f2f
tree432421c225e82793c7318b9773b73495893be1d6
parentfc70a505a343d3283db1fe0ad5e4af0629d2a57d
sparc64: simplify reduce_memory() function

The reduce_memory() function clampls the available memory to a limit
defined by the "mem=" command line parameter. It takes into account the
amount of already reserved memory and excludes it from the limit
calculations.

Rather than traverse memblocks and remove them by hand, use
memblock_reserved_size() to account the reserved memory and
memblock_enforce_memory_limit() to clamp the available memory.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/mm/init_64.c