Re: [PATCH 1/1] formatdomain.html.in: mention pSeries NVDIMM 'align down' mechanic
Hi, On 7/22/20 5:05 AM, Andrea Bolognani wrote: On Mon, 2020-07-20 at 13:51 -0300, Daniel Henrique Barboza wrote: + the remaining size (total-size - label-size), also called guest +area, will be aligned to 4KiB as default. For pSeries guests, the +guest area will be aligned down to 256MiB, and the minimum size +of the guest area must be at least 256MiB plus the label-size. The last part of the sentence seems contradictory: earlier you define the guest area to be the total size minus the label size, but then you say that the guest area must be at least 256MiB plus the label size. I suggest remove the trailing "plus the label-size". Are you okay with me doing that before pushing? If so, then Reviewed-by: Andrea Bolognani I'm ok with it. Thanks for amending it! Anyway, while it's good to have these requirements documented, I believe we need to rethink our approach to NVDIMMs a bit, as the current behavior is confusing and full of potential pitfalls. Ideally, we'd drop the automatic alignment step which happens at guest startup time and replace it with an upfront check on the constraints: if the user tries to use a NVDIMM module that's not sized or aligned properly, they'd get an error telling them that the value they're trying to use is not good and suggesting a rounded up alternative. This is similar with the approach I was taking in earlier versions of the feature. The thing that I wasn't doing was suggesting an aligned alternative, which makes all the difference when you think of it. This way the size seen in the guest XML will reflect the one used at runtime, which is much less confusing than the existin behavior, and also the user will be able to create the backing file for the NVDIMM to be the exact size it needs to be instead of oversizing it. If we can't get this to work without impacting existing guests, then at the very least we should try to reflect the rounded down size in the inactive guest XML instead of waiting for guest startup. This is not as nice as the alternative, because it requires the user to actively seek the adjuste value, but still better than what we have right now. This looks good to me. I also suggest that we take this approach solely on pSeries guests. x86 has a way shorter alignment (2MiB vs 256MiB) in a sense that the user isn't even aware of the automatic rounding down. Thanks, DHB
Re: [PATCH 1/1] formatdomain.html.in: mention pSeries NVDIMM 'align down' mechanic
On Mon, 2020-07-20 at 13:51 -0300, Daniel Henrique Barboza wrote: > + the remaining size (total-size - label-size), also called > guest > +area, will be aligned to 4KiB as default. For pSeries > guests, the > +guest area will be aligned down to 256MiB, and the minimum > size > +of the guest area must be at least 256MiB plus the > label-size. The last part of the sentence seems contradictory: earlier you define the guest area to be the total size minus the label size, but then you say that the guest area must be at least 256MiB plus the label size. I suggest remove the trailing "plus the label-size". Are you okay with me doing that before pushing? If so, then Reviewed-by: Andrea Bolognani Anyway, while it's good to have these requirements documented, I believe we need to rethink our approach to NVDIMMs a bit, as the current behavior is confusing and full of potential pitfalls. Ideally, we'd drop the automatic alignment step which happens at guest startup time and replace it with an upfront check on the constraints: if the user tries to use a NVDIMM module that's not sized or aligned properly, they'd get an error telling them that the value they're trying to use is not good and suggesting a rounded up alternative. This way the size seen in the guest XML will reflect the one used at runtime, which is much less confusing than the existin behavior, and also the user will be able to create the backing file for the NVDIMM to be the exact size it needs to be instead of oversizing it. If we can't get this to work without impacting existing guests, then at the very least we should try to reflect the rounded down size in the inactive guest XML instead of waiting for guest startup. This is not as nice as the alternative, because it requires the user to actively seek the adjuste value, but still better than what we have right now. -- Andrea Bolognani / Red Hat / Virtualization
[PATCH 1/1] formatdomain.html.in: mention pSeries NVDIMM 'align down' mechanic
The reason why we align down the guest area (total-size - label-size) is explained in the body of qemuDomainNVDimmAlignSizePseries(). This behavior must also be documented in the user docs. Signed-off-by: Daniel Henrique Barboza --- docs/formatdomain.html.in | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index f5ee97de81..af6c809ddd 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -9412,8 +9412,10 @@ qemu-kvm -net nic,model=? /dev/null the minimum label size is 128KiB, - the remaining size (total-size - label-size) will be aligned -to 4KiB as default. + the remaining size (total-size - label-size), also called guest +area, will be aligned to 4KiB as default. For pSeries guests, the +guest area will be aligned down to 256MiB, and the minimum size +of the guest area must be at least 256MiB plus the label-size. -- 2.26.2