[PATCH RFC v2 06/54] x86/mm/pat: don't count kernel image splits as direct map splits
Rik van Riel
riel at surriel.com
Thu Dec 3 07:42:32 PST 2026
On Thu, 2026-11-26 at 13:14 +0200, Mike Rapoport (Microsoft) wrote:
> The DirectMap lines of /proc/meminfo count only the direct map. The
> kernel
> image mapping is never added to them.
>
> CPA counts a split if virt_addr_valid() accepts the address and its
> pfn is
> mapped in the direct map. On 64-bit virt_addr_valid() accepts the
> kernel
> image mapping too, and its pfns are in the direct map, so the splits
> of the
> kernel image mapping are counted as well.
>
> Such splits can happen when mark_rodata_ro() updates the protections
> of the
> kernel image.
>
> Each split of the kernel image mapping moves 2M from DirectMap2M to
> DirectMap4k, although the direct map does not change.
>
> Count splits and collapses only for addresses in the direct map.
>
> Fixes: 8eb5779f6b9c ("x86, mm: use pfn_range_is_mapped() with CPA")
> Signed-off-by: Mike Rapoport (Microsoft) <rppt at kernel.org>
Reviewed-by: Rik van Riel <riel at surriel.com>
--
All Rights Reversed.
More information about the linux-arm-kernel
mailing list