From nobody Mon Mar 23 21:36:17 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 87F853B3888 for ; Mon, 23 Mar 2026 15:19:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774279149; cv=none; b=N2WjaS4CHQySP+Uf1sHFLx5/VkyqTVbxsToxgzc3gvlV7sfV09J6hm5pileN6Outgp3xm6TGpHpA9mHwG5lvJzfy0Fn5yJt0SpHBetY6j4ZnMp3lzwK7fzCq8Syd9XBpIfbgdWSJcq2LZtN+9yN1jJFbOsoRGKkZqtjpCkQQt9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774279149; c=relaxed/simple; bh=0ZNjKjARdZvcdL31QoVs+UqP+O/z4+0bO2/UPGbm13o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EpauqajZtAtfnFSTxiKofT/pGQS09QIC5efXd6UUMR23UtPETp75TlrTtIKHhfsdVNdsxFM0Cks+HYhLncF3PUN2UMJrWDQ72THDm6ZXgrPmRyZmpO8PiZ7cG8j1A9KHfHajyCy6fCHheEJ6BdWuOHMf5Zn7Hm+ncbsvBkPewcw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=hLTWXGC8; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hLTWXGC8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774279147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z5cQUZey16cto7EAHb0l8lICJnDidIXEapbKPGxTzr4=; b=hLTWXGC8ns4HAIaYMjypBMSLOfpKwISXxGKVOp4v/hiWBsY4M6FGDPYZMVrf+bfWDJtN6E KHE6ZL+QvKwZKb30ZQ31WwPPL2JJAkmZwSoCxj+Hq5P0+d/1Ep/sle0ktDvCptwrjCBk1R RTeybtM5TVG6iUfLP0ZDdp2fDoO3K6s= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-160-ZWzrsvwjNu6mzhFNQTtqkQ-1; Mon, 23 Mar 2026 11:19:02 -0400 X-MC-Unique: ZWzrsvwjNu6mzhFNQTtqkQ-1 X-Mimecast-MFC-AGG-ID: ZWzrsvwjNu6mzhFNQTtqkQ_1774279140 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5B52518002D0; Mon, 23 Mar 2026 15:19:00 +0000 (UTC) Received: from dell-per7425-02.rhts.eng.pek2.redhat.com (dell-per7425-02.rhts.eng.pek2.redhat.com [10.73.116.18]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1B93E1955D71; Mon, 23 Mar 2026 15:18:51 +0000 (UTC) From: Chunyu Hu To: akpm@linux-foundation.org, david@kernel.org, shuah@kernel.org, linux-mm@kvack.org, ljs@kernel.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, ziy@nvidia.com, baolin.wang@linux.alibaba.com, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev, chuhu@redhat.com, Li Wang Subject: [PATCH v5 6/6] selftests/mm: transhuge_stress: skip the test when thp not available Date: Mon, 23 Mar 2026 23:17:53 +0800 Message-ID: <20260323151753.2576137-7-chuhu@redhat.com> In-Reply-To: <20260323151753.2576137-1-chuhu@redhat.com> References: <20260323151753.2576137-1-chuhu@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Type: text/plain; charset="utf-8" The test requires thp, skip the test when thp is not available to avoid false positive. Tested with thp disabled kernel. Before the fix: # -------------------------------- # running ./transhuge-stress -d 20 # -------------------------------- # TAP version 13 # 1..1 # transhuge-stress: allocate 1453 transhuge pages, using 2907 MiB virtual= memory and 11 MiB of ram # Bail out! MADV_HUGEPAGE# Planned tests !=3D run tests (1 !=3D 0) # # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:0 error:0 # [FAIL] not ok 60 transhuge-stress -d 20 # exit=3D1 After the fix: # -------------------------------- # running ./transhuge-stress -d 20 # -------------------------------- # TAP version 13 # 1..0 # SKIP Transparent Hugepages not available # [SKIP] ok 5 transhuge-stress -d 20 # SKIP Acked-by: David Hildenbrand (Arm) Reviewed-by: Mike Rapoport (Microsoft) Reviewed-by: Lorenzo Stoakes (Oracle) Reviewed-by: Zi Yan CC: Li Wang Signed-off-by: Chunyu Hu --- V3 changes: - Add review by from Mike - Add acked-by from David V2 changes: - Move the exit chunk to the front of ksft_print_headers() as suggested by David. - Add reviewed by from Zi and Lorenzo --- tools/testing/selftests/mm/transhuge-stress.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/mm/transhuge-stress.c b/tools/testing/= selftests/mm/transhuge-stress.c index bcad47c09518..7a9f1035099b 100644 --- a/tools/testing/selftests/mm/transhuge-stress.c +++ b/tools/testing/selftests/mm/transhuge-stress.c @@ -17,6 +17,7 @@ #include #include "vm_util.h" #include "kselftest.h" +#include "thp_settings.h" =20 int backing_fd =3D -1; int mmap_flags =3D MAP_ANONYMOUS | MAP_NORESERVE | MAP_PRIVATE; @@ -37,6 +38,9 @@ int main(int argc, char **argv) =20 ksft_print_header(); =20 + if (!thp_is_enabled()) + ksft_exit_skip("Transparent Hugepages not available\n"); + ram =3D sysconf(_SC_PHYS_PAGES); if (ram > SIZE_MAX / psize() / 4) ram =3D SIZE_MAX / 4; --=20 2.53.0