From patchwork Fri Apr 29 13:35:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 12832011 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 4363BC433EF for ; Fri, 29 Apr 2022 13:36:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D039A6B007D; Fri, 29 Apr 2022 09:36:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CB3836B007E; Fri, 29 Apr 2022 09:36:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B7CA46B0080; Fri, 29 Apr 2022 09:36:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id A9F426B007D for ; Fri, 29 Apr 2022 09:36:53 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 855FB206CE for ; Fri, 29 Apr 2022 13:36:53 +0000 (UTC) X-FDA: 79410017106.14.9486543 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by imf26.hostedemail.com (Postfix) with ESMTP id 44024140019 for ; Fri, 29 Apr 2022 13:36:51 +0000 (UTC) Received: by mail-pj1-f50.google.com with SMTP id j8-20020a17090a060800b001cd4fb60dccso7296843pjj.2 for ; Fri, 29 Apr 2022 06:36:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mtrvfydE+wjlh8q+BDcMPZBC4jr9kvSALqoUY6wVrYg=; b=k8n9XhC/kWX+O8zBpqQG6cpY+9Tk08Geziwyjeu7tMaVC30yvyM7eOUm07SBr/4qEX xGqxG4TTH1PT6oqMgQaRTtltsursPhk1i+MdgOQ1+/JIIumQOzWrxXnaddl/A1Tn59BI cgiuxGNjxUI1TWVPKG3eDAjqjWUBdRQBpMufheg8/dbNPMOFvTm1MSRw1X4GaUzRJLAi 68ZJScRb/+LlLB4Z4jQd070JkFSQskomWSs4klopW+l35QRFY/XgBDVCI8aVPLQramu0 VklkPI8+1fbvC+YaQ6exBpg29zS3OdVQh36+iqKyd4OEuTm0Yh9T6sP0mw9P1ytkJmvV B+Cg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=mtrvfydE+wjlh8q+BDcMPZBC4jr9kvSALqoUY6wVrYg=; b=dj7hyN5snuY8haB+dk1PiyNcQ4r7nZ2H+58ZhFOJ1ESmf1ve3Z+Qc/I4rWjqevKHVf PaVCAnourfJi2OBjECpWUlGriCRlkYIOMYxNr0x05gjR+moT7JnvyEJ2gOLNtgt/CBZk 9d5sQmO061hdLgANy+xVtfPINc5jO0PEU9Q50SueQfckW8SXRBOJH7bHjkEowFS4rigw B1pNFU5ohmscGdYb5lw+t4Y+BBN+2MSlsAI5hvLArjoMOh1aMe2YPCX+qSHn8jH1vDsA 8ozDW/Mn256QDa3CQIq7vlDoZSoEn4S7VHRRJ4i6EYgBEHZxBgf2IZYzbYY6Gg0PvQB3 AquQ== X-Gm-Message-State: AOAM533TMK5vxiMDGPEALi+JufYks6Qaa9x6mD3TrE3SsODmO2qdX7Jj cSAx6McJidl/U+8kq6uuCu6tDQ== X-Google-Smtp-Source: ABdhPJxkwZhomXI1CyZvZSH/IPeC0YUXjZY29+uiw0fkUp1dwm5zxcysMSj/RCsHmgPONsDBh4zerQ== X-Received: by 2002:a17:90b:1a8b:b0:1d9:971d:4269 with SMTP id ng11-20020a17090b1a8b00b001d9971d4269mr4032863pjb.65.1651239412204; Fri, 29 Apr 2022 06:36:52 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.240]) by smtp.gmail.com with ESMTPSA id m8-20020a17090a414800b001d81a30c437sm10681977pjg.50.2022.04.29.06.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 06:36:51 -0700 (PDT) From: Qi Zheng To: akpm@linux-foundation.org, tglx@linutronix.de, kirill.shutemov@linux.intel.com, mika.penttila@nextfour.com, david@redhat.com, jgg@nvidia.com, tj@kernel.org, dennis@kernel.org, ming.lei@redhat.com Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, songmuchun@bytedance.com, zhouchengming@bytedance.com, Qi Zheng Subject: [RFC PATCH 06/18] mm: introduce CONFIG_FREE_USER_PTE Date: Fri, 29 Apr 2022 21:35:40 +0800 Message-Id: <20220429133552.33768-7-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20220429133552.33768-1-zhengqi.arch@bytedance.com> References: <20220429133552.33768-1-zhengqi.arch@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 44024140019 X-Stat-Signature: fwbkkg7bonkdohpri6hrkxh431qnqj8e X-Rspam-User: Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="k8n9XhC/"; spf=pass (imf26.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.50 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1651239411-424786 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000528, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This configuration variable will be used to build the code needed to free user PTE page table pages. The PTE page table setting and clearing functions(such as set_pte_at()) are in the architecture's files, and these functions will be hooked to implement FREE_USER_PTE, so the architecture support is needed. Signed-off-by: Qi Zheng --- mm/Kconfig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index 034d87953600..af99ed626732 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -909,6 +909,16 @@ config ANON_VMA_NAME area from being merged with adjacent virtual memory areas due to the difference in their name. +config ARCH_SUPPORTS_FREE_USER_PTE + def_bool n + +config FREE_USER_PTE + bool "Free user PTE page tables" + default y + depends on ARCH_SUPPORTS_FREE_USER_PTE && MMU && SMP + help + Try to free user PTE page table page when its all entries are none. + source "mm/damon/Kconfig" endmenu