Re: [PATCH] pseries/hotplug-memory: remove dlpar_memory_{add,remove}_by_index() functions

From: Nathan Lynch
Date: Mon Feb 10 2020 - 15:29:01 EST


Scott Cheloha <cheloha@xxxxxxxxxxxxx> writes:
> The dlpar_memory_{add,remove}_by_index() functions are just special
> cases of their dlpar_memory_{add,remove}_by_ic() counterparts where
> the LMB count is 1.

I wish that were the case, but there are (gratuitous?) differences:

- dlpar_memory_remove_by_ic() checks DRCONF_MEM_RESERVED and
DRCONF_MEM_ASSIGNED flags; dlpar_memory_remove_by_index() does not.
- dlpar_memory_remove_by_ic() attempts to roll back failed removal;
dlpar_memory_remove_by_index() does not.

I'm not sure how much either of these gets used in practice. AFAIK the
usual HMC/drmgr-driven workflow tends to exercise
dlpar_memory_remove_by_count().

I agree this code needs consolidation, but we should proceed a little
carefully because it's likely going to entail changing some user-visible
behaviors.