From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 5CE7A1A680A for ; Tue, 2 Jun 2026 14:51:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780411920; cv=none; b=f++ywhTXl3O74+estm5Xto++nPHF4YTR2qohBYNPUC0dhJLXR5NGLVDe/H5Gn7Y9/kuzcnoRzZKh4joVNTPz/LpX8Zr4SGZ9qXHaw/zI8qHVTZzEIiZUSoe6HBxvuzlbd0MrjQXCKTZey1PZxePX7GZwKykFKgB+6Pv4oRsMRBU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780411920; c=relaxed/simple; bh=8CxilmNFATi7YFOhV2/A/fxOzfpE+5kzoFlgjGQogyo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BKFm5NnSicMIMa9YRRwfOpDOrGlBrH0ZZW3D5j8VqCoEEyfnF6Jz3957VqFMlbG2wpCI05Kwr3iGmijj2cEl1701h0SxMly14NA84IpmFTneqabL8vi+mB6Rnl2XBbrwc8AG11zGcbOVL1F+NYCXgeGs/7+P/m9i+urj0Cq2xSk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FA9PPqvB; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FA9PPqvB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C18E51F00898; Tue, 2 Jun 2026 14:51:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780411919; bh=xGKT2H9oAVokplmogttxa64EvESiPBnR+MF25iKS56I=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=FA9PPqvBdIGb4pG0zB9lk0F6AvuqOvkWRIIve5mL+5kjKZBXObpADjkhMqWdT1QxL j3rIK24SVpkXDle8LLaI/cRAy58+ZJzsHgONBjV+tHmm0p9XGCvP1phnmqiwSQwEE6 MAiNyOjgHI3B/ziUMS9EaNA8v5H66OUx63Y+7JZecaY6/2R2hob3imz8wxuCTbxWxD kTLaa2TlZD8j3BtK8Wvc4i0zRsloMYGnPzDQ2y1KkJ+EjqQYfkBOKA4uSTvG2pAze3 v60BhJ0M4oXf4TmGKxhxG1LdRxsiJBewP6Sp/AMcerTBZe4tKpXR1FNk3OuxX+FB1b csmkyREEaeC4w== Date: Tue, 2 Jun 2026 15:51:54 +0100 From: Will Deacon To: Yang Shi Cc: catalin.marinas@arm.com, ryan.roberts@arm.com, cl@gentwo.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [v7 PATCH] arm64: mm: show direct mapping use in /proc/meminfo Message-ID: References: <20260519163657.1259416-1-yang@os.amperecomputing.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: <20260519163657.1259416-1-yang@os.amperecomputing.com> On Tue, May 19, 2026 at 09:36:57AM -0700, Yang Shi wrote: > Since commit a166563e7ec3 ("arm64: mm: support large block mapping when > rodata=full"), the direct mapping may be split on some machines instead > keeping static since boot. It makes more sense to show the direct mapping > use in /proc/meminfo than before. > This patch will make /proc/meminfo show the direct mapping use like the > below (4K base page size): > DirectMap4K: 94792 kB > DirectMap64K: 134208 kB > DirectMap2M: 1173504 kB > DirectMap32M: 5636096 kB > DirectMap1G: 529530880 kB > > Although just the machines which support BBML2_NOABORT can split the > direct mapping, show it on all machines regardless of BBML2_NOABORT so > that the users have consistent view in order to avoid confusion. > > Although ptdump also can tell the direct map use, but it needs to dump > the whole kernel page table. It is costly and overkilling. It is also > in debugfs which may not be enabled by all distros. So showing direct > map use in /proc/meminfo seems more convenient and has less overhead. > > Signed-off-by: Yang Shi > --- > arch/arm64/mm/mmu.c | 192 +++++++++++++++++++++++++++++++++++++++----- > 1 file changed, 171 insertions(+), 21 deletions(-) > > v7: * Rebased to v7.1-rc4 > * Changed "dm" to "lm" to follow ARM convention per Will > * Used __is_lm_alias() instead of reinventing a new helper per Will Thanks, but Sashiko has pointed out a few nasty issues: https://sashiko.dev/#/patchset/20260519163657.1259416-1-yang@os.amperecomputing.com In particular, the potential for races updating the shared counters and double-accounting of entries due to permission changes look like interesting things to check. Will