Message ID | 20230713172636.1705415-1-shikemeng@huaweicloud.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1709928vqm; Thu, 13 Jul 2023 02:56:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlEGMbSMM9m6+9dIovRw84u6gffrjCuuL7GvmxYqo+/51QpfHWyOX7dG7L8d3IpV/NQupYlk X-Received: by 2002:a05:6a20:4291:b0:11e:e940:441e with SMTP id o17-20020a056a20429100b0011ee940441emr512562pzj.25.1689242218056; Thu, 13 Jul 2023 02:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689242218; cv=none; d=google.com; s=arc-20160816; b=KPl7Mt25jPi+Cll7r1WVDK61Ztz9CiQNvy2ez+kqKzy5V3fXQ0wx4aEykc6MrvxHsu oUwJ1utOhxAJkuYnGIYGzFu8VDiuq68Lg/KeG30pnaQgj6/vTGDTur/YBVxvNN6eymFh vLPIHBGcWdfic+JD6bQ0U2ADp3pkO/btzwCdNdHOjwqFT+7jbZAJKGXtzW7CKm4kFcQn z2t+gIGBlcWd0WFuKkJR5Zt+15UDkv1T7I4IctxcJUfkWp2IMcJypM6c8a0lYZwbGSXA Wud99iPcUpJXaqjcke/7zrJsKYeMVHa+UQvSLjg706ZLpG/jZIkui1EJ4Rz8rMflwsZi zQkQ== 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 :message-id:date:subject:cc:to:from; bh=aJg2QYIBKOEOgnEw5GXDhuhCkq6mF7IBflS6AYT5heA=; fh=WKZA65K9ZtZmwHSIov1DdLmfcDgbkmpYeHTRaGkuc6g=; b=z3aXMIiAWvi+XbG77g9LgMBAOH9K+PbvA4+PgWya3e22KaNbRP0NF0J/u6OQkS+Zue 1GW1bLoZWRq+TjUeBU3WxjXRJD/zO/AZngTc2L17ziDA+I3+Y+6jcskNLLLNHnoWsbUn CQ8uCOEIKFxGxmxg1aOh/aDpX3/YkdS2hGybO+Csp94+hm3rCmfbM8jrbsqt8eH3x+53 QwRl+5N8v6mT++3LFC6ATq6MuI9icRI0DUqFIj3Gj6gKNLRr6JXeQvwfuoBMq/hfkArF +9Bzo1OhP8XiAgr83cNr2+PvdBo2sXkdF5nuLihX90Ypu3XS94etvh9DomMsrx2AZHyc Mmdg== ARC-Authentication-Results: i=1; mx.google.com; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a636907000000b005538c5bef9csi4611646pgc.452.2023.07.13.02.56.45; Thu, 13 Jul 2023 02:56:58 -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; 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 S234315AbjGMJ0Q (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Thu, 13 Jul 2023 05:26:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233146AbjGMJ0C (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 13 Jul 2023 05:26:02 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F316210A for <linux-kernel@vger.kernel.org>; Thu, 13 Jul 2023 02:25:59 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4R1q3Q2yGCz4f3lXD for <linux-kernel@vger.kernel.org>; Thu, 13 Jul 2023 17:25:54 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgDHu+khw69kr7cmNw--.13397S2; Thu, 13 Jul 2023 17:25:55 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: pasha.tatashin@soleen.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: shikemeng@huaweicloud.com Subject: [PATCH 0/8] Remove unused parameters in page_table_check Date: Fri, 14 Jul 2023 01:26:28 +0800 Message-Id: <20230713172636.1705415-1-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgDHu+khw69kr7cmNw--.13397S2 X-Coremail-Antispam: 1UD129KBjvJXoW7KFy8tF4UAF48Cw1rXF45Awb_yoW8XF4kpw nxX3sIqr4ru345Zr1UAr4vvr18J3y5JayxXFyxGr4Fqw1qyry8JF9rJFna9a95Ga4rJF4x KFWYqryUKF1UAFUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUv014x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2jI8I6cxK62vIxIIY0VWUZVW8XwA2ocxC64kIII 0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xv wVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4 x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG 64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r 1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAq YI8I648v4I1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4 xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1D MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I 0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v2 6r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7sRE SoGDUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771298848443546797 X-GMAIL-MSGID: 1771298848443546797 |
Series |
Remove unused parameters in page_table_check
|
|
Message
Kemeng Shi
July 13, 2023, 5:26 p.m. UTC
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! Kemeng Shi (8): mm/page_table_check: remove unused parameters in page_table_check_clear() mm/page_table_check: remove unused parameters in page_table_check_set() mm/page_table_check: remove unused parameter in [__]page_table_check_pte_clear mm/page_table_check: remove unused parameter in [__]page_table_check_pmd_clear mm/page_table_check: remove unused parameter in [__]page_table_check_pud_clear mm/page_table_check: remove unused parameter in [__]page_table_check_pte_set mm/page_table_check: remove unused parameter in [__]page_table_check_pmd_set mm/page_table_check: remove unused parameter in [__]page_table_check_pud_set 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(-)
Comments
On Thu, Jul 13, 2023 at 5:25 AM Kemeng Shi <shikemeng@huaweicloud.com> 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. Thank you, Pasha
On Sat, 22 Jul 2023 17:48:31 -0400 Pasha Tatashin <pasha.tatashin@soleen.com> wrote: > On Thu, Jul 13, 2023 at 5:25 AM Kemeng Shi <shikemeng@huaweicloud.com> 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(-)
On Mon, Jul 24, 2023 at 1:02 PM Andrew Morton <akpm@linux-foundation.org> wrote: > > On Sat, 22 Jul 2023 17:48:31 -0400 Pasha Tatashin <pasha.tatashin@soleen.com> wrote: > > > On Thu, Jul 13, 2023 at 5:25 AM Kemeng Shi <shikemeng@huaweicloud.com> 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: There is another argument: as a follow-up to https://lore.kernel.org/linux-mm/20230722231508.1030269-1-pasha.tatashin@soleen.com/, I plan to improve the debugging message instead of simple WARN_ON(), I want to print more information about what went wrong, what it means, and what was expected behaviour. Having more data about the mm, and the addr, is going to be useful for this extended warning message. set_p**_at functions have prototype like this: set_p**_at(mm, addr, ptep, pte), in these functions mm, and addr are also not used, as they call something like: set_pte(ptep, pte); directly, yet having access to mm, and addr is useful during debugging instead of rewriting them all over the kernel. Thank you, Pasha > > 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(-) > >