diff options
author | Daniel Henrique Barboza <danielhb413@gmail.com> | 2021-06-22 15:39:22 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-06-24 16:07:09 +0200 |
commit | c2aaddcc65b343fad4ed184e625abd3e68f63b9b (patch) | |
tree | 3f405e6e28b72d69af83b2d36f7ae054479788e0 /arch/riscv | |
parent | powerpc/pseries: skip reserved LMBs in dlpar_memory_add_by_count() (diff) | |
download | linux-c2aaddcc65b343fad4ed184e625abd3e68f63b9b.tar.xz linux-c2aaddcc65b343fad4ed184e625abd3e68f63b9b.zip |
powerpc/pseries: break early in dlpar_memory_add_by_count() loops
After a successful dlpar_add_lmb() call the LMB is marked as reserved.
Later on, depending whether we added enough LMBs or not, we rely on
the marked LMBs to see which ones might need to be removed, and we
remove the reservation of all of them.
These are done in for_each_drmem_lmb() loops without any break
condition. This means that we're going to check all LMBs of the partition
even after going through all the reserved ones.
This patch adds break conditions in both loops to avoid this. The
'lmbs_added' variable was renamed to 'lmbs_reserved', and it's now
being decremented each time a lmb reservation is removed, indicating
if there are still marked LMBs to be processed.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210622133923.295373-3-danielhb413@gmail.com
Diffstat (limited to 'arch/riscv')
0 files changed, 0 insertions, 0 deletions