From patchwork Mon Mar 6 16:09:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 13161675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F397C64EC4 for ; Mon, 6 Mar 2023 16:09:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAADE6B0071; Mon, 6 Mar 2023 11:09:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A33336B0072; Mon, 6 Mar 2023 11:09:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8ADD56B0073; Mon, 6 Mar 2023 11:09:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 7758B6B0071 for ; Mon, 6 Mar 2023 11:09:26 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3CF7BAAA5A for ; Mon, 6 Mar 2023 16:09:26 +0000 (UTC) X-FDA: 80538958332.15.7097FDD Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by imf20.hostedemail.com (Postfix) with ESMTP id 545501C0028 for ; Mon, 6 Mar 2023 16:09:21 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=sent.com header.s=fm1 header.b=NusjyYLc; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=T6I4O+s0; dmarc=pass (policy=none) header.from=sent.com; spf=pass (imf20.hostedemail.com: domain of zi.yan@sent.com designates 64.147.123.19 as permitted sender) smtp.mailfrom=zi.yan@sent.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678118961; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=XRO8Do199obI6zA36V/kT6yPqF9RqFZuXH+nYQYRKNc=; b=Xi/ChTadYffkM4b6DqE8Zp/7EiVOE5puFxf0um3+fyV52UznP3XeH4FxoFlzl72xQ7dQGz 2KGpFWuJRrIGGQhrWye4Z0MVi1vsXEnxzCCzT0fj1PnBjGScw70dn/LF1EC1jgx6LSC78s LK0PlJgaZW0ch5mBAQ+FZSyz5Vsbf4k= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=sent.com header.s=fm1 header.b=NusjyYLc; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=T6I4O+s0; dmarc=pass (policy=none) header.from=sent.com; spf=pass (imf20.hostedemail.com: domain of zi.yan@sent.com designates 64.147.123.19 as permitted sender) smtp.mailfrom=zi.yan@sent.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678118961; a=rsa-sha256; cv=none; b=g2G8xp+aDIxMMWK+22tKgO//WUDySeIqGVAVPUl64viMh07muxa7XhBYScVy1/pyPYmAqf rpOjwDLY7VzZwUJRwWF7snWn0P/elaEpqcJUUwUCuLvguQDnUA/o4XFZMhfzlqsHPLa9+K YB232hPl1lxGx/FgyFCSmm0Un9CU0U0= Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 6A16932007CF; Mon, 6 Mar 2023 11:09:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 06 Mar 2023 11:09:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:reply-to:sender :subject:subject:to:to; s=fm1; t=1678118959; x=1678205359; bh=XR O8Do199obI6zA36V/kT6yPqF9RqFZuXH+nYQYRKNc=; b=NusjyYLc/7OA3juj4B 6dCU1nz3WCEgpzuPH3rl5sULYqlX+QQXjpUs4B+a0t2Ps3wd2Cj+4EgMCgKkcwHQ LJwC3mPu33p+jwC+XJhwXmXQuzlv3xEJo0aoq34UE+5gpZErn79gL2qtkDzDT4h5 pEldO6OKHojQqkTNi/K1SeMKmI18gPB9gTXWZ+VoWnYpqYCmYH7lL1HGq0vQNOO7 m+JMqOp1H7xfENi8/fFgf0g8Im6iH38VOfSKvhpckK3y9mWB0GUr9DlEI8oxqOiA yvyuRFGy/Gh5WoHYaokyxQr4zyROY+x9/32eHw8dKh4TGmTUYETL4XACU6aouHUb uWBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1678118959; x=1678205359; bh=X RO8Do199obI6zA36V/kT6yPqF9RqFZuXH+nYQYRKNc=; b=T6I4O+s0y64Cq32Mj 22Jy8qk2PviPfAm9KK+/F+MW7vXTKV+qaugy9TlEYpKEPvfrAQZQUVp9pC1QObWO deoabPG0Ks9nRMhWbAFpze2NYJF8evgea0y2iJbX6XBoGeywidsg/Jmx0rqsKzg+ vtHT19GK+z3SFYBN+C5WV88A83Cgj/k/uG+VDWTAg30uaD0R6goKR2vF79lryn1P VFSlqOM/XpeYkh2Az44FrRYgFakMlJ/0ZNnZfBc8YrswXehuqF2urMtG+uN+4TBm j0BiUOoM6+u9toD7q7Ar7BsBcrKvy0K3MTRL7ownN9QzpdwiP97838UdIrUw4Uo1 qfPZQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddtkedgheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofhrggfgsedtqhertdertddtnecuhfhrohhmpegkihcujggr nhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpedtgffhtd etledtkeeihfefueeuhedvudfhvdeifeevtdektdetgfeiieejuefhtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeiiihdrhigrnhesshgvnh htrdgtohhm X-ME-Proxy: Feedback-ID: iccd040f4:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Mar 2023 11:09:18 -0500 (EST) From: Zi Yan To: Andrew Morton , linux-mm@kvack.org Cc: Zi Yan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan , Zach O'Keefe Subject: [PATCH] selftests/mm: fix split huge page tests Date: Mon, 6 Mar 2023 11:09:07 -0500 Message-Id: <20230306160907.16804-1-zi.yan@sent.com> X-Mailer: git-send-email 2.39.2 Reply-To: Zi Yan MIME-Version: 1.0 X-Rspamd-Queue-Id: 545501C0028 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: yjkp7z9bnn5p49ddxtszrk33r3z7bra1 X-HE-Tag: 1678118961-74703 X-HE-Meta: U2FsdGVkX1/LDKI4zaygP/i4L2y+aBeT5hcx2kqIV0bL12bBHNT0RgtEKzJ3dzPtJx/D33GQOXCfV+kGlZOB2oVLF4fvuQGj+/zxsZuSeDfLXVgwRtjjKvNsq9sSoMUZaaIz2rmo74rpf9G37il/YTVbALqcBhtXS0Ow6dnVTV8PMO1rcLJitGb3fH2FwbYMD5yAVbAsLID+w4Yqlee7Gg65LoN3Ja/2zmRHPDOIzAzjxGkWK5+pb3EgZrHwHL9HpAAuenHKkNH0w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qMig+uIpawwD8BypGAEvZlt7hCR7SbmHJl/P5pHjyn/aOhYalk+RqOvVdP6nWcENH7M4V4bwWsGX7h8kXLfG7ibv+57XRkxvU9set/bYk/+cuq X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Zi Yan Fixed two inputs to check_anon_huge() and one if condition, so the tests work as expected. Fixes: c07c343cda8e ("selftests/vm: dedup THP helpers") Signed-off-by: Zi Yan Cc: Zach O'Keefe Reviewed-by: Zach O'Keefe Tested-by: Zach O'Keefe Acked-by: David Hildenbrand --- tools/testing/selftests/mm/split_huge_page_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index 76e1c36dd9e5..b8558c7f1a39 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -106,7 +106,7 @@ void split_pmd_thp(void) for (i = 0; i < len; i++) one_page[i] = (char)i; - if (!check_huge_anon(one_page, 1, pmd_pagesize)) { + if (!check_huge_anon(one_page, 4, pmd_pagesize)) { printf("No THP is allocated\n"); exit(EXIT_FAILURE); } @@ -122,7 +122,7 @@ void split_pmd_thp(void) } - if (check_huge_anon(one_page, 0, pmd_pagesize)) { + if (!check_huge_anon(one_page, 0, pmd_pagesize)) { printf("Still AnonHugePages not split\n"); exit(EXIT_FAILURE); } @@ -169,7 +169,7 @@ void split_pte_mapped_thp(void) for (i = 0; i < len; i++) one_page[i] = (char)i; - if (!check_huge_anon(one_page, 1, pmd_pagesize)) { + if (!check_huge_anon(one_page, 4, pmd_pagesize)) { printf("No THP is allocated\n"); exit(EXIT_FAILURE); }