From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C344BC47258 for ; Tue, 23 Jan 2024 14:45:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1EF836B0078; Tue, 23 Jan 2024 09:45:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 19EF06B007E; Tue, 23 Jan 2024 09:45:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 067496B0082; Tue, 23 Jan 2024 09:45:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id EA8C46B0078 for ; Tue, 23 Jan 2024 09:45:02 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id AB6A8120A9F for ; Tue, 23 Jan 2024 14:45:02 +0000 (UTC) X-FDA: 81710848044.30.AC794F2 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by imf11.hostedemail.com (Postfix) with ESMTP id A52B84000E for ; Tue, 23 Jan 2024 14:45:00 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=oYH9+34T; dmarc=pass (policy=quarantine) header.from=collabora.com; spf=pass (imf11.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706021101; a=rsa-sha256; cv=none; b=a8l3t4C6RBOEqHzetjR5T4NBXrdryn7WURDAVMz3AnQn2Gc9wlBj0UJTHiYK+jdTxTU72h bYb/aOskFBjsraajeHEikgyr9lGwWtz4Jrdeyw6yRcArWxJzPNAui79T5Jd3MBbQRlP3LD f2KPpf2ewPOiLhJpbX3Po6FoJLOy7I4= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=oYH9+34T; dmarc=pass (policy=quarantine) header.from=collabora.com; spf=pass (imf11.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706021101; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xWqn8K+hzjETpsO+uN1EIN+5Zul00r3fuDLquTugXiU=; b=dSP5xjCNGDiq/v2oXb3Zbv0UFccHUhfPOxLdSKk+iABuc8JkRMFjN31TPqild1MlINxleq 4VIgaPCF3yqiFhitdDxBWs6w+7rAyauWs+rfBhvEX2btPKvvLrSlh+/ao8NXCLGLSs7DOm nUYhWGVOPfwBvXUfYRlXGXCYDaaxeRE= 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 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 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: A52B84000E X-Stat-Signature: h4ob9t4x8k9phnsdzq8694zeaugwep45 X-HE-Tag: 1706021100-391508 X-HE-Meta: U2FsdGVkX18dE3axcU2DBXF6xt4S2Fqv+X1MtOc7Y7vHqrg7CG7wD3hEq/HLsopt8XIqNbBYHCDI5zdDxHL1kYwI2g3JWBaTInshrIQY5mWSuafBCIwgYYDU/sUkkEXyME1AAyTFMZxcJY39KpjnOyBoeSljQx9eJKI5EN/o0i5MjlqWaWejs4hPzX5s3Xnnz8giTdaWmZdRvniXq7NoBDAfYz5HpUJ3Jx8a1O+cq5vQCv4XuQq+DBYtMIb2IaKDmkW8CmqcjW/uU9B5i18/5KPUzaPENXkp/zt2nx3B8eZ2hwVw+evpoIqTyUVUJDmu+plUxw3d1af6c/Wc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ests=bogofilter, spamicity=0.000299, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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