This is a note to let you know that I've just added the patch titled KVM: selftests: do not require 64GB in set_memory_region_test to the 5.13-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: kvm-selftests-do-not-require-64gb-in-set_memory_region_test.patch and it can be found in the queue-5.13 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From cd4220d23bf3f43cf720e82bdee681f383433ae2 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger <borntraeger@xxxxxxxxxx> Date: Thu, 1 Jul 2021 17:42:24 +0200 Subject: KVM: selftests: do not require 64GB in set_memory_region_test From: Christian Borntraeger <borntraeger@xxxxxxxxxx> commit cd4220d23bf3f43cf720e82bdee681f383433ae2 upstream. Unless the user sets overcommit_memory or has plenty of swap, the latest changes to the testcase will result in ENOMEM failures for hosts with less than 64GB RAM. As we do not use much of the allocated memory, we can use MAP_NORESERVE to avoid this error. Cc: Zenghui Yu <yuzenghui@xxxxxxxxxx> Cc: vkuznets@xxxxxxxxxx Cc: wanghaibin.wang@xxxxxxxxxx Cc: stable@xxxxxxxxxxxxxxx Fixes: 309505dd5685 ("KVM: selftests: Fix mapping length truncation in m{,un}map()") Tested-by: Zenghui Yu <yuzenghui@xxxxxxxxxx> Link: https://lore.kernel.org/kvm/20210701160425.33666-1-borntraeger@xxxxxxxxxx/ Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- tools/testing/selftests/kvm/set_memory_region_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/set_memory_region_test.c b/tools/testing/selftests/kvm/set_memory_region_test.c index d8812f27648c..d31f54ac4e98 100644 --- a/tools/testing/selftests/kvm/set_memory_region_test.c +++ b/tools/testing/selftests/kvm/set_memory_region_test.c @@ -377,7 +377,8 @@ static void test_add_max_memory_regions(void) (max_mem_slots - 1), MEM_REGION_SIZE >> 10); mem = mmap(NULL, (size_t)max_mem_slots * MEM_REGION_SIZE + alignment, - PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); TEST_ASSERT(mem != MAP_FAILED, "Failed to mmap() host"); mem_aligned = (void *)(((size_t) mem + alignment - 1) & ~(alignment - 1)); -- 2.32.0 Patches currently in stable-queue which might be from borntraeger@xxxxxxxxxx are queue-5.13/kvm-selftests-do-not-require-64gb-in-set_memory_region_test.patch