From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0751032FA2B; Sat, 18 Apr 2026 10:56:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776509810; cv=none; b=R2VNjxbr25h5DW7rcdoYgbRdURsZRvYZNcliBwFGghIRLML7kclhwkMH8yD/bS90FKctgoSxxbt6J9rMSdSe2hcL9rCvoD0SurhMgzpJwDV7L9qNEZ++FN45c0Kb6VsuuRwbIUGB9CPIXwbesAlYWgpSGcIVM9phBzgZ3S2yqZg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776509810; c=relaxed/simple; bh=sFWBiamU2q7m5/n7ztcBEvw8CqsCL86YPiSGuyhoTb0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X8alNK4x0BJpqYqQWVj2Xa/jIaj+5AB8n1LOPGPWwsVbYelUMvAzNEyMzZpcHYkmbx3BB563L24WqmTARbObLsT47T9NV0BTTKztUWmFfcW90kqBCEK2myhfJKJ5KGvXusTE1WMFJ7qlnMdfW3xj/0v7v1oGO/hnmnkKrOZEGyA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NAQvloRX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NAQvloRX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 432E7C19424; Sat, 18 Apr 2026 10:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776509809; bh=sFWBiamU2q7m5/n7ztcBEvw8CqsCL86YPiSGuyhoTb0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NAQvloRX0/uXa6RMA9QnDw3IMSL8TO6Abaow3+hJzUQ0wuS/8WzERNsHq+nMLyMcz G89Ww2hLRA/9l1w/LK8EigH/mD9Vc7jWSHG/fSwwdsgnjRn03xOib/ggyqHEJwpz+8 j5qW0hTXkRRbm1k2KoUrXkb8Rn8pYWXsxi7a/IyvCuDdvqeB+Tzg9oH8E6phhgWAhl CzLlW2AWi3zfQ6cuWjIkCIWfH9AqXlQLarG841R1T1pV5871XGOeASRyojqfnII30K fyYePZ81i8NC6V9tUC6ec8JeZW20+TIIsKf16FHjfOIX+hReM1CKUs53iFpjB+7Sjb g2/YCGjE0lZKQ== From: Mike Rapoport To: Andrew Morton , David Hildenbrand Cc: Baolin Wang , Barry Song , Dev Jain , Donet Tom , Jason Gunthorpe , John Hubbard , "Liam R. Howlett" , Lance Yang , Leon Romanovsky , Lorenzo Stoakes , Mark Brown , Michal Hocko , Mike Rapoport , Nico Pache , Peter Xu , Ryan Roberts , Sarthak Sharma , Shuah Khan , Suren Baghdasaryan , Vlastimil Babka , Zi Yan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 10/53] selftests/mm: hugetlb_madv_vs_map: use kselftest framework Date: Sat, 18 Apr 2026 13:54:55 +0300 Message-ID: <20260418105539.1261536-11-rppt@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260418105539.1261536-1-rppt@kernel.org> References: <20260418105539.1261536-1-rppt@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Mike Rapoport (Microsoft)" Convert hugetlb_madv_vs_map test to use kselftest framework for reporting and tracking successful and failing runs. Reviewed-by: Mark Brown Signed-off-by: Mike Rapoport (Microsoft) --- .../testing/selftests/mm/hugetlb_madv_vs_map.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/mm/hugetlb_madv_vs_map.c b/tools/testing/selftests/mm/hugetlb_madv_vs_map.c index efd774b41389..c7105c6d319b 100644 --- a/tools/testing/selftests/mm/hugetlb_madv_vs_map.c +++ b/tools/testing/selftests/mm/hugetlb_madv_vs_map.c @@ -25,7 +25,6 @@ #include #include "vm_util.h" -#include "kselftest.h" #define INLOOP_ITER 100 @@ -86,12 +85,14 @@ int main(void) */ int max = 10; + ksft_print_header(); + ksft_set_plan(1); + free_hugepages = get_free_hugepages(); - if (free_hugepages != 1) { + if (free_hugepages != 1) ksft_exit_skip("This test needs one and only one page to execute. Got %lu\n", free_hugepages); - } mmap_size = default_huge_page_size(); @@ -100,10 +101,8 @@ int main(void) MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, -1, 0); - if ((unsigned long)huge_ptr == -1) { - ksft_test_result_fail("Failed to allocate huge page\n"); - return KSFT_FAIL; - } + if ((unsigned long)huge_ptr == -1) + ksft_exit_fail_msg("Failed to allocate huge page\n"); pthread_create(&thread1, NULL, madv, NULL); pthread_create(&thread2, NULL, touch, NULL); @@ -115,12 +114,13 @@ int main(void) if (ret) { ksft_test_result_fail("Unexpected huge page allocation\n"); - return KSFT_FAIL; + ksft_finished(); } /* Unmap and restart */ munmap(huge_ptr, mmap_size); } - return KSFT_PASS; + ksft_test_result_pass("No unexpected huge page allocations\n"); + ksft_finished(); } -- 2.53.0