From nobody Tue Apr 7 18:01:02 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 38F163C4566 for ; Thu, 12 Mar 2026 11:27:25 +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=1773314846; cv=none; b=b1hwiwtQIeb7CU0xR434PBNf66b+yihBqftUYnpAZzsUQAiqS0C2CUx+py1bc+Qwcvr0uLJ4tOPlcXzSjyl1yqWkshCmNgYG0JX7iqG1GGhRONQLmkPvVgoF5Fmj49Z+PtpMMPDvLNUnodYVoRng6jPz1UYhY5p5Cb2mn/0kVC4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773314846; c=relaxed/simple; bh=e0qvEWr+SSEH4j0vaCh0CP61XRiN4Et7YLSwqxXb7Ck=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ajOZZyK57pp6JxcCXgEd48D5pp6aydbOisRYPpYjwqn3woEj+sF3XOguWfQrGzPrdC/gnxO0unsE/tGT3CSL8CNnYJPvXgotncFnrfBQBRHhsHAvHr8eVg5PNPj0ZilYPQ8PJCQie4itvjMxYycSzIHlxeVkHyxcxlm1U+gxXY8= 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=DymMYA+0; 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="DymMYA+0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773314844; 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=3FFU11Mi0bBXwJKlMBJvhw89oPXuQQ6MnaqLH21R0oM=; b=DymMYA+0pigV68vZQOZ1JjtBBv9w91EeZLbWcdjQWfneGCLqXvZCXYE2BjWa+2StewcpK5 CREUDLED2R9J5Pyv0nCvRsWbisbLVZt8UQWKThFMM0O57nuwVuRgo6w158itgHZ4GI4YIA GxdZf40IuC2b6RsKlgCukiaGygJHdjs= 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-564-tHREChPZPU6BNpVLybN1bA-1; Thu, 12 Mar 2026 07:27:20 -0400 X-MC-Unique: tHREChPZPU6BNpVLybN1bA-1 X-Mimecast-MFC-AGG-ID: tHREChPZPU6BNpVLybN1bA_1773314837 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 8A52E180034F; Thu, 12 Mar 2026 11:27:17 +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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4AD0A1800351; Thu, 12 Mar 2026 11:27:07 +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 4/4] selftests/mm: transhuge_stress: skip the test when thp not available Date: Thu, 12 Mar 2026 19:26:12 +0800 Message-ID: <20260312112612.633138-6-chuhu@redhat.com> In-Reply-To: <20260312112612.633138-1-chuhu@redhat.com> References: <20260312112612.633138-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.4.1 on 10.30.177.111 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 # -------------------------------- # 1..0 # SKIP Transparent Hugepages not available # [SKIP] ok 5 transhuge-stress -d 20 # SKIP CC: Li Wang Signed-off-by: Chunyu Hu --- 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..76316696426d 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; @@ -35,6 +36,9 @@ int main(int argc, char **argv) int pagemap_fd; int duration =3D 0; =20 + if (!thp_is_enabled()) + ksft_exit_skip("Transparent Hugepages not available\n"); + ksft_print_header(); =20 ram =3D sysconf(_SC_PHYS_PAGES); --=20 2.53.0