Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3399954rwo; Mon, 24 Jul 2023 10:23:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlFV6ETQxnxvYEYFQksf1zRrSeqvouHH5u/uDngTxP1w/if9aFQx5ycaghCFskGZZ9j0fcp/ X-Received: by 2002:a17:907:7791:b0:97c:64bd:50a5 with SMTP id ky17-20020a170907779100b0097c64bd50a5mr10153581ejc.53.1690219418157; Mon, 24 Jul 2023 10:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690219418; cv=none; d=google.com; s=arc-20160816; b=qLPAfa87aJO5D4Tr1PQRLhtK6uhms/T2NS3QChezlOI1VGHnZTEp3nULGJUHJNw/lm NacwILNn06qXdg1aJUOa8UfD4AWsypqHQqSGqQ/s1MRPYtHXdYjxv5S4o/nm9SnwxpKG xZgSsAf6QHzn4jTMJx4oXQaWyXQmbdvLN4Xo7+aZORNq1rTRNyMsjNn/Sk+A/aNey2M9 5LeuqSWqsqO8EitJkjT6iS6ijHKgGJ4/QfTZUxbLMKrAb//Q+5srjGgTXdeWwoPqUKPJ XlWIie9+LgB6uCexg+FGjInOpP2r2HDnjxfYACO8YsHnvk9SzNg5YN785tS6KmxJuPHN FZlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9Jn70gK2E9JuvF8pJJ4XiXOMSgxUZjcHZzzevKsxFC8=; fh=htRfGIdxTYdk2QsmM+WSV50ilRnip/R7UIkjNIppUSs=; b=VC9SLuBQVpGP3mSfDn0msrAVAZNXdRQQ6VfjFnlFLQBNGjK3L/Ckn+32FP6lprNM4d 5hgjulpGO0goKIBIJJ4U9U5hRsD+8J83LRu+LCnCSaTsHAlChTyWy83ot/DiDRw1UU97 jqGU0p34oTDguzgQHVHwYjDEi2hReUbL8G3Fv5LpQmkScblqY/qnYIXDagsVUYvt7urA 6i0fP33uDzuzcgXCvR6cziDPm//yKdhWwcmcC9hQyj4zkU1OJvhKgu0R+UjPrYEteOfz HS5AW7MMgpAl7dQsCxk7wEN8TT0AJpStNW+tV4nBMx+Sn1aDxCureVM4Gpr8jaU3ahiU dehQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=m7LSK7wQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jt14-20020a170906dfce00b0099207b3bc46si7024537ejc.322.2023.07.24.10.23.14; Mon, 24 Jul 2023 10:23:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=m7LSK7wQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230130AbjGXRCf (ORCPT + 99 others); Mon, 24 Jul 2023 13:02:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbjGXRCd (ORCPT ); Mon, 24 Jul 2023 13:02:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A30C126 for ; Mon, 24 Jul 2023 10:02:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 91B32612C3 for ; Mon, 24 Jul 2023 17:02:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9BE6C433C8; Mon, 24 Jul 2023 17:02:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1690218152; bh=rLqU/nB+rUejTdVyQxhj4EwtasTp+9R+SPZMl9FIjNg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=m7LSK7wQro8BflGIDWOzGEudiMg1YiZFbRMcqPVTow6mPPmKAL5kJH0x4IBJiwzUo CUC4wI7eGx0h0kxAyI0WFApArC+lPQHdJXQRYbtUblHuynjoaZsd3BBCJDM4xWYShy JMxK4nWprLqxEZsHwUNexpPR6rPAc6ZccK28k2s4= Date: Mon, 24 Jul 2023 10:02:31 -0700 From: Andrew Morton To: Pasha Tatashin Cc: Kemeng Shi , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/8] Remove unused parameters in page_table_check Message-Id: <20230724100231.94abdfb007bea270d607a760@linux-foundation.org> In-Reply-To: References: <20230713172636.1705415-1-shikemeng@huaweicloud.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 22 Jul 2023 17:48:31 -0400 Pasha Tatashin wrote: > On Thu, Jul 13, 2023 at 5:25 AM Kemeng Shi wrote: > > > > Hi all, this series remove unused parameters in functions from > > page_table_check. The first 2 patches remove unused mm and addr > > parameters in static common functions page_table_check_clear and > > page_table_check_set. The last 6 patches remove unused addr parameter > > in some externed functions which only need addr for cleaned > > page_table_check_clear or page_table_check_set. There is no intended > > functional change. Thanks! > > NAK > > Both, mm and addr are common arguments that are used for PTE handling > in many parts of memory management even when they are not used in > every function. > > Currently, they are not used in page table check, but it is possible > we may need to use them in the future when support for other arches or > different types of page tables (i.e. extended page table) is added. It > is going to be hard to again modify all arch dependent code to add > these arguments back. > > Also, internally at Google we are using these arguments, as we have a > module that maps user memory in a way that is incompatible with > upstream, and these arguments are used to support this module. > I don't think these are very good arguments for carrying cruft in the mainline kernel. If such an architecture is introduced in the future or if google upstreams that module then we can restore one or both of these arguments at that time. This is hardly insurmountable: arch/arm64/include/asm/pgtable.h | 12 +++--- arch/riscv/include/asm/pgtable.h | 12 +++--- arch/x86/include/asm/pgtable.h | 16 ++++---- include/linux/page_table_check.h | 66 ++++++++++++-------------------- include/linux/pgtable.h | 6 +-- mm/page_table_check.c | 50 +++++++++--------------- 6 files changed, 65 insertions(+), 97 deletions(-)