Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp561353rdb; Wed, 17 Jan 2024 10:03:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFuU8PdoPx/6dCEews4OzzNkKriz4KxTsTUgDP5taIEVWLDfTIS3p9z4+bxaWh+cKggZxDM X-Received: by 2002:a17:902:eb45:b0:1d5:e943:a8b3 with SMTP id i5-20020a170902eb4500b001d5e943a8b3mr2553525pli.7.1705514624746; Wed, 17 Jan 2024 10:03:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705514624; cv=pass; d=google.com; s=arc-20160816; b=x8j/QSp9JjdkqtZ5gL7zllLllRmu8ZHvrfM8BaGaHBLOUjlQ9nwzKqFw5tjpsal0Zp VFN8cqWnQuJK1LIWJ4BiRl0/wXgMlamR6MKLJr8Eb7pNSynzRQGkCiCiqzuQhDbL5Am8 /KCVjUohsbqtvj5tguT5L7a6RA91nGaaOnm1ceUDmdcUWB0YJ5wNJwUNZBZheVmbbash rf86AdaW5zRHOlAhztDhtsqNCHpRKSaO9CEZDa/q/1pCf/1mbXYt3T8zJH5kDWrRTe99 7E0wthUDh417N1NlbVVg5R0b+6V9PHCOf1RkxY0KWswC4M7DEKABdc3sRLoiTdS+6K39 dpzg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=v7mWtbZkBfydRoZ1KTKCUbcKjYFh0CTp/T1jJ9CpJ+g=; fh=0e9qypsG9fZy/kAvV0hgfXz47+yJ3CcZB/4xbyXy/74=; b=kquDPOd+/nbIeY+LpwkJWRXRNlV6Z76px5Iqxhwi83cvlM9q39hC1/9dxCct91ITQX s3enZwgkAhUI0lUSpVPmIfms4WQfev1gbKLb7XF8l+CdKRJsuIRS+rAVHSxlT07d7ykI f89CWO3X50taRdeg9bq4ArfPp1GVvm/gH9UuVL0HD0Sgr4A8yIAGOQN3wK7m0GD8JPsC YMF87KC3uLj0i0L0EfMxDSM2e6tXaHjlbv+b6dXBR3/RQT/3+cioUTldmz35zKYUcg4R oZjYe/LNeCgTR7cn3R1WTyuYP67TSFxUkOZUPyf0CgZ5FGiA1qtFd7mVUOmb984hDQeF WwzQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hayWYpGZ; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-29299-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29299-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id kg3-20020a170903060300b001d5a008e4efsi12336518plb.157.2024.01.17.10.03.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 10:03:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29299-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hayWYpGZ; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-29299-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29299-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 85D67B24351 for ; Wed, 17 Jan 2024 18:01:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C3CEB22EE3; Wed, 17 Jan 2024 18:00:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hayWYpGZ" 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 6DAAD22635 for ; Wed, 17 Jan 2024 18:00:52 +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=1705514454; cv=none; b=WYLxJIz8u1juE6zjfcyVMo+F8VQqlXfqwB1cYql9Kk167UXQBf5vYNV5vAUq11mzJvUx8Hvb2/8VtJ8ssTce/ifAfcDKCQywXqYXClX2pWi8R8LsfBiwsmLe9VG2OdsbVd9PlB1ObmkW+7LB/xK+EM5nUx4iBB5LnN17w3wMWso= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705514454; c=relaxed/simple; bh=8IXAWHXrSjNXM0FpElCzk0WtxnO106w/8hSLLnHdKKc=; h=DKIM-Signature:Received:X-MC-Unique:Received:Received:From:To:Cc: Subject:Date:Message-ID:MIME-Version:Content-Transfer-Encoding: X-Scanned-By; b=AYmly08yeJA/f4vRYnt+MHJvFIrWPE3mmm0YBk8b1J57tJuJlQz9fEq8PGmGLy327Q9VpRahNnV6MSkmQce5vDeP2NJFn3XW1EgdqCzi2V2/DAMbaHzItFoDkuzehcsao79qF6vHBN4xkvHnSsqliQ6L4PLKACcvyhOhN/2WWxo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=hayWYpGZ; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705514451; 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; bh=v7mWtbZkBfydRoZ1KTKCUbcKjYFh0CTp/T1jJ9CpJ+g=; b=hayWYpGZna3WrmdhcZPNADL1KR8MdzedixDojumMecmc5zha+wWxbSMNe8i198O59kPcly FomO4OR7JsWaiyOn08H2uoIGUrlSQVZ0dIam9rfhR3UmgWOPTwPYI8XuNwSoW8q9qlqTtS zap26jITBAGdzSSeBCSRjlt/jh+KizQ= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-346-RXAB2irYP0KW7RzaKLEjpw-1; Wed, 17 Jan 2024 13:00:49 -0500 X-MC-Unique: RXAB2irYP0KW7RzaKLEjpw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id E76851C18CD3; Wed, 17 Jan 2024 18:00:48 +0000 (UTC) Received: from localhost.redhat.com (unknown [10.22.34.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7AADA492BC6; Wed, 17 Jan 2024 18:00:48 +0000 (UTC) From: Nico Pache To: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, shuah@kernel.org Subject: [PATCH] selftests: mm: Perform some system cleanup before using hugepages Date: Wed, 17 Jan 2024 11:00:37 -0700 Message-ID: <20240117180037.15734-1-npache@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: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 When running with CATEGORY= (thp | hugetlb) we see a large numbers of tests failing. These failures are due to not being able to allocate a hugepage and normally occur on memory contrainted systems or when using large page sizes. drop_cache and compact_memory before the tests for a higher chance at a successful hugepage allocation. Signed-off-by: Nico Pache --- tools/testing/selftests/mm/run_vmtests.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index 246d53a5d7f2..040f27e21f47 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -206,6 +206,15 @@ pretty_name() { # Usage: run_test [test binary] [arbitrary test arguments...] run_test() { if test_selected ${CATEGORY}; then + # On memory constrainted systems some tests can fail to allocate hugepages. + # perform some cleanup before the test for a higher success rate. + if [ ${CATEGORY} == "thp" ] | [ ${CATEGORY} == "hugetlb" ]; then + echo 3 > /proc/sys/vm/drop_caches + sleep 2 + echo 1 > /proc/sys/vm/compact_memory + sleep 2 + fi + local test=$(pretty_name "$*") local title="running $*" local sep=$(echo -n "$title" | tr "[:graph:][:space:]" -) -- 2.43.0