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 394D4C001B0 for ; Mon, 24 Jul 2023 17:18:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 901CC6B007B; Mon, 24 Jul 2023 13:18:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B2256B007D; Mon, 24 Jul 2023 13:18:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 779CF8E0001; Mon, 24 Jul 2023 13:18:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 6568C6B007B for ; Mon, 24 Jul 2023 13:18:00 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2CEA3B2211 for ; Mon, 24 Jul 2023 17:18:00 +0000 (UTC) X-FDA: 81047163120.14.CB04EF2 Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by imf14.hostedemail.com (Postfix) with ESMTP id 32F6310000A for ; Mon, 24 Jul 2023 17:17:57 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=OTGPEUMa; spf=pass (imf14.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.181 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690219078; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YYSBbwb0q7mkdVpvxRgFuvQmjMykcBQE+odbDhlX2Es=; b=5UU5dI5V9M+ndJ5b0g8trU0R35pqRsfidO8g2rH+Ny9GOf0vvNQ2eHBkev/uo01ZvNW7Wp fbrw7YdLAiKb9/sPpdT76tMn/VxGvuK4SHpuYqd7l6yF0cChSWuzKM6CQiRu6YIJK27LCC MXIr1wTlJEj+gyKhs63ATgQqQVnol0Q= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690219078; a=rsa-sha256; cv=none; b=JLRpwo2GeuCtmLhM0DFvyRqhiZBMnFp/yG2JAbG/jDbSP9Tm+Mx23mWLrSsgdfrp0ObF9P 6P/hSnum6AOGyhI3i85CPGrpYkD6Pyeph8hL4lfzEOjjYdPm1Sa1XNjn3nLBh4H8hF90Gr MtAlFM9yGruEZl49T+Fq7ancbmhIc4Y= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=OTGPEUMa; spf=pass (imf14.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.181 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=none Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-403cb525738so40085661cf.2 for ; Mon, 24 Jul 2023 10:17:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1690219077; x=1690823877; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YYSBbwb0q7mkdVpvxRgFuvQmjMykcBQE+odbDhlX2Es=; b=OTGPEUMaZkmEGJhZuPPaE7EZ65sIqpFRcjmJpWnc56LqjLKnDcSe0BDMfj0WK6jQpC 1AFo/BHJEWX8lB7UGSzlzAlyPuBgGZliyW3Gw5URzFJg4warwLTO/olLrbIcHoOJr0ws /SEiJelGVnNhIBlKopNw2pgQUIONiJTMpavAZLBRMYW0goyTI+MJQo0x9OLo5lmOzMKO iP3mm3WOh/brK8yfgwNVQODAbxY7YUU5IYH7zOnW92dKkAZ7KBEAmMxpWVfJDuTBV7cb RgTIChkNhihcPbfuHP0zh6di77B4kj2nuzxMGQUOpT5wyWlGYrMYpB+QEIdvcmfLY3nC X9Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690219077; x=1690823877; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YYSBbwb0q7mkdVpvxRgFuvQmjMykcBQE+odbDhlX2Es=; b=bAIIrr39KsHa7FYYDXP7WDgUYngFdNSHRAICjW7FYnbt/REGOO2BhibeQtM8++IoaW uCxPXLgFOtFqYJ0qJsoyCfP+XYnXNEd+xoYvhqIkbehA3k36SJzXInGZpgT0YyhZRAhD EV+UFPPP1VbDpBcrA3rYDG4y8jWDBRFkptm9yySjqX2OdYfS5Onx/6eXqjJtfscOUb6s jBUFfAwfGi4zbiJGD6tf+jaGAkLaWMuQzHXeCjGt+7JUM0aIXIB8m/ti8qjJOp87YLRA r/XhRnqP3LaLKBU9fsGP+o+XKv6L5b3zhyDPJiM2e47ywKHgMexFRXqS7LcN+X1jjd2k /Tjg== X-Gm-Message-State: ABy/qLZ1ZALzXpyt4OnNLiLPHh+ujbRyBBRCd9jxBM1WzSjL787HpD4S Sp5WfWlunSDvmz2xd4oYazpt5BasxwSKbkTKXrgPXGvmvpW0EWzwNow= X-Google-Smtp-Source: APBJJlEgh6eXM3hYeN5fH1jeltcLY7xxixaWZ2KePlt78V6dhQhW0u99v1a/m1HTda+aR4pbFg2gjm5swOjZaDmLm+8= X-Received: by 2002:ac8:5b92:0:b0:403:aed5:a3b3 with SMTP id a18-20020ac85b92000000b00403aed5a3b3mr400763qta.66.1690219076185; Mon, 24 Jul 2023 10:17:56 -0700 (PDT) MIME-Version: 1.0 References: <20230713172636.1705415-1-shikemeng@huaweicloud.com> <20230724100231.94abdfb007bea270d607a760@linux-foundation.org> In-Reply-To: <20230724100231.94abdfb007bea270d607a760@linux-foundation.org> From: Pasha Tatashin Date: Mon, 24 Jul 2023 13:17:20 -0400 Message-ID: Subject: Re: [PATCH 0/8] Remove unused parameters in page_table_check To: Andrew Morton Cc: Kemeng Shi , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 32F6310000A X-Rspam-User: X-Stat-Signature: 149djofrcxbc5sduad53jxmxjffjwwp7 X-Rspamd-Server: rspam03 X-HE-Tag: 1690219077-267842 X-HE-Meta: U2FsdGVkX1/eFwZ9leteMAE2Ss07Bc9zyTQ+IvaT7PyMOlXOBympAAU4ElgxqD+Rx7zXz1ifnkIoKbR9zifTOG8QtzJVw1x/l0Dt+I0qGBm5ICSZYCMoNm3VqbuNgpw7v7dgyy3n+y6jRaTSbu02BJk4+UT3crx9byiyf2/M5v4w6BYbp0tVcb6UJ9LWXFTwhpSj+X2ab58KzbVu9P5jFKgh9N6Zwa/EFpI3txodMYB8RkDPHLMV9B5UmRdMG+oIyNab30LlMvaPFepky/oawmGOVObxfJWBhsHOjqurQQNEaGF0N3fejBtSSKdMpGoTjnNTXrYNrXJLlPzbVKqriUZWBFoN/RgFpCZL00jONEXUQuxAMzncQGI9qZh1hVZOMYSVkkdsa4Gmwo/pmjpXNUUZnW7q01aQWTF7JKeX5Rsyy7CFzCsmuMtYjX1OcgLpbbe1F3ySZq3wt8txq8mLzu4Vx7Jvl8iCOqrnFitbwClVsaLk10jbIk180hYMzlN9I+De0ljZ9ZAE+/OwCwfTWShu1pePHWekm82y61pXpTVDa78JxNieUAREBReFFxDsti4iEj7qhRoa4sz5Lh+PIE127NesD6RwX1CVf2mCNpLJNZ8+ygy/bgzZ5xF5TgcQYhK41nPzdBinWc656nNlae59QPbsGZYmxMFN1aIQnRHoD5EUFuKZt+hkI2QgS1ccqkcQD9QbNvtZ7wTAdJSejXV3IPn3bzU+XOm92vClhU3h1kAyvHCJJ/MKwiUBFNtlzRMHwdIKe6kNwdNyEAzs9WS47orTGWkr0vZLaoPzYC/XQEvsSbjBDe/J8B67gNujXwbLkEPSliSBFl+5szrRbfb8+SrRue61rCteDJ5ePPEqhAM+Jlmnxjxn68urb2P1ugfe72gNKWtp3UMPpcSmJCj8DaeJdxcNifgvepqECzJP9uGd+jx+Lzi9XKFL7WaGbgmKmlQEfdbSBBYliTf YefOXcoJ 7/UHtaJ40iUVFUBqv8DaIOS3JMitEaEb3riwqCmP3rv7/i4lvyD/WkSndhdign2j8WNsWKN02mUmGPC+IP7ZM3gjKBSRm31hHn5jCxAyzJwBNs0y8pYeJ3RSOvk11QCHz7m3wh044oLMCPf2J2tCjj8/LwlTKqajimOXEN+6X3tT73cbDIDDwv5hbHNq1VIhhDtMO2VM/yWuwdHM6u+SUz9EnW0nx0SBYVSOjRU9o01R6N68q05/tSK3nVjf5/N/3AyGWhJVZHsYrduXd4cdOi2PnBGsoBmoFwKyS8YUAPq2L4qHZRwoeXFWaWVD1edmeOkNufU92Av447uqBH87ZwzDFqwD6DXHwBHxDQP+UrJX7ROIUOoTMA2jlATNODttRVNToKJ0eGmTEqWvioa0CMHlecyYpdM7rkTJdtTpSuZnRbh0wqqIEC2D1xbrAh5UohA8notkwtvh/7OapA2jeP2mlvkTs7sFWF61G+vNOBfktqr4= 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 Mon, Jul 24, 2023 at 1:02=E2=80=AFPM Andrew Morton wrote: > > On Sat, 22 Jul 2023 17:48:31 -0400 Pasha Tatashin wrote: > > > On Thu, Jul 13, 2023 at 5:25=E2=80=AFAM 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: There is another argument: as a follow-up to https://lore.kernel.org/linux-mm/20230722231508.1030269-1-pasha.tatashin@so= leen.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(-) > >