From patchwork Tue Apr 19 20:25:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12819402 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 19233C433EF for ; Tue, 19 Apr 2022 20:25:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2A0CC6B0072; Tue, 19 Apr 2022 16:25:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 250526B0073; Tue, 19 Apr 2022 16:25:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0A3BB6B0074; Tue, 19 Apr 2022 16:25:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id EE7E96B0072 for ; Tue, 19 Apr 2022 16:25:37 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B80D06189F for ; Tue, 19 Apr 2022 20:25:37 +0000 (UTC) X-FDA: 79374759114.15.34ED8D9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf12.hostedemail.com (Postfix) with ESMTP id 7D0FB40011 for ; Tue, 19 Apr 2022 20:25:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650399936; 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; bh=ax1hiIZ0I02ZmnVoS1FQGYcdelIwXVMzf8EDN4fi9ww=; b=MX1mpwCD52cQqxz8sOif9zOvldjgm9D006UbUprR12cmZEfz4mGvw6Jiq97AJ2DK3luDTl iI40ge4fivcrPQpuAzsKawnwRUwx5bq5yK2F0N6nY52lSzezTXDTIMmcINfT+AHr638mRV mCFqPtWnF5OLS1cXDzKypJimWGBGgz4= Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-138-3WgfSHzSM0GkgknM3a-Xzw-1; Tue, 19 Apr 2022 16:25:35 -0400 X-MC-Unique: 3WgfSHzSM0GkgknM3a-Xzw-1 Received: by mail-io1-f71.google.com with SMTP id u18-20020a5d8712000000b0064c7a7c497aso12492417iom.18 for ; Tue, 19 Apr 2022 13:25:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ax1hiIZ0I02ZmnVoS1FQGYcdelIwXVMzf8EDN4fi9ww=; b=2ivXJvhLWhkrwgQX1RJoyS//v334lvtnuE4TXlNCDcJeJTxq9RduuhgygO0KcZL2qK j3ckk3Jt+WAbi4uqxazym/DfvnWMEcIvWXZnb2NZWQUrPrOZRGCA8bgic/ylQ2CDm9TS vBcFG/LdjM8eGIEo4YTWUflUqfDyG5GXvAPihZuOOXn96XFmoYAH/kbTfNiE28jKnZED psYQGDXsZwEPRqkov+upMjBgVH/sG1UZrvh6lxWiQb+dBSCYLIjDi2jyVcYAVAvstmTw 4tCraG2kukAQLhgaVoHW9eW7RBZY+fmCXJsuQTti6RdOT/sGJ0+SanSTUv+yYmhLg8dT hBmQ== X-Gm-Message-State: AOAM532TVA/xvl1j9d03lIZhShatZzHJCOqbp2SHBSTKCJDmcXDpRJmn AJD9LR26bh2ZcFZQPOvSa1FVgAGplivKiKiOgIXiIuksRT1Q/bEZ9NBwvKYo5GfaqN3ixET8mVn 0NFC/pfEA4nkWCKkcaR19mOjyCC55YS7YKoiHk1ZcjyeqrguUMmGsC3a1vkc7 X-Received: by 2002:a92:508:0:b0:2cb:ebd8:a76b with SMTP id q8-20020a920508000000b002cbebd8a76bmr7979252ile.156.1650399934666; Tue, 19 Apr 2022 13:25:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHYRlcO9x0OUHBCz2/TrnKyl0H5zUpCoJ20gT+VTXDMr9UebvFOOiY+EiFAxleSo0TP00xXg== X-Received: by 2002:a92:508:0:b0:2cb:ebd8:a76b with SMTP id q8-20020a920508000000b002cbebd8a76bmr7979232ile.156.1650399934379; Tue, 19 Apr 2022 13:25:34 -0700 (PDT) Received: from localhost.localdomain (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id i11-20020a92540b000000b002c9a82e8dacsm9403836ilb.32.2022.04.19.13.25.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Apr 2022 13:25:34 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Alistair Popple , Mike Kravetz , Johannes Weiner , Nadav Amit , Axel Rasmussen , peterx@redhat.com, Andrea Arcangeli , Mike Rapoport , Andrew Morton Subject: [PATCH] mm/uffd: Hide PTE_MARKER option Date: Tue, 19 Apr 2022 16:25:31 -0400 Message-Id: <20220419202531.27415-1-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 7D0FB40011 X-Stat-Signature: uarrydxz7isdkj4xbtx56sx587mqjjka Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MX1mpwCD; spf=none (imf12.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: 1650399935-209588 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: The PTE_MARKER option should not need to be exposed to the kernel builder, keep it internal and remove the prompt so it won't be seen. Instead, make the PTE_MARKER_UFFD_WP option to explicitly choose PTE_MARKER when necessary. While PTE_MARKER_UFFD_WP will still prompt to user, change the wording so that it'll not mention PTE_MARKER at all but renaming it to "Userfaultfd write protection support for shmem/hugetlbfs". Reported-by: Johannes Weiner Signed-off-by: Peter Xu Acked-by: Johannes Weiner --- NOTE: IMHO this patch can either be standalone if easier, or be squashed into patch "mm: Enable PTE markers by default" in -mm. Please review, thanks. --- mm/Kconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/Kconfig b/mm/Kconfig index 3eca34c864c5..d740e1ff3b2f 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -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 help Allows to create marker PTEs for userfaultfd write protection