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=-7.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 2A1B9C433FE for ; Wed, 22 Sep 2021 00:29:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A9CC8611C6 for ; Wed, 22 Sep 2021 00:29:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A9CC8611C6 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 E60FB6B006C; Tue, 21 Sep 2021 20:29:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E10126B0072; Tue, 21 Sep 2021 20:29:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB0DF900002; Tue, 21 Sep 2021 20:29:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0230.hostedemail.com [216.40.44.230]) by kanga.kvack.org (Postfix) with ESMTP id BECDB6B006C for ; Tue, 21 Sep 2021 20:29:24 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 725B02FD91 for ; Wed, 22 Sep 2021 00:29:24 +0000 (UTC) X-FDA: 78613325448.31.EFC9B56 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf27.hostedemail.com (Postfix) with ESMTP id 0611A7000081 for ; Wed, 22 Sep 2021 00:29:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632270563; 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=NmEXaXF/Zeuy5snsjO8cTG6bYqexhCWu35mF9eZUaWg=; b=AzFDPB0imFshaOw23EtGuiiOI8QdBcIKMSjqeeDEgxu3+VoXn9adsJPfTcoeTeL9PwnMQ1 e76OaxROXPhb06YOl0nUrtw7s1DwtcGA4r3YEXwUvoErXYFfEiDLRMglsj2ZQlAPolaPWN T5IsW+kH2ZiMmyHfrgWMuOu0TVZPchw= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-458-v8Xs8Yz3OuCiI3y8p4dZVA-1; Tue, 21 Sep 2021 20:29:22 -0400 X-MC-Unique: v8Xs8Yz3OuCiI3y8p4dZVA-1 Received: by mail-qk1-f197.google.com with SMTP id bi14-20020a05620a318e00b00432f0915dd6so6183539qkb.6 for ; Tue, 21 Sep 2021 17:29:22 -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=NmEXaXF/Zeuy5snsjO8cTG6bYqexhCWu35mF9eZUaWg=; b=lNjr7ja/d9HlkM9snuKzryJMBABbqiEph21TRxqXKRt07fPvDBn+y2MNY36wFKxfjr 1p+14H2OVDb45b7zara4rt7r+ob7NxAkLQOSeJqwsZDb7yGdL0wXqeTk42D431n8Pfkx oqJtpyTPWqL7ccr6fHO5/+U5BtJH82YAJisLXjPS9TzknVuwfNuVgz1whNWGFbxnZCa7 4HCTXGKBD3dacV9FWONWYQsBmU7aa2lmc1JRwBVVbMdA06MeM6fuPfBtDdiarusgAWkx 1vh7hFCc4yXxoN7ZStZdIamKAb/AVLX5cByNYPTpkn+BnLQbYvfT8S4tq5NeilIB8H3y 7ULg== X-Gm-Message-State: AOAM533kcdV7HKZqWwmqpEimztV06knFI3O19RR/Q9hX1QPFYGbJxzLE 9u9UvKhxyRelmK8YHt80OgJdaxORu4ekoKlUlzKi01PPx7a1Zrl4ZG4JMGnI65VSWoJT36ZhQGj kWz/kKS9Syho= X-Received: by 2002:a05:620a:524:: with SMTP id h4mr3517159qkh.320.1632270561731; Tue, 21 Sep 2021 17:29:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzp8OHGlxNnMNUsKkbTB5lbA+kEvBE9p0uF3GnGKhmEwdsDq6bdIOgUAQGlx7CMSNBruskFFA== X-Received: by 2002:a05:620a:524:: with SMTP id h4mr3517145qkh.320.1632270561484; Tue, 21 Sep 2021 17:29:21 -0700 (PDT) Received: from t490s ([2607:fea8:56a2:9100::d3ec]) by smtp.gmail.com with ESMTPSA id i6sm416278qtx.40.2021.09.21.17.29.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 17:29:20 -0700 (PDT) Date: Tue, 21 Sep 2021 20:29:19 -0400 From: Peter Xu To: Axel Rasmussen Cc: Andrew Morton , Shuah Khan , Linux MM , Linuxkselftest , LKML 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: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 0611A7000081 X-Stat-Signature: 1esbifbyj3o9biugz8jakom73ty11spo Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=AzFDPB0i; spf=none (imf27.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-HE-Tag: 1632270563-765257 X-Bogosity: Ham, tests=bogofilter, spamicity=0.261608, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Sep 21, 2021 at 01:31:12PM -0700, Axel Rasmussen wrote: > Ah, it has to do with us asserting the list of expected ioctls. The > kernel changes the list of ioctls it reports in response to a > UFFDIO_REGISTER, depending on the particular kind of vma being > registered, **as well as what mode(s) it is being registered with**. > > So for example, consider the hugetlb_shared test. When registering, > the kernel might set the UFFDIO_CONTINUE bit or not, depending on > whether we registered with the MINOR mode bit set in particular. I can understand your point, but the "capability set" of the kernel is still the same. In this case we should have UFFDIO_CONTINUE capability for hugetlb_shared test globally, as long as the kernel supports it, irrelevant of what test case we're going to have. Then in the test, if we don't register with MINOR mode, IMHO we should just mask out the expected_ioctls with UFFDIO_CONTINUE because it does not make sense to request UFFDIO_CONTINUE if we will never use it in the test. In other words, having a "uffd_features" global variable and having it changing all the time during tests is odd to me, but I agree it's not a big deal. :) -- Peter Xu