Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2940384pxb; Tue, 21 Sep 2021 10:46:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRmtGGuo635VrCpp3SH5qiUaNDPrROkzwiXj5KOPFd+KVA2nPvinsFGmjGqNBvBCNHXiF8 X-Received: by 2002:a05:6e02:1c84:: with SMTP id w4mr11298523ill.219.1632246374427; Tue, 21 Sep 2021 10:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632246374; cv=none; d=google.com; s=arc-20160816; b=ShdPqyWlHDW8gF3XAyPlFPMB94bdspHxmMrIcoSYFaNSeybu3OV/C73VNp6QRmqHxu qdonYMaxsYdadyl25RL02BG8gWdZhSyPHbgc2t5sWZ21BG/iNKongLvSAVqdVTwbfEqs 0jnAGs2HNlxWd3Dwrr/gNmrpSK7ce2H3/KvuCcxuQrimFXRq0wtivdiBE983NA0YNx7n W2S4Ev5NTq6TX6YdOT83ZENQl8HyYBmiu9eVhytVozs4VQrD84CE3klXtPqVsh9mxP/o nCIWe9l8vPQwC5XltgrgM51Lst5yMQIcYSkkvljzql2RJ0DjWIpbVjDx6V+6sGmiv9ot UkEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6N8VBe8svoga5drgehLwNuhZWfQ1ETQys67yELw2/Tg=; b=Zd+W/n7FaoOj65sF5fJgsIOH5A9cUcxIWY4xVaBpltLphzoX3rpfdGOmNITPcNYsBG 1AtcOVgjqEqNy98CgFPoBTfw7VOyAAb7KwT4ajwNQpUEBNbxRy+XlG2CFmFKFxncNL8t KB9dH/9Po15y27e9gPxmZqybHLe3RknHEQEXYoJNArmgastPT3q4KWbjXHDS2eP8Ehnr ThJxrQgLNikX+9/Q8u7s4hVBSS+WdjIR6pKmahMncipdXBOy3VU3MRBgT3L9A4jIY4MH ujZiDRGbJ+BEWIRLyecReLBDH+/yuU8vI7HtY3RWzPoji3tekI0OZTXdxo/JmS/Ges+q EE8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KZDyWpp7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si16163975ile.86.2021.09.21.10.45.59; Tue, 21 Sep 2021 10:46:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KZDyWpp7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231395AbhIURqW (ORCPT + 99 others); Tue, 21 Sep 2021 13:46:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51627 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231224AbhIURqT (ORCPT ); Tue, 21 Sep 2021 13:46:19 -0400 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-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-271-SM617vWSP--MGrnr5-jR9w-1; Tue, 21 Sep 2021 13:44:49 -0400 X-MC-Unique: SM617vWSP--MGrnr5-jR9w-1 Received: by mail-qv1-f72.google.com with SMTP id a15-20020a0ce34f000000b0037a944f655dso2396846qvm.5 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=jyqrSYYtCFmOaNbkB4Tr/ARAsGesvPgISvRzJTBHpbu/E1qMra0Vj2AwT7fGoo2Uxf oFZ68gAsLxixJz9VsDXZIOjpTlTjlx91k+5ECkauCFxQFMB8COJMp6YKla5Td7SQQbS3 0rSSt/ux0LQwsXTM3uLMWq4pwORFbef5qdOI8t2r7ZhApm37vWlqZRHKqNdpmGFBJy7Q HrcOsFQlv9yCWGShdfNlNGaOLFaM+vPNrckFkM0NHBbt9gPHPuVJaEhMNHUqVKGVV+Qb dy0BINKhmGGkpV8zPq+NbYNRMXHYeo4unxcpGozmrfeMOta0Q2/EBCOyjtfGoXX0hGxj 4mjQ== X-Gm-Message-State: AOAM532Rz5wbMqIKG/xubwpo6ZgRLeoHbvPj8l7JWxthgxfhpqlJRUri JyPsJ9Y0wver/O+PLfjjr4gacXkIk2OyWFfE1eqqQrtaK9fRvwIz1jS3gt15XN8LeZ14tYE+xKL 47/Pmh2lnipPiHK62XwFAI+TA X-Received: by 2002:ac8:c82:: with SMTP id n2mr28687282qti.207.1632246288972; Tue, 21 Sep 2021 10:44:48 -0700 (PDT) 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 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210921163323.944352-1-axelrasmussen@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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