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 1EBC4382379; Mon, 6 Apr 2026 14:22:29 +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=1775485350; cv=none; b=bJBit7SHGKupCbHR5zyaK6Ne2oIKyU/8Pu/hlQWUjygaXygp0YUl/m5bFxf0POq/gPFaJK+o8WC5tR/Nwk2gdzVlr9i4ArONrNiGjxzLR3CQ32VFoJw2Na5r9oeBc7KnvqhRneLYp4+CWZeOTotODt5Q0KuOCPjt/bVSxBBLGSU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775485350; c=relaxed/simple; bh=HtpaUkBbB7ijuw6rctcgEdxPGwj4VxmBP6AvOyp0uHE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ggDM1fQDl7IZV2866sCZehzRGdxA3XMzU7YQZDeeAnkJqtIk9aBTzMMYPNGIMikIMdhfRM6alFwYhFX907xuez/zMK89C/zEwxu8fIcayEUFhyoQUfM7VzSVPt8lzH7v+o1dwcapALKuPmZ4pwvNMaY/KW7hK3+xa+X22jMBaXQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TF6tEmT4; 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="TF6tEmT4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82C65C4CEF7; Mon, 6 Apr 2026 14:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775485349; bh=HtpaUkBbB7ijuw6rctcgEdxPGwj4VxmBP6AvOyp0uHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TF6tEmT40RH2kGrtuZAt24+jBc0o5j7vcOmyMvGR9T0mxP6K0eLAhbyCN4X1nA6OS nEEoZvaemSaPAWM21Nkl3+WNZgmNvC1gwpBpv8490Wbh5cbb+e+bgvUKbnAR+VkhOl 3ux38WwEk7d2SCxDEsK9QwK+UQ8Cm603XgTOr6IdWpAjkKNhLxt2R5Kz7B01lCwtrX UBtcM6Irm+1F7denqZNEghot7G3mjLTJ446YuOk0kYO44tCBZJ7ygblrUDFeDGbZcU 9b2ShSGbfziy7ItIYBg93yF/2oSu8EfLkHbR2VmLrQ4AkgQpvGi6/A7aXHvwMpcyJL +y5ajsMM7FeMg== From: Mike Rapoport To: Andrew Morton , David Hildenbrand Cc: Baolin Wang , Barry Song , Dev Jain , 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 , Shuah Khan , Suren Baghdasaryan , Vlastimil Babka , Zi Yan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 49/53] selftests/mm: uffd-wp-mremap: add setup of HugeTLB pages Date: Mon, 6 Apr 2026 17:17:31 +0300 Message-ID: <20260406141735.2179309-50-rppt@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260406141735.2179309-1-rppt@kernel.org> References: <20260406141735.2179309-1-rppt@kernel.org> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Mike Rapoport (Microsoft)" uffd-wp-remap skips HugeTLB tests if there are no free huge pages prepared by a wrapper script. Add setup of HugeTLB pages to the test and make sure that the original settings are restored on the test exit. Signed-off-by: Mike Rapoport (Microsoft) --- tools/testing/selftests/mm/uffd-wp-mremap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/mm/uffd-wp-mremap.c b/tools/testing/selftests/mm/uffd-wp-mremap.c index 9d67b11c2f28..f63fe02f404f 100644 --- a/tools/testing/selftests/mm/uffd-wp-mremap.c +++ b/tools/testing/selftests/mm/uffd-wp-mremap.c @@ -336,14 +336,14 @@ int main(int argc, char **argv) struct thp_settings settings; int i, j, plan = 0; + hugepage_save_settings(true, true); + pagesize = getpagesize(); nr_thpsizes = detect_thp_sizes(thpsizes, ARRAY_SIZE(thpsizes)); - nr_hugetlbsizes = detect_hugetlb_page_sizes(hugetlbsizes, - ARRAY_SIZE(hugetlbsizes)); + nr_hugetlbsizes = hugetlb_setup(1, hugetlbsizes, ARRAY_SIZE(hugetlbsizes)); /* If THP is supported, save THP settings and initially disable THP. */ if (nr_thpsizes) { - thp_save_settings(); thp_read_settings(&settings); for (i = 0; i < NR_ORDERS; i++) { settings.hugepages[i].enabled = THP_NEVER; -- 2.53.0