Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp518451rdb; Tue, 23 Jan 2024 06:45:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFgeks8oM0UESNGPFx9YT4ZvcVKFASDWZ5Rmc8vdINg0PcxWS5Brjpz4DDtHiKYrBE3Y9KF X-Received: by 2002:a05:600c:11c7:b0:40e:6631:596c with SMTP id b7-20020a05600c11c700b0040e6631596cmr309327wmi.305.1706021111250; Tue, 23 Jan 2024 06:45:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706021111; cv=pass; d=google.com; s=arc-20160816; b=TJlTHGX8UwAGFrvbjBMnwsMFBeQxdBJd2Ko3bfnJhDY6yH4Yh0kyVnyaceIcKSUI52 WUG8vf2EV5mQ6jhHHOJJ5TJA8aSP5z6P8ZTbNKrhHi7iBdqC5p6necZ5vOl/s3Ijikqv aZFyXXRVpIVrW5gsQU5H2GjDShOSF7GtXqeedSwkZEp//lDPMCNA0fn+5LYx4l1G2yuB D+ry383wILe5RBzVe5bmT8iEMWZMaiIf4LLvMX6mD6/PSJU/FcfLpPluULYMZy74YKwk NB5QZ5prfjrXxU1cxmKaGSUDkmkjNzu2IJir168IUOQ9dBeGShXwzoBJ9/UwcARDY2n3 xaDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:cc:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=xWqn8K+hzjETpsO+uN1EIN+5Zul00r3fuDLquTugXiU=; fh=x/cBY7KWGd44Mg0cIaepQskdpZbBAUoGg8P9EqnqcsU=; b=JY+tfoWIMGVoWI2B1FXiQilOBGpQRZjfqdLK19GIvRnc69LBXXEaBSJ9ucZlT9unzN irmfDusdkCQbZ8vGyE3ymodkuMn5qnYRBD3atpxJiNqJqgIV0o/Bav9mAYEdSMxGA3mc AroCqFPZ9xOqFjkMOMcq4bEERXZ/8dsKSR0OE5j8nx4Oq7H9jRdBwMarKRE1MSViRhG3 ggewSs0R+6FVwCvJ7qaeCP1BhSECRCWVjQs4Q4H5LhGDN4WEaEpNoLuBA749+3F7ancx ErDVqJxN01lQRoQsbEvo2mdwIaepC3VHF+3bTLB5IxUcm5agPYfqDwmUU3Q+8+JFn1m8 CnmA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=oYH9+34T; 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-35468-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35468-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id fd12-20020a056402388c00b0055c45aa1380si1950140edb.431.2024.01.23.06.45.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 06:45:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35468-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=oYH9+34T; 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-35468-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35468-linux.lists.archive=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 CFA791F21887 for ; Tue, 23 Jan 2024 14:45:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FC1550A84; Tue, 23 Jan 2024 14:45:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="oYH9+34T" 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 A241C5026F; Tue, 23 Jan 2024 14:45:00 +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=1706021102; cv=none; b=tYa5BBQ4/SFcbDSNXJYa9C/Ds1FWe0NR30Efl/zLrNCAWvQDsaV9/GawikjQ5Jyz4u66WDF5DB7od1pexgPNGFJ/6tsEkbbMSDynRKJq++XFP9t0gjHV7POm6SUm/tjyy5zuVwqit8X/ZclnTn8fQTm0BvkbGwsbVVwknTKs72w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706021102; c=relaxed/simple; bh=+8mWQtyFcnYGhfR0wkSQ68fK9+UKR6e+xL/523DTfrE=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=aU9/kxnr2+YeurUxjFusLPE02lJ9WNkE/QQVwVjiZ5py0OPVmztnX+ilUtjorDnAQh1UJEGNMxJnJp7xqUC23wN4SSLajW0RA+IP6dv1R+yX/lftCv5pifHzCkzyC85RRqYR2QLuhuOKw9g8KH4jVJ3qG3/x3Ca+/3u2evmFvH8= 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=oYH9+34T; 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=1706021099; bh=+8mWQtyFcnYGhfR0wkSQ68fK9+UKR6e+xL/523DTfrE=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=oYH9+34T274wj0pmflwVQkZtj4kzL8X0IozbxHiUB9ZxNClluGgTttaT4fIDBM3zg /c1PI1tgscghRptoWKdEndPRz85x5eU6/hvZbRgXGcEzBx1qKSGoG2YiotL/+9Cgkh 0wJKLLagQx9oMACCrnO+GquHBAVe+sfJk8P5q3JGCeo7eGpzy2rVybdaE15QyxXOV+ Os1+/IMiq88hvgXLTh1OsOLQNCcWVOL7DFqRR+I2ojRiKPmVS5QRIwzRcKuHmO6dvq 34SAn06OsRTaNegs093K7Ji1pGJo3EF3K4EpazlyotI676TaEKiNelO8qOIS21m3Rh 4thZ6PDfmB0jg== Received: from [100.96.234.34] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 DC41437820AF; Tue, 23 Jan 2024 14:44:56 +0000 (UTC) Message-ID: <4bf9bf87-0622-4824-9026-d7ab5839f433@collabora.com> Date: Tue, 23 Jan 2024 19:45:08 +0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: Muhammad Usama Anjum , kernel@collabora.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton , Shuah Khan Subject: Re: [PATCH v2 1/2] selftests/mm: run_vmtests.sh: add missing tests Content-Language: en-US To: Ryan Roberts References: <20240123073615.920324-1-usama.anjum@collabora.com> From: Muhammad Usama Anjum In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 >> Signed-off-by: Muhammad Usama Anjum >> --- >> 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 > > -- BR, Muhammad Usama Anjum