Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9258325rwp; Thu, 20 Jul 2023 01:58:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlENYgQL+fiIhKtz5uuyPJPpv/vLj8zOtBnmQ0uXSRIICxZaIP53yBw1aDQks7BbdsE5pwkl X-Received: by 2002:a17:906:9507:b0:991:b554:e64b with SMTP id u7-20020a170906950700b00991b554e64bmr2496584ejx.54.1689843528757; Thu, 20 Jul 2023 01:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689843528; cv=none; d=google.com; s=arc-20160816; b=Zu63z6CSjgJMTgqIeoQ4OqlRgR46C5OAZABG/RHSp0DiMEK0IYcPeF7o38GISsiPkX 8ywf34B6o2h1ZgWvtn3odbV61916ijVDUipAxop7jkH3ini963miJZhFAaZ5l77t7VQY f1FRbOiXzTv6zUxmVlCQmyWN8F+3PUtn77KlhMMFv8jmv4PGQ5XF4VfLMJ6iK6sYkzmN Mun/GWx8a7jgfguJXwerbXYG5T5oqFYv+qcUPRQQoDmQd5TL/V9YVdQ+bY9ItY1k9Od4 0ZmRrAE9Gmi25rHTLIz+eBYjlic/vYyowh635CwoH2pamQmgi9XB2A2kauUuwNgwJoO6 Es6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=bhD0LmqdX6k4L1ayub13WbtK3NYiTAi81Lf8VthdNkE=; fh=dXhuHcudGLbGxBiRImCI+Vb69xhkFa+WgurkdFSv5QA=; b=IBsruec1xxazRhC6cSIiMnY5nXRFAit2wGkfTYyLQB21bBXs9Qp7fXUCXp5jVdwOdC 3jFd56/F74r6qKXRQY5vXnIpiPz2tsXlu/+zLWwgKjmbpkSvkMOjY2wYd2d1pXtiMyKS SpHNps1NeOH/ytg6Qzq+P1tEEoRyUH814fbnwb1WRUSjBgtzkBNTTHgyUaRnd7oUv61f LtpJ6qzY6f0N5ymBAdE59T17Q85Oht3vZ0/PcgMZYTDJbTkuKqk2FhoNYFmBE0duOgmL 2DVRXTl9AvasndZ+FZQIaXknBG4E6O2/Za/3SuDdjGapJMp/3OpnK3wOxfmuE/h3ZLwP Z+hQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jt8-20020a170906dfc800b00993629db66csi407999ejc.226.2023.07.20.01.58.21; Thu, 20 Jul 2023 01:58:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230210AbjGTIO1 (ORCPT + 99 others); Thu, 20 Jul 2023 04:14:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230247AbjGTIOX (ORCPT ); Thu, 20 Jul 2023 04:14:23 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A90142686; Thu, 20 Jul 2023 01:14:20 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 767472F4; Thu, 20 Jul 2023 01:15:03 -0700 (PDT) Received: from [10.1.38.38] (C02Z41KALVDN.cambridge.arm.com [10.1.38.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A74923F67D; Thu, 20 Jul 2023 01:14:18 -0700 (PDT) Message-ID: <0e512516-6453-f7cb-67ee-f32c17eceea2@arm.com> Date: Thu, 20 Jul 2023 09:14:17 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2 8/8] selftests/mm: Run all tests from run_vmtests.sh To: Peter Xu , David Hildenbrand Cc: Andrew Morton , Shuah Khan , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Mark Brown , John Hubbard , Florent Revest , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org References: <20230717103152.202078-1-ryan.roberts@arm.com> <20230717103152.202078-9-ryan.roberts@arm.com> <5a12536a-2e33-7a68-6cfd-fd991ddf875a@redhat.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/07/2023 21:45, Peter Xu wrote: > On Mon, Jul 17, 2023 at 07:27:13PM +0200, David Hildenbrand wrote: >> On 17.07.23 12:31, Ryan Roberts wrote: >>> It is very unclear to me how one is supposed to run all the mm selftests >>> consistently and get clear results. >>> >>> Most of the test programs are launched by both run_vmtests.sh and >>> run_kselftest.sh: >>> >>> hugepage-mmap >>> hugepage-shm >>> map_hugetlb >>> hugepage-mremap >>> hugepage-vmemmap >>> hugetlb-madvise >>> map_fixed_noreplace >>> gup_test >>> gup_longterm >>> uffd-unit-tests >>> uffd-stress >>> compaction_test >>> on-fault-limit >>> map_populate >>> mlock-random-test >>> mlock2-tests >>> mrelease_test >>> mremap_test >>> thuge-gen >>> virtual_address_range >>> va_high_addr_switch >>> mremap_dontunmap >>> hmm-tests >>> madv_populate >>> memfd_secret >>> ksm_tests >>> ksm_functional_tests >>> soft-dirty >>> cow >>> >>> However, of this set, when launched by run_vmtests.sh, some of the >>> programs are invoked multiple times with different arguments. When >>> invoked by run_kselftest.sh, they are invoked without arguments (and as >>> a consequence, some fail immediately). >>> >>> Some test programs are only launched by run_vmtests.sh: >>> >>> test_vmalloc.sh >>> >>> And some test programs and only launched by run_kselftest.sh: >>> >>> khugepaged >>> migration >>> mkdirty >>> transhuge-stress >>> split_huge_page_test >>> mdwe_test >>> write_to_hugetlbfs >>> >>> Furthermore, run_vmtests.sh is invoked by run_kselftest.sh, so in this >>> case all the test programs invoked by both scripts are run twice! >>> >>> Needless to say, this is a bit of a mess. In the absence of fully >>> understanding the history here, it looks to me like the best solution is >>> to launch ALL test programs from run_vmtests.sh, and ONLY invoke >>> run_vmtests.sh from run_kselftest.sh. This way, we get full control over >>> the parameters, each program is only invoked the intended number of >>> times, and regardless of which script is used, the same tests get run in >>> the same way. >>> >>> The only drawback is that if using run_kselftest.sh, it's top-level tap >>> result reporting reports only a single test and it fails if any of the >>> contained tests fail. I don't see this as a big deal though since we >>> still see all the nested reporting from multiple layers. The other issue >>> with this is that all of run_vmtests.sh must execute within a single >>> kselftest timeout period, so let's increase that to something more >>> suitable. >>> >>> In the Makefile, TEST_GEN_PROGS will compile and install the tests and >>> will add them to the list of tests that run_kselftest.sh will run. >>> TEST_GEN_FILES will compile and install the tests but will not add them >>> to the test list. So let's move all the programs from TEST_GEN_PROGS to >>> TEST_GEN_FILES so that they are built but not executed by >>> run_kselftest.sh. Note that run_vmtests.sh is added to TEST_PROGS, which >>> means it ends up in the test list. (the lack of "_GEN" means it won't be >>> compiled, but simply copied). >>> >>> Signed-off-by: Ryan Roberts >>> --- >> >> Acked-by: David Hildenbrand > > Thanks for letting me know, David. Sorry for the late response, still > catching up things. > > I used to justify that from mm/ itself that everything should be PROG, but > I see that from higher level where TEST_GEN_FILE|PROG is really used this > makes sense. As long as vm_utils.o will be properly linked I'll be happy > enough.. Yep that's the case; I've set it up so that vm_utils.o is linked in for both TEST_GEN_FILE and TEST_GEN_PROG binaries. > > Acked-by: Peter Xu Thanks! > > Thanks, >