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 1449EEB64DC for ; Mon, 17 Jul 2023 17:20:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 699476B0072; Mon, 17 Jul 2023 13:20:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 649E56B0074; Mon, 17 Jul 2023 13:20:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 511648D0001; Mon, 17 Jul 2023 13:20:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 4083E6B0072 for ; Mon, 17 Jul 2023 13:20:43 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0D8761404D5 for ; Mon, 17 Jul 2023 17:20:43 +0000 (UTC) X-FDA: 81021768366.30.87E3FBB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf16.hostedemail.com (Postfix) with ESMTP id E7DA2180005 for ; Mon, 17 Jul 2023 17:20:38 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=jOQpbB74; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689614439; 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=awDD/PnKcb73hu3hURpoBUxVh2rUvvdxON48PSh59dM=; b=auR/MAYX39NiyNtVIWK4xTXrQFPNYLF2nCk+A/EgWOrwWSp/EvxcJLeqyx8yfTPDKuhug4 vCBN5TL5DyHmxJmsvZ45ruAJ8XwVN9zys4n6YVC96yj6JtyaSgzEB68gf67Gzgy8IBQhjY Z6jMZ74uSjwsu3YLoRaPKiMUIPcHf3c= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=jOQpbB74; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689614439; a=rsa-sha256; cv=none; b=M2MbtqO1H4IPS10k5g3vhx9M/MyvXocxTiWS7UUIgEynqfYALf9SpUH6q1sG9dE8qGJXbi v/iK2KLVufsKDO5SSIsteB0qIcPdXu76n7OlJoNpSA1nOq529y0GnXpJEOUnsykdcB9qcP AWzQtwINMOYOz3zPuAvtlBGvhNf0qhU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689614438; h=from:from: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; bh=awDD/PnKcb73hu3hURpoBUxVh2rUvvdxON48PSh59dM=; b=jOQpbB74/GEsF/prkOib+QNZFgwSVY/XrcazImAaIZJKaDNGuMTUrNHM602zwogKA2j6h5 pZJCfzkYjY5IH3SIceW75hrsvM5rggYU+RV3EovmTjSA4UaogVv0De0Fh5wQTVaU+pYd1i YnAdCTX1X6zCAkg9x6hPK7QzBHjR0EE= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-557-EeK4TWYLOuOjSKtv9A3I_Q-1; Mon, 17 Jul 2023 13:20:33 -0400 X-MC-Unique: EeK4TWYLOuOjSKtv9A3I_Q-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-31400956ce8so2587998f8f.3 for ; Mon, 17 Jul 2023 10:20:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689614432; x=1692206432; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=awDD/PnKcb73hu3hURpoBUxVh2rUvvdxON48PSh59dM=; b=ac3xAubBFobFZi0STSTPqrQSQ3xwAq2Hk66IGP0Uif554FM6NZ1+SO3Ltq1oQ/WdBg BbrFPqc8NzWeww9Yz5juUo/GosesY1zjPBdycXKDFbcr0O7YqA8sGIdrRlE128d1FlGd SWYeAcrGg2eSsBgCKJw/zMmUJFcDt+s8vW+ZDZDEqLaIJ4YY0q6J1qe4vR0/3jJOabvn IaP4YgXEq2mfVXkppO8IhfRuoGNQKSOSqxiLIb7FO5ifH6/eHPMx+6yk0V3j9VCp0B8x I07q0QleYyxU3WbxPbx8/qbil9TFfor+6UQfovz4ngB+YGgiJDQVAxu7nA/+g7IaS7NL /E3w== X-Gm-Message-State: ABy/qLba3PVeVQ4PvsiETvCYAuL1z1/gWLn5PQZZymw8j6X5q4c3HY8X Fg6avNUHdkLWkU/L0E8GQuT673r0jbd+cRlXCNT9/SE2qaPIOZQjNFRS7IA2kUiqJFwa6zZd1wX J6o4Lg1b8MoI= X-Received: by 2002:a5d:5088:0:b0:314:53b5:92d5 with SMTP id a8-20020a5d5088000000b0031453b592d5mr10315405wrt.36.1689614432478; Mon, 17 Jul 2023 10:20:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlEW6ZkAhNCQJHfhJ9Q5FlIjPycYOIpuMSAAaLJLfQDIz/wbbCBZgG9bHcogDmThf/psJWKk7g== X-Received: by 2002:a5d:5088:0:b0:314:53b5:92d5 with SMTP id a8-20020a5d5088000000b0031453b592d5mr10315384wrt.36.1689614432122; Mon, 17 Jul 2023 10:20:32 -0700 (PDT) Received: from ?IPV6:2003:cb:c735:400:2501:5a2e:13c6:88da? (p200300cbc735040025015a2e13c688da.dip0.t-ipconnect.de. [2003:cb:c735:400:2501:5a2e:13c6:88da]) by smtp.gmail.com with ESMTPSA id u9-20020adfed49000000b00313f031876esm17465wro.43.2023.07.17.10.20.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jul 2023 10:20:31 -0700 (PDT) Message-ID: <99dead0d-08e2-ab1c-46dc-d3f4f97a71e8@redhat.com> Date: Mon, 17 Jul 2023 19:20:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 2/8] selftests/mm: Skip soft-dirty tests on arm64 To: Ryan Roberts , Andrew Morton , Shuah Khan , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Mark Brown , John Hubbard , Florent Revest , Peter Xu Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org References: <20230717103152.202078-1-ryan.roberts@arm.com> <20230717103152.202078-3-ryan.roberts@arm.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230717103152.202078-3-ryan.roberts@arm.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E7DA2180005 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: fw43dhnfwfnp9t6cy7zjpif9wyu3itsn X-HE-Tag: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HrxCsXHl0n211PZ5OzvSHIZHdYqqkQpncxszIaaCk4y1SUnuFzgcpRoTHng76z+WA7e92WowelDbH3QsNQpQpRzPvKTH6jXm3T9tLc4OfrDeMNCLwmCZ3sYEiXzK75K9wKYikZQ+HrlDzdMSXWOFOCYSQUJX11YVOASRrdphODXNE8fivhzMdjtrQuriUEC3+avm43jTyzfR7xkywPgb08sefDfVuNDdc1T1lul/Q+h4c1C/lTG5EAxRN3CmkIMQPrxjOqH/09Mc50kmcW0kRoDiLN6eG0lynyEa99uScLpaSDWaA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 17.07.23 12:31, Ryan Roberts wrote: > arm64 does not support the soft-dirty PTE bit. However, the `soft-dirty` > test suite is currently run unconditionally and therefore generates > spurious test failures on arm64. There are also some tests in > `madv_populate` which assume it is supported. > > For `soft-dirty` lets disable the whole suite for arm64; it is no longer > built and run_vmtests.sh will skip it if its not present. > > For `madv_populate`, we need a runtime mechanism so that the remaining > tests continue to be run. Unfortunately, the only way to determine if > the soft-dirty dirty bit is supported is to write to a page, then see if > the bit is set in /proc/self/pagemap. But the tests that we want to > conditionally execute are testing precicesly this. So if we introduced > this feature check, we could accedentally turn a real failure (on a > system that claims to support soft-dirty) into a skip. So instead, do > the check based on architecture; for arm64, we report that soft-dirty is > not supported. > > Signed-off-by: Ryan Roberts > --- > tools/testing/selftests/mm/Makefile | 5 ++++- > tools/testing/selftests/mm/madv_populate.c | 26 ++++++++++++++++++++-- > tools/testing/selftests/mm/run_vmtests.sh | 5 ++++- > 3 files changed, 32 insertions(+), 4 deletions(-) > > diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile > index 66d7c07dc177..3514697fc2db 100644 > --- a/tools/testing/selftests/mm/Makefile > +++ b/tools/testing/selftests/mm/Makefile > @@ -63,12 +63,15 @@ TEST_GEN_PROGS += thuge-gen > TEST_GEN_PROGS += transhuge-stress > TEST_GEN_PROGS += uffd-stress > TEST_GEN_PROGS += uffd-unit-tests > -TEST_GEN_PROGS += soft-dirty > TEST_GEN_PROGS += split_huge_page_test > TEST_GEN_PROGS += ksm_tests > TEST_GEN_PROGS += ksm_functional_tests > TEST_GEN_PROGS += mdwe_test > > +ifneq ($(ARCH),arm64) > +TEST_GEN_PROGS += soft-dirty > +endif > + > ifeq ($(ARCH),x86_64) > CAN_BUILD_I386 := $(shell ./../x86/check_cc.sh "$(CC)" ../x86/trivial_32bit_program.c -m32) > CAN_BUILD_X86_64 := $(shell ./../x86/check_cc.sh "$(CC)" ../x86/trivial_64bit_program.c) > diff --git a/tools/testing/selftests/mm/madv_populate.c b/tools/testing/selftests/mm/madv_populate.c > index 60547245e479..17bcb07f19f3 100644 > --- a/tools/testing/selftests/mm/madv_populate.c > +++ b/tools/testing/selftests/mm/madv_populate.c > @@ -264,14 +264,35 @@ static void test_softdirty(void) > munmap(addr, SIZE); > } > > +static int system_has_softdirty(void) > +{ > + /* > + * There is no way to check if the kernel supports soft-dirty, other > + * than by writing to a page and seeing if the bit was set. But the > + * tests are intended to check that the bit gets set when it should, so > + * doing that check would turn a potentially legitimate fail into a > + * skip. Fortunately, we know for sure that arm64 does not support > + * soft-dirty. So for now, let's just use the arch as a corse guide. > + */ > +#if defined(__aarch64__) > + return 0; > +#else > + return 1; > +#endif > +} I guess that will also make the compiler remove any traces of test_softdirty()( from the binary. Acked-by: David Hildenbrand -- Cheers, David / dhildenb