Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1849965rdb; Sun, 4 Feb 2024 04:16:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFr5d6NbGo42nJysbhv7DzaKr6oZKD3wdezwzX3vCzn4JNeoL4qhlWGvgUYGvHrzzU2Nu9s X-Received: by 2002:a17:902:b190:b0:1d8:da2c:1014 with SMTP id s16-20020a170902b19000b001d8da2c1014mr7448633plr.9.1707049004158; Sun, 04 Feb 2024 04:16:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707049004; cv=pass; d=google.com; s=arc-20160816; b=mO+9MUunfI21qQzdKFKIXdHI3HLqG9SyzcwdEyvPSirr2c0cpy/X5fPRJlTvaT9uOy IqnoaVU2z1S9IQnJG2ltM3uXARx9wQwcP75waC8QHnaOl+5HyA0DPFJSXUDA7VnSNSU9 v4gAaonyaqm755icJeeQc4G4H5UKrYO//PutYRzpFyjiire+rfqvNUpcVTOkh1mSdeyO iHSG7hVuhnpefSqPQakLYhoBDm7Xdsb9bGa4Tf+0arzpLnpmPznx/kDuOtomRDUTiMba cFUaQ2+QlVeLPJ1CIYw3QfTpM2J63akdEpPrqmiqlO9EpmMyI2wI0ehSi/VwLmK/pdUI q9rQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TmTC+RG62ZoJIpW/Iy56L8NgYD1AzuQ17bRzDyB4eek=; fh=RkNe0TaesVXOkwEThwtwn56fnXB9R+tfT/VbngiePmQ=; b=bQf0Q0vHOgZefeoS6yVqCE7pJ+C0IMckkd/YYyGJ7jFkMhQdTiGuEOqt1YDo6rz39c fOgyr8F6njhBhsfSy2yURLr+g2S5bKO57ZZc80FdlK/lyikHtHVCw5EszyNV/xoJjWWx luLPNTr80J6UzCaKD1ESREUUDsKW3/lF1cvXhkzNEmY47fFr7F2nv0l8GHSSeNUxxSmq aKRhX9/4/YiiyWKj/TIpd4NYDbPZgCWmIbeA4OTnEuCk/f4djBAn6IMotlqe1sApQoux mHADbzFpQ3knIY2psUCWwPk/5HeZ8I/w1UmNA3a3pU3vYC3R6imJEOXo10/Zcz4g8Ez+ El+A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TPKMz2Ub; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-51631-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51631-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWbnYnCxe6cdb5qW9nn+/UiFJUx/tGrJULkcjHP+xsfA0bvp7FrTDK6/4gcSS29NIJschg4qvvH5ldHVP1FTLR2M8QrDBnNS0k9Ui4x8w== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q11-20020a170902c74b00b001d9624c714esi4525342plq.512.2024.02.04.04.16.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 04:16:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51631-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TPKMz2Ub; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-51631-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51631-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CC60E282FDE for ; Sun, 4 Feb 2024 12:16:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B33382261F; Sun, 4 Feb 2024 12:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TPKMz2Ub" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBE472260C; Sun, 4 Feb 2024 12:15:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707048933; cv=none; b=uJYh3aBXTjaogIMJHWnzbYSaH0YvrC4BREI499fn2uQKiLRyl5aJfRhMiLrInh1TvnPyc624dfCVNrMtUCCsTZCuylQ1BV/WcMl/hePfcjCmXYm5rNA3MYHKqiBKVp29lrDxM8Dx5WCdD4AyBrLKiuyGgraHve/PQin87iSpbmM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707048933; c=relaxed/simple; bh=4wQVnyZkqM9ZkKkYrxE4cjx2wJXAt5jGMzRqxojtYTg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sA2/cDg/7XjhkZFmFcOQvjZyFwgH1IK7BSGtuemo1Stm8wMSYb6Ilv5UBdALW6ej9zVwcuRQIbijTRrb1hAWAnkMocOI2l/zigLk1El8oLVAkuk2Bs9O9369+LVB6dbFTIMKp/2whyYbfZk1RSLBLjIstFV6P1Ckx5kyRxqlBrw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TPKMz2Ub; arc=none smtp.client-ip=10.30.226.201 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3b7e9435-d78e-4430-98d1-f4a839899425@bytedance.com> 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.