Message ID | 20240123073615.920324-1-usama.anjum@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-34830-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp174859dyi; Mon, 22 Jan 2024 23:38:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5BV4k0+HWkDMoKdTpzLz7/ba2aoPsSlZkA6NDk+jzGl6ab3b6VOQKxTNDY87sZEjWGQGv X-Received: by 2002:a05:6871:10b:b0:210:9d54:e388 with SMTP id y11-20020a056871010b00b002109d54e388mr1174939oab.32.1705995517566; Mon, 22 Jan 2024 23:38:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705995517; cv=pass; d=google.com; s=arc-20160816; b=pd5maZeYFYMBhCchpo2nlXFkx+FlnGvu/y95Bqcx4i5fSgGSwEdJWkh3nGoo58Hv7u oW/n6UIyw0usJuWEr1rDlX9x714WDYGAN3fzuKdvscCAbdSzbSaTEocdYwGVahiG9F11 hZyTLUa4d7t0sYs1rVn+ea5GDFP0jooO3qExpVTBey/pyTlKaD9NLEKJ+I71x7YU+RpE c3FQ7oPuLT2I0aOMsQZkZriWyU6QuxJyOqkbfy79i47LIbhxHdwVKyouDCJg5RdlCaR1 BuFNSSy8OXvayP7MFma+LWXk5/Uzdisuws4D0yuJh9vDHCPVW2BPrYzMBXeRpYgBZ533 CgaA== 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=EfuS2Tt+4WI6cHfeaps0egdh+qgxoxbNgqJrrsMe6q8=; fh=GI+QUBHPqwETgj91+OjmAHfGmBmxeZg5KGm08En4mD4=; b=lzAHzgwOXaAU9GYvD86QIG1QTMZjJ22DoHQunyShvHK+VqRv7Q4/ymQwGX3N+4aayG xtPyJLWv9Ej/nu0hxNExTBuDADnRJMESjqn8sOkFLCxULPULzdaTGTdBcyAohBkk0DVH Yjsdb31XaDDSRPZLN1CGMwZPFDbBu0XadTeAsZ9mSJ0lu/ugH5XvA3vcEQ/yTHu2v8Wg GcEZFQugFMRmD8Slki/0Qa5T92KY7JSot70gWbhXUPzoGgu33uqP7eBX0fhSM+L0CPcO ZTeRsQqL02INNelUj48RXZFRjfb7Jz9491tccNxmoiR4ZqnNzXn/qRFZIsV84z9Ap/vT qeuw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="XJBKv2O/"; 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-34830-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34830-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k75-20020a636f4e000000b005cdfef7fc5fsi9260012pgc.499.2024.01.22.23.38.37 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 23:38:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34830-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="XJBKv2O/"; 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-34830-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34830-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 505C028549C for <ouuuleilei@gmail.com>; Tue, 23 Jan 2024 07:37:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47BE356468; Tue, 23 Jan 2024 07:36:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="XJBKv2O/" 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 DF86451C3A; Tue, 23 Jan 2024 07:36:23 +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=1705995386; cv=none; b=H7wao4Sm4Oe7EOdrP6UzZVwN2I4bkRMFTv6kQSXE0kaWPx8w/2yAOoMCcg+h2NJE3dWGRVrXGa+5FRjOmZRMaqaF/jaKPzJpKQIXgO65QoR1aHZ6KTDU6KifEaq1tp+RNJi0Bu7YLo7Ira4kS27ObV3y5XBosJEsTnpydtrquwk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705995386; c=relaxed/simple; bh=UjyihoPyN6SOPFC4hXvckN7LSDeJ3FDGKGRL79wdbrI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=J8tKh+f9XwjLHyaQjH3KQPhv60ZXVdaA2A0DTcztzNF2IrTmbX9k7LecL+n9I30BZ9/jNIyD69hVChHZtgUWjIfjjsAv1teQARyV/DENK1nRyGYuqcMBsKKLE9Fzollxd1uMI6g87TXEzOP52wL6PRAXcsVxb8XPNfUosjVuy3s= 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=XJBKv2O/; 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=1705995378; bh=UjyihoPyN6SOPFC4hXvckN7LSDeJ3FDGKGRL79wdbrI=; h=From:To:Cc:Subject:Date:From; b=XJBKv2O/lbViF3stGvXrhrgD6QAkY3LkvT2znhJvBl8JwewmKA+W0sDCCN4Tnsm6c D1nUuRlb5LJ1l5RbF72JT4R0Mby8v1FB5Fpw0U2caKcFedUzPcv0AV6rKJEnUtTlGO 29DCJMwu7QHL9vYlv7mJ151n+deebekBZGkRqXpAhcm0EyC4GG3Tcbux290jKc3u/e epJslm+MhXD5jwfuncizu2PfPCTAR1vQtxUYNFP4y9ui8vwDtcGlwUOUBoZjWW3DpW hjCSW80jWtpD7ohV4IR2LR+61z0XAUPoOhNBCL+dPDvVMFch+iBex9eUAojH5tTPRS ju3FJeDlSJWJA== 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 91D033782039; Tue, 23 Jan 2024 07:36:16 +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 v2 1/2] selftests/mm: run_vmtests.sh: add missing tests Date: Tue, 23 Jan 2024 12:36:13 +0500 Message-ID: <20240123073615.920324-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.42.0 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: 1788865955943287698 X-GMAIL-MSGID: 1788865955943287698 |
Series |
[v2,1/2] selftests/mm: run_vmtests.sh: add missing tests
|
|
Commit Message
Muhammad Usama Anjum
Jan. 23, 2024, 7:36 a.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
---
tools/testing/selftests/mm/Makefile | 3 +++
tools/testing/selftests/mm/run_vmtests.sh | 3 +++
2 files changed, 6 insertions(+)
Comments
On 23/01/2024 07:36, 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 > --- > tools/testing/selftests/mm/Makefile | 3 +++ > tools/testing/selftests/mm/run_vmtests.sh | 3 +++ > 2 files changed, 6 insertions(+) > > diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile > index 2453add65d12f..c9c8112a7262e 100644 > --- a/tools/testing/selftests/mm/Makefile > +++ b/tools/testing/selftests/mm/Makefile > @@ -114,6 +114,9 @@ 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 += write_hugetlb_memory.sh > +TEST_FILES += hugetlb_reparenting_test.sh I see you are exporting 3 scripts, but only invoking 2 of them from run_vmtests.sh below. Is one a helper that gets called indirectly? > > include ../lib.mk > > diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh > index 246d53a5d7f28..12754af00b39c 100755 > --- a/tools/testing/selftests/mm/run_vmtests.sh > +++ b/tools/testing/selftests/mm/run_vmtests.sh > @@ -248,6 +248,9 @@ CATEGORY="hugetlb" run_test ./map_hugetlb > CATEGORY="hugetlb" run_test ./hugepage-mremap > CATEGORY="hugetlb" run_test ./hugepage-vmemmap > CATEGORY="hugetlb" run_test ./hugetlb-madvise > +CATEGORY="hugetlb" run_test ./charge_reserved_hugetlb.sh -cgroup-v2 > +CATEGORY="hugetlb" run_test ./hugetlb_reparenting_test.sh -cgroup-v2 > +CATEGORY="hugetlb" run_test ./hugetlb-read-hwpoison I'm not really a fan of adding this last test here; its destructive because it poisons 8 hugepages. So at a minimum, I think you need to modify the code in run_vmtests.sh to ensure those extra pages are allocated (there is already a section in the script that allocates hugepages). However, given this test is destructive, I'd prefer that it wasn't run as part of the main test set. Because the first time you run it, it will presumably pass, but now some of the hugepages are poisoned so next time you run it, there won't be enough unpoisoned hugepages and a test will fail. So you have very confusing behaviour for a developer who might be running these tests multiple times per boot (e.g. me). Perhaps we can add a -d (destructive) option to the script, and this test will only be run if that option is passed? Thanks, Ryan > > nr_hugepages_tmp=$(cat /proc/sys/vm/nr_hugepages) > # For this test, we need one and just one huge page
Hi Ryan, Thank you so much for reviewing and getting involved. On 1/23/24 2:33 PM, Ryan Roberts wrote: > On 23/01/2024 07:36, 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 >> --- >> tools/testing/selftests/mm/Makefile | 3 +++ >> tools/testing/selftests/mm/run_vmtests.sh | 3 +++ >> 2 files changed, 6 insertions(+) >> >> diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile >> index 2453add65d12f..c9c8112a7262e 100644 >> --- a/tools/testing/selftests/mm/Makefile >> +++ b/tools/testing/selftests/mm/Makefile >> @@ -114,6 +114,9 @@ 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 += write_hugetlb_memory.sh >> +TEST_FILES += hugetlb_reparenting_test.sh > > I see you are exporting 3 scripts, but only invoking 2 of them from > run_vmtests.sh below. Is one a helper that gets called indirectly? Yeah, write_hugetlb_memory.sh is needed by charge_reserved_hugetlb.sh. I'll put a comment there. > >> >> include ../lib.mk >> >> diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh >> index 246d53a5d7f28..12754af00b39c 100755 >> --- a/tools/testing/selftests/mm/run_vmtests.sh >> +++ b/tools/testing/selftests/mm/run_vmtests.sh >> @@ -248,6 +248,9 @@ CATEGORY="hugetlb" run_test ./map_hugetlb >> CATEGORY="hugetlb" run_test ./hugepage-mremap >> CATEGORY="hugetlb" run_test ./hugepage-vmemmap >> CATEGORY="hugetlb" run_test ./hugetlb-madvise >> +CATEGORY="hugetlb" run_test ./charge_reserved_hugetlb.sh -cgroup-v2 >> +CATEGORY="hugetlb" run_test ./hugetlb_reparenting_test.sh -cgroup-v2 >> +CATEGORY="hugetlb" run_test ./hugetlb-read-hwpoison > > I'm not really a fan of adding this last test here; its destructive because it > poisons 8 hugepages. So at a minimum, I think you need to modify the code in > run_vmtests.sh to ensure those extra pages are allocated (there is already a > section in the script that allocates hugepages). > > However, given this test is destructive, I'd prefer that it wasn't run as part > of the main test set. Because the first time you run it, it will presumably > pass, but now some of the hugepages are poisoned so next time you run it, there > won't be enough unpoisoned hugepages and a test will fail. So you have very > confusing behaviour for a developer who might be running these tests multiple > times per boot (e.g. me). > > Perhaps we can add a -d (destructive) option to the script, and this test will > only be run if that option is passed? Ideally we should be able to fix these tests before enabling them and there shouldn't be any side-effect of these. I'm struggling with the configurations where I'm getting consistent results. Studying and analyzing how and how many hugetlbs are being allocated/deallocated isn't straight forward enough in these. I'll spend more time to either put it under some flag or modify the tests to don't entangle with each other. > > Thanks, > Ryan > > >> >> nr_hugepages_tmp=$(cat /proc/sys/vm/nr_hugepages) >> # For this test, we need one and just one huge page > >
diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 2453add65d12f..c9c8112a7262e 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -114,6 +114,9 @@ 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 += write_hugetlb_memory.sh +TEST_FILES += hugetlb_reparenting_test.sh include ../lib.mk diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index 246d53a5d7f28..12754af00b39c 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -248,6 +248,9 @@ CATEGORY="hugetlb" run_test ./map_hugetlb CATEGORY="hugetlb" run_test ./hugepage-mremap CATEGORY="hugetlb" run_test ./hugepage-vmemmap CATEGORY="hugetlb" run_test ./hugetlb-madvise +CATEGORY="hugetlb" run_test ./charge_reserved_hugetlb.sh -cgroup-v2 +CATEGORY="hugetlb" run_test ./hugetlb_reparenting_test.sh -cgroup-v2 +CATEGORY="hugetlb" run_test ./hugetlb-read-hwpoison nr_hugepages_tmp=$(cat /proc/sys/vm/nr_hugepages) # For this test, we need one and just one huge page