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 CB79FC433F5 for ; Tue, 19 Apr 2022 20:28:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 50E7A6B0072; Tue, 19 Apr 2022 16:28:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BDB06B0073; Tue, 19 Apr 2022 16:28:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2EB1D6B0074; Tue, 19 Apr 2022 16:28:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0068.hostedemail.com [216.40.44.68]) by kanga.kvack.org (Postfix) with ESMTP id 1D1F16B0072 for ; Tue, 19 Apr 2022 16:28:22 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id CBAF41830EF2C for ; Tue, 19 Apr 2022 20:28:21 +0000 (UTC) X-FDA: 79374766002.28.E5B30E5 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 30F111C0008 for ; Tue, 19 Apr 2022 20:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650400100; 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=OsA60fvdNpmPxi8j6BvsLbDUOJhRAOwM2lIshZoL7PY=; b=MdtfFPZAhYKsrbwqjHZNAua1lMAPQvKCZTxb1j+o4rvYDHzctgfx6S3GgIAcMV7jJWEw6u axuJmd18bNFlqJbW3p59f+rov63NbhcwYIIRx5/ZNVcFcLRgCKH0//x9KrhjhotldbEJGF 1KOryL/Fvsvr7JizoKr0YEyCDVoWPXw= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-263-fGOUSeY7MUejxLnl1x3UeA-1; Tue, 19 Apr 2022 16:28:19 -0400 X-MC-Unique: fGOUSeY7MUejxLnl1x3UeA-1 Received: by mail-io1-f70.google.com with SMTP id y20-20020a5e8714000000b0065494b96af2so5130912ioj.10 for ; Tue, 19 Apr 2022 13:28:19 -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=OsA60fvdNpmPxi8j6BvsLbDUOJhRAOwM2lIshZoL7PY=; b=DCFruya8vkudf72oYjDdpaLRZQ/Aoa31/CVWGvS0O0iqX2CVSfoBpkfSkpsOGNOkoH fbbxpcB+Pe7iAYoxPGHCNde+VfLUU4SAs2XZ+46oWxTe1CF5g4oQHO82mYdPSmYp2sbg dm/e5x9D7YZRn1UhXHpBGVh2OFxyeay4dyuU/D7rAUFIkd1Nz3hvLDmu91wKoSVlMlQD am3lJBrIlhS0eCS9nLy3S12C/vTuLE4sprRiAb19L4Cg99bANmmB5pef/iruWNoYjz8w Z3nd4WmzdDsz2XWlw9bXEY7o2iy3VKA96arMsmNlgRnHUQWQAy2dIZ2yqe4fi1yxo5Fa X+yA== X-Gm-Message-State: AOAM530CcYRbegxibRuWmdMLS/qAcUj/WdWi/zqQbS8cAwbPge8/C+IH 9LRuypP29puxZwPBnKZ0NogYtq+a0CTZsj56S+w6XARArY9fUrONixYv0Ny+mS7S58QqMqXqJF8 BJ9rqwHtEJeg= X-Received: by 2002:a92:d791:0:b0:2ca:bcb8:9a5a with SMTP id d17-20020a92d791000000b002cabcb89a5amr7687691iln.145.1650400099047; Tue, 19 Apr 2022 13:28:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsVN1a1qwuygonrXe33gOwAiggnDaz58sE6mHuxz4OZx70JBuF6/SjP2EtWHNEQouPdP2hKw== X-Received: by 2002:a92:d791:0:b0:2ca:bcb8:9a5a with SMTP id d17-20020a92d791000000b002cabcb89a5amr7687675iln.145.1650400098677; Tue, 19 Apr 2022 13:28:18 -0700 (PDT) Received: from xz-m1.local (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id a3-20020a5ec303000000b006496b4dd21csm10180422iok.5.2022.04.19.13.28.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Apr 2022 13:28:18 -0700 (PDT) Date: Tue, 19 Apr 2022 16:28:16 -0400 From: Peter Xu To: Johannes Weiner Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mike Kravetz , Nadav Amit , Matthew Wilcox , Mike Rapoport , David Hildenbrand , Hugh Dickins , Jerome Glisse , "Kirill A . Shutemov" , Andrea Arcangeli , Andrew Morton , Axel Rasmussen , Alistair Popple Subject: Re: [PATCH v8 22/23] mm: Enable PTE markers by default Message-ID: References: <20220405014646.13522-1-peterx@redhat.com> <20220405014929.15158-1-peterx@redhat.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-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 30F111C0008 X-Stat-Signature: q4d9nmfz3hsikzdpkcu9y49rffj3upgo Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MdtfFPZA; spf=none (imf18.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1650400100-679218 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 Tue, Apr 19, 2022 at 04:14:11PM -0400, Johannes Weiner wrote: > Hi Peter, > > On Tue, Apr 19, 2022 at 03:59:21PM -0400, Peter Xu wrote: > > @@ -910,16 +910,16 @@ config ANON_VMA_NAME > > difference in their name. > > > > config PTE_MARKER > > - bool "Marker PTEs support" > > - default y > > + bool > > > > help > > Allows to create marker PTEs for file-backed memory. > > > > config PTE_MARKER_UFFD_WP > > - bool "Marker PTEs support for userfaultfd write protection" > > + bool "Userfaultfd write protection support for shmem/hugetlbfs" > > default y > > - depends on PTE_MARKER && HAVE_ARCH_USERFAULTFD_WP > > + depends on HAVE_ARCH_USERFAULTFD_WP > > + select PTE_MARKER > > This is much easier to understand, thanks! Cool! Sent as a formal patch just now. > > Btw, this doesn't do much without userfaultfd being enabled in > general, right? So far yes, but I'm thinking there can be potential other users of PTE_MARKERS from mm world. The most close discussion is on the swap read failures and this patch proposed by Miaohe: https://lore.kernel.org/lkml/20220416030549.60559-1-linmiaohe@huawei.com/ So I hope we can still keep them around here under mm/ if possible, and from the gut feeling it really should.. > Would it make sense to have it next to 'config USERFAULTFD' as a > sub-option? Yes another good question. :) IIUC CONFIG_USERFAULTFD resides in init/Kconfig because it introduces a new syscall. Same to the rest of the bits for uffd since then, namely: - USERFAULTFD_WP - USERFAULTFD_MINOR What I am thinking now is the other way round of your suggestion: whether we should move most of them out, at least the _WP and _MINOR configs into mm/? Because IMHO they are really pure mm ideas and they're irrelevant to syscalls and init. Any thoughts? -- Peter Xu