Message ID | 20240125154608.720072-6-usama.anjum@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-38847-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:e09d:b0:103:945f:af90 with SMTP id gm29csp65181dyb; Thu, 25 Jan 2024 07:48:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2lpn3ibzfYcChChcfETLweal3Oz8QHoYUzr6H96qLQ1JNg/deu+ID9eG+wbEwnkkz3aPs X-Received: by 2002:a17:907:d50a:b0:a2f:ba66:d6fb with SMTP id wb10-20020a170907d50a00b00a2fba66d6fbmr762487ejc.136.1706197725799; Thu, 25 Jan 2024 07:48:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706197725; cv=pass; d=google.com; s=arc-20160816; b=stTmL7MJpPStmmUnR75RSa+183+F1BRZc45iVoShsW8gnN+2J3k9pH27uW1Ma1Po+W JXAsVqayNbfwY5qOD2xqBeYjgqjgAH4lWk24y8KRhzmchMo4U462bLSPWoW7w22K6g3t 0+B0n1hVGpjHf8rI+4ZUWbPwnT9ih7DWS3I8mgiYqFlPxvYHWXnhB1rPfetujQmuZ8Ap nRKhjKPt3ClCsNbzJb4phG7u6XOdtMvFYpAWq0KvGyN18R8fbH62BDV8h13nNPAo20Dt gz7YjpVDfSN/4TyDAHJSVjv5j/eg1qOWYI7/0crcwaCSFQuHDFf3hE79W0RZNcHirpP3 XTXA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=h31klViYMkbxGI9sbm0zz7BUsw1UOXfpklv23HIiovU=; fh=GI+QUBHPqwETgj91+OjmAHfGmBmxeZg5KGm08En4mD4=; b=l4fAHGvxFxDTIOjSyxO6ABwVXto/ngdGDwInbDzQEUHxlo5br8+u+AxP/MflSbqhxv IeVUsvRNJ/S5XDxQPKyH2JnhrtVWBpmkqhEIkB6sh1p/K8F7aPRmZms9I4EtPrwWRhfp E8hgn7Ta2M4LxB6s8+d+vzBYb7lyF2q1vywRU3LEGtnkReMYAOBU3Yp76q0xufWE1hXn NayT5WOcF70p5fcf9+JTpt5qSshJRmZLlFqFCNRXYLVRLB2YUoJ6bDhcupgbcA47n+Kc fQ5TXaC7qOyNRvlpKDsGTu7GvY/dB9c0O363vtIHe2phcYY2Ffqgrhgb5KDbapmB7SvK fijA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=spQERbvP; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-38847-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38847-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y9-20020a170906558900b00a33dbebfd45si171012ejp.853.2024.01.25.07.48.45 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 07:48:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38847-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=spQERbvP; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-38847-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38847-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6CD401F21635 for <ouuuleilei@gmail.com>; Thu, 25 Jan 2024 15:48:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62DF47CF2B; Thu, 25 Jan 2024 15:47:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="spQERbvP" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 1B34B76916; Thu, 25 Jan 2024 15:47:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706197635; cv=none; b=eUc20eKlOyPMOdlIAEAqDRNSn/noUUVawiGFBjUt5rrw713PtvA9fEi3nM8OHcoj9j3TjB+drgJtPKGUZUY4HfHN2+fTNxhQUeXLBgwxmh5P/mNkah1w+AT5ej2RtRxYN8B7zcHDf1OlbG23on64r40Xt2iXOKScLQ9wtevnQbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706197635; c=relaxed/simple; bh=zJmZgfxWIaYLZOFMPT1jD8KyCb1GdfoJ77F3vo97p4I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WdWN0zIHsm3IoNqlO+l8VWgF+tLY6++Nyt5qByXU3ijjcLT3uKESgT8B7bpBZ5a7zPm4tAoyaK89/HSotNAxpxwi3JoKcWu+qiXOwXbR6kS/uO4a0rlaOo61ZNuME5ykTQZw/wbQsfBOiycPRaykQ041fmc+trnwJjZOcrTA7gI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=spQERbvP; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1706197631; bh=zJmZgfxWIaYLZOFMPT1jD8KyCb1GdfoJ77F3vo97p4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=spQERbvPbrDUUyL60ZyWYlK+MZp56OErqHy8CwHbVAFap8AHI1Cli622MWdnld8Aq TwrHHehfcs8JZFmZqcaO2enEofICBe5wzVbDWlb1D8QiJXEqIusR9jUQIC6rnsgoXa 3KYVOqzo6hgu2Vq9YzXFpkrOs7jo+IFO6J0mY84SVJBxJvWgaNryCiARh783mOqQZn NhuqkS6FzsWMQKat6kiOVEnBQsHuEyflRBYKkRjSmgK0nQsFStNyJ2SBsfkh9WdtoA iAevWDtNz/VCkSYlH8veDwFpBgNKwa3UyH3WPKaRf0VRS00NXT0j6BMvwSFl5u2zTU i7BuFoEPy1Tfw== Received: from localhost.localdomain (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 01DD737820C3; Thu, 25 Jan 2024 15:47:08 +0000 (UTC) From: Muhammad Usama Anjum <usama.anjum@collabora.com> To: Andrew Morton <akpm@linux-foundation.org>, Shuah Khan <shuah@kernel.org> Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>, kernel@collabora.com, Ryan Roberts <ryan.roberts@arm.com>, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 5/5] selftests/mm: run_vmtests.sh: add missing tests Date: Thu, 25 Jan 2024 20:46:08 +0500 Message-ID: <20240125154608.720072-6-usama.anjum@collabora.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240125154608.720072-1-usama.anjum@collabora.com> References: <20240125154608.720072-1-usama.anjum@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789077986900761076 X-GMAIL-MSGID: 1789077986900761076 |
Series |
selftests/mm: Improve run_vmtests.sh
|
|
Commit Message
Muhammad Usama Anjum
Jan. 25, 2024, 3:46 p.m. UTC
Add missing tests to run_vmtests.sh. The mm kselftests are run through
run_vmtests.sh. If a test isn't present in this script, it'll not run
with run_tests or `make -C tools/testing/selftests/mm run_tests`.
Cc: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
Changes since v1:
- Copy the original scripts and their dependence script to install directory as well
Changes since v2:
- Add a comment
- Move tests down in the file
- Add "-d" option which poisons the pages and aren't being useable after
the test
---
tools/testing/selftests/mm/Makefile | 5 +++++
tools/testing/selftests/mm/run_vmtests.sh | 8 ++++++++
2 files changed, 13 insertions(+)
Comments
On 25/01/2024 15:46, Muhammad Usama Anjum wrote: > Add missing tests to run_vmtests.sh. The mm kselftests are run through > run_vmtests.sh. If a test isn't present in this script, it'll not run > with run_tests or `make -C tools/testing/selftests/mm run_tests`. > > Cc: Ryan Roberts <ryan.roberts@arm.com> > Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> > --- > Changes since v1: > - Copy the original scripts and their dependence script to install directory as well > > Changes since v2: > - Add a comment > - Move tests down in the file > - Add "-d" option which poisons the pages and aren't being useable after > the test > --- > tools/testing/selftests/mm/Makefile | 5 +++++ > tools/testing/selftests/mm/run_vmtests.sh | 8 ++++++++ > 2 files changed, 13 insertions(+) > > diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile > index 2453add65d12f..f3aec7be80730 100644 > --- a/tools/testing/selftests/mm/Makefile > +++ b/tools/testing/selftests/mm/Makefile > @@ -114,6 +114,11 @@ TEST_PROGS := run_vmtests.sh > TEST_FILES := test_vmalloc.sh > TEST_FILES += test_hmm.sh > TEST_FILES += va_high_addr_switch.sh > +TEST_FILES += charge_reserved_hugetlb.sh > +TEST_FILES += hugetlb_reparenting_test.sh > + > +# required by charge_reserved_hugetlb.sh > +TEST_FILES += write_hugetlb_memory.sh > > include ../lib.mk > > diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh > index e373d592dbf5c..a0f37e4438937 100755 > --- a/tools/testing/selftests/mm/run_vmtests.sh > +++ b/tools/testing/selftests/mm/run_vmtests.sh > @@ -19,6 +19,7 @@ usage: ${BASH_SOURCE[0]:-$0} [ options ] > -t: specify specific categories to tests to run > -h: display this message > -n: disable TAP output > + -d: run destructive tests You probably want to clarify the behaviour for -a (all). I guess providing -a should NOT run destructive tests unless -d is also explicitly provided. > > The default behavior is to run required tests only. If -a is specified, > will run all tests. > @@ -79,6 +80,7 @@ EOF > } > > RUN_ALL=false > +RUN_DESTRUCTIVE_TEST=false Either call this RUN_DESTRUCTIVE (my preference) or at least make it plural (RUN_DESTRUCTIVE_TESTS). > TAP_PREFIX="# " > > while getopts "aht:n" OPT; do > @@ -87,6 +89,7 @@ while getopts "aht:n" OPT; do > "h") usage ;; > "t") VM_SELFTEST_ITEMS=${OPTARG} ;; > "n") TAP_PREFIX= ;; > + "a") RUN_DESTRUCTIVE_TEST=true ;; The help you added says the option is -d, but this is looking for -a, and conflicting with the existing -a=all option. > esac > done > shift $((OPTIND -1)) > @@ -304,6 +307,11 @@ CATEGORY="process_mrelease" run_test ./mrelease_test > CATEGORY="mremap" run_test ./mremap_test > > CATEGORY="hugetlb" run_test ./thuge-gen > +CATEGORY="hugetlb" run_test ./charge_reserved_hugetlb.sh -cgroup-v2 > +CATEGORY="hugetlb" run_test ./hugetlb_reparenting_test.sh -cgroup-v2 > +if $RUN_DESTRUCTIVE_TEST; then > +CATEGORY="hugetlb" run_test ./hugetlb-read-hwpoison > +fi > > if [ $VADDR64 -ne 0 ]; then >
On 2/1/24 5:11 PM, Ryan Roberts wrote: > On 25/01/2024 15:46, Muhammad Usama Anjum wrote: >> Add missing tests to run_vmtests.sh. The mm kselftests are run through >> run_vmtests.sh. If a test isn't present in this script, it'll not run >> with run_tests or `make -C tools/testing/selftests/mm run_tests`. >> >> Cc: Ryan Roberts <ryan.roberts@arm.com> >> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> >> --- >> Changes since v1: >> - Copy the original scripts and their dependence script to install directory as well >> >> Changes since v2: >> - Add a comment >> - Move tests down in the file >> - Add "-d" option which poisons the pages and aren't being useable after >> the test >> --- >> tools/testing/selftests/mm/Makefile | 5 +++++ >> tools/testing/selftests/mm/run_vmtests.sh | 8 ++++++++ >> 2 files changed, 13 insertions(+) >> >> diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile >> index 2453add65d12f..f3aec7be80730 100644 >> --- a/tools/testing/selftests/mm/Makefile >> +++ b/tools/testing/selftests/mm/Makefile >> @@ -114,6 +114,11 @@ TEST_PROGS := run_vmtests.sh >> TEST_FILES := test_vmalloc.sh >> TEST_FILES += test_hmm.sh >> TEST_FILES += va_high_addr_switch.sh >> +TEST_FILES += charge_reserved_hugetlb.sh >> +TEST_FILES += hugetlb_reparenting_test.sh >> + >> +# required by charge_reserved_hugetlb.sh >> +TEST_FILES += write_hugetlb_memory.sh >> >> include ../lib.mk >> >> diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh >> index e373d592dbf5c..a0f37e4438937 100755 >> --- a/tools/testing/selftests/mm/run_vmtests.sh >> +++ b/tools/testing/selftests/mm/run_vmtests.sh >> @@ -19,6 +19,7 @@ usage: ${BASH_SOURCE[0]:-$0} [ options ] >> -t: specify specific categories to tests to run >> -h: display this message >> -n: disable TAP output >> + -d: run destructive tests > > You probably want to clarify the behaviour for -a (all). I guess providing -a > should NOT run destructive tests unless -d is also explicitly provided. > >> >> The default behavior is to run required tests only. If -a is specified, >> will run all tests. >> @@ -79,6 +80,7 @@ EOF >> } >> >> RUN_ALL=false >> +RUN_DESTRUCTIVE_TEST=false > > Either call this RUN_DESTRUCTIVE (my preference) or at least make it plural > (RUN_DESTRUCTIVE_TESTS). > >> TAP_PREFIX="# " >> >> while getopts "aht:n" OPT; do >> @@ -87,6 +89,7 @@ while getopts "aht:n" OPT; do >> "h") usage ;; >> "t") VM_SELFTEST_ITEMS=${OPTARG} ;; >> "n") TAP_PREFIX= ;; >> + "a") RUN_DESTRUCTIVE_TEST=true ;; > > The help you added says the option is -d, but this is looking for -a, and > conflicting with the existing -a=all option. Sorry, that's a typo. I'll resolve your above comments with fix patch as well. > >> esac >> done >> shift $((OPTIND -1)) >> @@ -304,6 +307,11 @@ CATEGORY="process_mrelease" run_test ./mrelease_test >> CATEGORY="mremap" run_test ./mremap_test >> >> CATEGORY="hugetlb" run_test ./thuge-gen >> +CATEGORY="hugetlb" run_test ./charge_reserved_hugetlb.sh -cgroup-v2 >> +CATEGORY="hugetlb" run_test ./hugetlb_reparenting_test.sh -cgroup-v2 >> +if $RUN_DESTRUCTIVE_TEST; then >> +CATEGORY="hugetlb" run_test ./hugetlb-read-hwpoison >> +fi >> >> if [ $VADDR64 -ne 0 ]; then >> > >
diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 2453add65d12f..f3aec7be80730 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -114,6 +114,11 @@ TEST_PROGS := run_vmtests.sh TEST_FILES := test_vmalloc.sh TEST_FILES += test_hmm.sh TEST_FILES += va_high_addr_switch.sh +TEST_FILES += charge_reserved_hugetlb.sh +TEST_FILES += hugetlb_reparenting_test.sh + +# required by charge_reserved_hugetlb.sh +TEST_FILES += write_hugetlb_memory.sh include ../lib.mk diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index e373d592dbf5c..a0f37e4438937 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -19,6 +19,7 @@ usage: ${BASH_SOURCE[0]:-$0} [ options ] -t: specify specific categories to tests to run -h: display this message -n: disable TAP output + -d: run destructive tests The default behavior is to run required tests only. If -a is specified, will run all tests. @@ -79,6 +80,7 @@ EOF } RUN_ALL=false +RUN_DESTRUCTIVE_TEST=false TAP_PREFIX="# " while getopts "aht:n" OPT; do @@ -87,6 +89,7 @@ while getopts "aht:n" OPT; do "h") usage ;; "t") VM_SELFTEST_ITEMS=${OPTARG} ;; "n") TAP_PREFIX= ;; + "a") RUN_DESTRUCTIVE_TEST=true ;; esac done shift $((OPTIND -1)) @@ -304,6 +307,11 @@ CATEGORY="process_mrelease" run_test ./mrelease_test CATEGORY="mremap" run_test ./mremap_test CATEGORY="hugetlb" run_test ./thuge-gen +CATEGORY="hugetlb" run_test ./charge_reserved_hugetlb.sh -cgroup-v2 +CATEGORY="hugetlb" run_test ./hugetlb_reparenting_test.sh -cgroup-v2 +if $RUN_DESTRUCTIVE_TEST; then +CATEGORY="hugetlb" run_test ./hugetlb-read-hwpoison +fi if [ $VADDR64 -ne 0 ]; then