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 5BDE2C4828F for ; Sun, 4 Feb 2024 12:15:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A0E0C6B0074; Sun, 4 Feb 2024 07:15:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9BEC46B0075; Sun, 4 Feb 2024 07:15:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8AD606B0078; Sun, 4 Feb 2024 07:15:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 7C4846B0074 for ; Sun, 4 Feb 2024 07:15:36 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 48EA3120299 for ; Sun, 4 Feb 2024 12:15:36 +0000 (UTC) X-FDA: 81754017072.11.948E867 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf02.hostedemail.com (Postfix) with ESMTP id 9BF818000E for ; Sun, 4 Feb 2024 12:15:34 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=TPKMz2Ub; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf02.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707048934; a=rsa-sha256; cv=none; b=YNGedxWy/lvakTK5RwojHaijHIituY+WoBbKcjejFEnWc1KoUyJeraOHdEd25jPoNtOLm+ NTEvJgg1TPF+zwHxbhzjy3vBAtv2ulVWobB9tsOsc1t5lHBE0//tSgZvrQ17mCBjllG6Of QfwNivNxq9QQxGN81pmD+YRo8KxCmF0= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=TPKMz2Ub; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf02.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707048934; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=TmTC+RG62ZoJIpW/Iy56L8NgYD1AzuQ17bRzDyB4eek=; b=pxharO2oOvBAtEFh8VAveml1f2KVaN62XIS/ooXnC5reqyClYXYvM5aQ703uJoyCKsdMVh mTx7k62W831eUBe2cJYWsF9Fkhlhogq2Tb4sKK7WJzOSsYdueU3l8JIHzAkXl8oWBTp+FG 1M88lidO1gQ8TVMIo8MT2D6otFn65j4= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8653660B76; Sun, 4 Feb 2024 12:15:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70FD5C433F1; Sun, 4 Feb 2024 12:15:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707048933; bh=4wQVnyZkqM9ZkKkYrxE4cjx2wJXAt5jGMzRqxojtYTg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TPKMz2Ubcsw3jIma98yrbStdwh3KVrJIe0DpVO2pr10RTT41XeeKHATPQy5TkPeL7 3nsQi9VE87S5ksghMe5LDHP8uqrDNlDaL8iVNHJnvk6qJFvjYhYTsu7oXQi2DSEISI TrVPWwtW/5VZNJK3UhXv9IVFl78OAP7d04j+D09v4zdskPXpAOtR2bhfrcLlB/5qCt clbOWmRgNmOTjfZAs7hJCvLYSBSVOq8ldozOcEGDD+hU57W/WZnC61z4B0hKP9xMxf /OXQQlx7cUPaK0nvR6Vwd8pl9bcKqg2gFhEVmi3L33a5KW6LiVXnxgGtD85d/oeEuA A7Jz5+A+0jhig== Date: Sun, 4 Feb 2024 13:15:24 +0100 From: Mike Rapoport To: Qi Zheng Cc: akpm@linux-foundation.org, arnd@arndb.de, muchun.song@linux.dev, david@redhat.com, willy@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH 1/2] mm: pgtable: add missing flag and statistics for kernel PTE page Message-ID: References: <3b7e9435-d78e-4430-98d1-f4a839899425@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3b7e9435-d78e-4430-98d1-f4a839899425@bytedance.com> X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 9BF818000E X-Stat-Signature: pzwdrqt6xt8fwzx64acwmxo9e66m3ypj X-HE-Tag: 1707048934-283607 X-HE-Meta: U2FsdGVkX1+UMG7ZCFCzwiripKYhNUs8G4JjfkvSWhSaS5nngahx0mtjw6T66dsEu+xt+63KSfYpACF6vPNS8KstDh3nfrt4vdPg9KMFZ+L3EvRCY/KGNWEQFNfvy/fHOHIJOoFQA53haV7o3ZKkAw1cLvTTDSs6hxqXwYu96hbch2O58VAba4Np7a1eBKSnWkfH20GkP1BbtvQ+2PNO7X1Zz/06ZQifzm9NuPutWSCv3ODShxCGWGu2xfk2x8ncJqGLNovsTKkQinI1jZvI81mm6FJwIFqKeCwtweB0/HtKpTnD/99LjBkUceqHWB3cdoU3NSSiubhuTcCW/wNWoNwZPSEcFMUvj+lc+hTxyM8W/nRk1EOKHSr6ncEFvvWbcG7zyT/1sduK0OEJIdDKlkKnryzk0jV+YRqPNbWXVW3R19rmNrz2+GKa359e3ImANc1tLeLrYMy+ttBvfXfszyVp07xesfZGDc0cF+PWBQIYcYqAdRABwS8WYem6FnPs/5DK079PE+P3/yw7bjZIxLPihLCjCJNDim/LZel47dzoKnGVN2VYu3U7lfYWsyyFAB+sw91NQdwLGnrf2DMC5B7qFnVNbKwrWNId62qxxkLJvhy2F/eK3Kpee1TMoguBkwKlZGdUI2DOrbzwkFi+lehXraRutbD+Vdq0WqFeK+o89mbxY2UtXPuL9MMuV7aHY4daqGVsoPGrEl+ptXTVVZa39dT21IQy8PFHuBrZULb9/SY5DLTRaQFUZTXltiulf8fnlRuw0qkmEW4nOsHbYhbjhwJbzCJr/RcJ992cxuEn6BPkwYegsDKud/3UfhbrFJ5H+0As+rDK5iIZX4YlmSfolWPS8xnoTzNw/GXUksvIdE3XmsNvW+DfN5lDKLJO+6PJ9VXjjRvv4OvwT5SHgSYzhLyKLZg+00MhctQfv63MGqaB+6K0WjQ/eV1qEBOnIJsmhqY7ebhSWX4X6S3 KaqRveya vIsOxHQVkXwBULMc3nuBbcslG1tXdfRnchU+oVMIYIvnndu49RkECG4knxBpD0IGFfDl+NNh9dcaMkDjoSJKMTAQLknZN9kAkMzwMr+CydNbeqH6iD0cNy6njC/UDIq8XZqkLYE9fGC0x0ED7HvaE8wYV7dDHhExOPTZRQxxnu4Yi7O1LnZ2fKwYXTrCFN1mzxG7xApUB4wh5idqtcptl+C9fAIne1CEFZ/6stdHwBrLtTPd4wbKz0cbBsA== 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: List-Subscribe: List-Unsubscribe: On Sun, Feb 04, 2024 at 07:39:38PM +0800, Qi Zheng wrote: > Hi Mike, > > On 2024/2/4 18:58, Mike Rapoport wrote: > > On Thu, Feb 01, 2024 at 04:05:40PM +0800, Qi Zheng wrote: > > > For kernel PTE page, we do not need to allocate and initialize its split > > > ptlock, but as a page table page, it's still necessary to add PG_table > > > flag and NR_PAGETABLE statistics for it. > > > > > > Signed-off-by: Qi Zheng > > > --- > > > include/asm-generic/pgalloc.h | 7 ++++++- > > > include/linux/mm.h | 21 ++++++++++++++++----- > > > 2 files changed, 22 insertions(+), 6 deletions(-) > > > > This should also update the architectures that define > > __HAVE_ARCH_PTE_ALLOC_ONE_KERNEL, otherwise NR_PAGETABLE counts will get > > wrong. > > Yes, this patchset only focuses on the generic implementation. For those > architectures that define __HAVE_ARCH_PTE_ALLOC_ONE_KERNEL, some reuse > the generic __pte_alloc_one_kernel(), but some have their own customized > implementations, which indeed need to be fixed. > > I wasn't familiar with those architectures and didn't investigate why > they couldn't reuse the generic __pte_alloc_one_kernel(), so I didn't > fix them. But with your patch NR_PAGETABLE will underflow e.g. on arm and it'd be a regression for no good reason. > It would be better if there are maintainers corresponding to > the architecture who can help fix it. After all, they have a better > understanding of the historical background and have a testing > environment. ;) -- Sincerely yours, Mike.