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 X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82561C433EF for ; Tue, 21 Sep 2021 17:44:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0F28561211 for ; Tue, 21 Sep 2021 17:44:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0F28561211 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 41DD8900002; Tue, 21 Sep 2021 13:44:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3CCBB6B0071; Tue, 21 Sep 2021 13:44:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 26C9A900002; Tue, 21 Sep 2021 13:44:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0100.hostedemail.com [216.40.44.100]) by kanga.kvack.org (Postfix) with ESMTP id 17ED46B006C for ; Tue, 21 Sep 2021 13:44:52 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C552C2D240 for ; Tue, 21 Sep 2021 17:44:51 +0000 (UTC) X-FDA: 78612305982.01.E5121F1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 3E80D6001987 for ; Tue, 21 Sep 2021 17:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632246290; 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: in-reply-to:in-reply-to:references:references; bh=6N8VBe8svoga5drgehLwNuhZWfQ1ETQys67yELw2/Tg=; b=KZDyWpp7mILh/P9knM218+b1XphrWmsrWhPHyZf9Y0rlWPNAqB0BLyoYat6rvlzjYVk4XW DzkthntFhZ4JlU2dCyPxwp+PF+hEKZ4YRNg/4pmwow+nolnrv0alRdCGbSE32uNOpYXsl4 oPktlPPaBftd+Em0/U7YIBlFAm1vjuk= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-580-xSNexuvvNOeVCbNdbFI8QA-1; Tue, 21 Sep 2021 13:44:49 -0400 X-MC-Unique: xSNexuvvNOeVCbNdbFI8QA-1 Received: by mail-qt1-f199.google.com with SMTP id 70-20020aed20cc000000b002a69b3ea30aso87893898qtb.15 for ; Tue, 21 Sep 2021 10:44:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6N8VBe8svoga5drgehLwNuhZWfQ1ETQys67yELw2/Tg=; b=goeZphs27AVgU9ir2xnf3nZG/ddgLNPfP/Py3iHaqtKN79HO92imNhjAPo92Zwy4tb ut1sgZ3abtxgYv1VnAPCNLyiOra+8T0Bb9SKfd21b7In0aMPnDw5yFgl2Gey/yXuVY7B ihpp3DLAjyqKoMcbsHQThGoigxW/kYEsq+++YLhi4UkBML8q5ZBsvq9qksTd1wwOUzAS Cve48pNHDlM5kpBZdDV0UFjdmVjo57+tu7PLTEkO5ghZ6rA2PwQqnKAl4oALlFghzAi1 3Y27/n52vvgiPAPMHYXmX+7AROUV6EjUQa1dIlbdCtlj1TLTAYQIMehcwNgFSIJxSaK2 O09A== X-Gm-Message-State: AOAM5307KjXiPvqoU2jjMLDO8w4j/n51wBn2qZMt/6KQQb5glA5Kr25M k2u0YyP3GJG9ja3OMAHscoWEHbYgU4LslQZcj1suHhHEQhmbArTIuD0hFkkRiHq7IIlXZShqz6J ewmeM911ADsE= X-Received: by 2002:ac8:c82:: with SMTP id n2mr28687281qti.207.1632246288972; Tue, 21 Sep 2021 10:44:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgQa6neroe9CMH682piLnpJaVS6v7I40G1JveuyTUzPPf5Wna6pHN4DAOUOCXGJxiczKobow== X-Received: by 2002:ac8:c82:: with SMTP id n2mr28687257qti.207.1632246288683; Tue, 21 Sep 2021 10:44:48 -0700 (PDT) Received: from t490s ([2607:fea8:56a2:9100::d3ec]) by smtp.gmail.com with ESMTPSA id z10sm4827915qtv.6.2021.09.21.10.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 10:44:48 -0700 (PDT) Date: Tue, 21 Sep 2021 13:44:46 -0400 From: Peter Xu To: Axel Rasmussen Cc: Andrew Morton , Shuah Khan , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] userfaultfd/selftests: fix feature support detection Message-ID: References: <20210921163323.944352-1-axelrasmussen@google.com> MIME-Version: 1.0 In-Reply-To: <20210921163323.944352-1-axelrasmussen@google.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KZDyWpp7; spf=none (imf10.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: cdpdciisma38z5ppbpppgq8pswcdyjds X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 3E80D6001987 X-HE-Tag: 1632246291-439667 X-Bogosity: Ham, tests=bogofilter, spamicity=0.021647, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi, Axel, On Tue, Sep 21, 2021 at 09:33:21AM -0700, Axel Rasmussen wrote: > diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c > index 10ab56c2484a..2366caf90435 100644 > --- a/tools/testing/selftests/vm/userfaultfd.c > +++ b/tools/testing/selftests/vm/userfaultfd.c > @@ -79,10 +79,6 @@ static int test_type; > #define ALARM_INTERVAL_SECS 10 > static volatile bool test_uffdio_copy_eexist = true; > static volatile bool test_uffdio_zeropage_eexist = true; > -/* Whether to test uffd write-protection */ > -static bool test_uffdio_wp = false; > -/* Whether to test uffd minor faults */ > -static bool test_uffdio_minor = false; IMHO it's not a fault to have these variables; they're still the fastest way to do branching. It's just that in some cases we should set them to "false" rather than "true", am I right? How about we just set them properly in set_test_type? Say, we can fetch the feature bits in set_test_type rather than assuming it's only related to the type of memory. Thanks, -- Peter Xu