diff options
author | Michael Kelley <mhklinux@outlook.com> | 2024-05-03 08:43:12 -0700 |
---|---|---|
committer | Wei Liu <wei.liu@kernel.org> | 2024-05-28 05:26:01 +0000 |
commit | 8852ebf1948d94ecaf4d1113032dda7e58e72b84 (patch) | |
tree | e0c10d92518583b3f27962afeaa24cda4e8ac546 /tools/hv/Makefile | |
parent | bb3ca38ef7aa56dcfa7f6e81675c7a39d5ee9bf1 (diff) |
hv_balloon: Enable hot-add for memblock sizes > 128 MiB
The Hyper-V balloon driver supports hot-add of memory in addition
to ballooning. Current code hot-adds in fixed size chunks of
128 MiB (fixed constant HA_CHUNK in the code). While this works
in Hyper-V VMs with 64 GiB or less or memory where the Linux
memblock size is 128 MiB, the hot-add fails for larger memblock
sizes because add_memory() expects memory to be added in chunks
that match the memblock size. Messages like the following are
reported when Linux has a 256 MiB memblock size:
[ 312.668859] Block size [0x10000000] unaligned hotplug range:
start 0x310000000, size 0x8000000
[ 312.668880] hv_balloon: hot_add memory failed error is -22
[ 312.668984] hv_balloon: Memory hot add failed
Larger memblock sizes are usually used in VMs with more than
64 GiB of memory, depending on the alignment of the VM's
physical address space.
Fix this problem by having the Hyper-V balloon driver determine
the Linux memblock size, and process hot-add requests in that
chunk size instead of a fixed 128 MiB. Also update the hot-add
alignment requested of the Hyper-V host to match the memblock
size.
The code changes look significant, but in fact are just a
simple text substitution of a new global variable for the
previous HA_CHUNK constant. No algorithms are changed except
to initialize the new global variable and to calculate the
alignment value to pass to Hyper-V. Testing with memblock
sizes of 256 MiB and 2 GiB shows correct operation.
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/20240503154312.142466-2-mhklinux@outlook.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <20240503154312.142466-2-mhklinux@outlook.com>
Diffstat (limited to 'tools/hv/Makefile')
0 files changed, 0 insertions, 0 deletions