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) <[email protected]>

Reviewed-by: Rik van Riel <[email protected]>

-- 
All Rights Reversed.

Reply via email to