From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DCA3B47CC8E; Mon, 5 Oct 2026 11:12:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791198754; cv=none; b=B00OvLOYGEbZf9EivyPWFdT3eaD5c9QaxIm/I2gih9IcOEJs8SQKI8//7uENP/I7uGsu869sZotGnMd5jO9RwSej0xoCfYVFaY+aAozUKXUgnp7yIVpQPr2ePSWqK3SQkvJUq8FPSUuXg0Nl7gHLKmoqO3VlhnBNOSuBuUk8yyE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791198754; c=relaxed/simple; bh=MEZ3+wQPyUj1ckIQWi+S/NiOG90urc2hAt/8uUoF0i4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tbyXBQNNVkSsXyFegX444TYRzjOKEksfIIlj++y7ukDQoYrNYf+pkpGjnNX0r8GSa65fVxeXKAZAvyHZm6VQueJ0TWdYBdr18rzAZA83Ep5N+HFv5Lv1pkwi4uLuTTHVVXVA7y48536qBA2RlfcEA9rm+TztVPMZ4/ixSDUNd3Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=DiAmdi5c; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="DiAmdi5c" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 74D60152B; Mon, 5 Oct 2026 04:12:28 -0700 (PDT) Received: from [10.164.19.84] (a081061.arm.com [10.164.19.84]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0B1E33F86F; Mon, 5 Oct 2026 04:12:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1791198751; bh=MEZ3+wQPyUj1ckIQWi+S/NiOG90urc2hAt/8uUoF0i4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=DiAmdi5cLAEzN4qUXoEyyBne5c2jWgZqTfITHQYH+W3s110u1+BSV4Bz3tXPmX99m TJWwBfGj/ceU7duWZCm7oID2NfY4ENQhfXBNeQMwJOXRIUGM+DJ/atEaav4avPLiHY K1EmaZH8Y5GxZMy/3SsdVdjY6phLG2JyrY4LDeyw= Message-ID: Date: Mon, 5 Oct 2026 16:42:25 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] selftests/mm: hugetlb_madv_vs_map: fix TAP plan mismatches To: Jaeyeon Lee , Andrew Morton , Guillaume Morin Cc: David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Shuah Khan , Breno Leitao , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261004230018.190880-1-jaeyeon.lee.dev@gmail.com> Content-Language: en-US From: Sarthak Sharma In-Reply-To: <20261004230018.190880-1-jaeyeon.lee.dev@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Jaeyeon! On 10/5/26 4:30 AM, Jaeyeon Lee wrote: > The plan was raised from 1 to 3, but the HugeTLB setup check that may > call ksft_exit_skip() still runs after ksft_set_plan(), so a setup > failure reports one result against a plan of 3. Move ksft_set_plan() > below the setup check. > > Also, when the underflow check fails, or munmap() fails, > test_underflow() jumps to err_cleanup and exits without reporting the > remaining results. Report the munmap() failure as a test result and > skip the final HugePages_Rsvd check in err_cleanup, so the output > always contains the planned 3 results. > > Fixes: 827149aad495 ("selftests/mm: hugetlb_madv_vs_map: add underflow test") > Assisted-by: LLM > Signed-off-by: Jaeyeon Lee > --- > tools/testing/selftests/mm/hugetlb_madv_vs_map.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/mm/hugetlb_madv_vs_map.c b/tools/testing/selftests/mm/hugetlb_madv_vs_map.c > index 1d111f42dd59..5dc44ff0a377 100644 > --- a/tools/testing/selftests/mm/hugetlb_madv_vs_map.c > +++ b/tools/testing/selftests/mm/hugetlb_madv_vs_map.c > @@ -169,6 +169,7 @@ void test_underflow(void) > /* First unmap, this will close the vma */ > if (munmap(huge_ptr, mmap_size) != 0) { > ksft_perror("munmap failed"); > + ksft_test_result_fail("munmap failed\n"); This is duplicating the "munmap failed" message. Can we simply put a ksft_test_result_fail("munmap failed: %s (%d)\n", strerror(errno), errno) here? Also, please send your patch in a new thread instead of replying on another thread from next time onwards :) > goto err_cleanup; > } > > @@ -203,18 +204,20 @@ void test_underflow(void) > if (waitpid(pid, NULL, 0) <= 0) > ksft_exit_fail_perror("waitpid failed"); > > + ksft_test_result_skip("HugePages_Rsvd check after child exit\n"); > ksft_exit_fail(); > } > > int main(void) > { > ksft_print_header(); > - ksft_set_plan(3); > > if (!hugetlb_setup_default_exact(1)) > ksft_exit_skip("This test needs one and only one page to execute. Got %lu\n", > hugetlb_free_default_pages()); > > + ksft_set_plan(3); > + > test_madv_vs_map(); > test_underflow(); >