Rafael Aquini 862db7b222 mm: fix accounting of memmap pages
JIRA: https://redhat.atlassian.net/browse/RHEL-145695

commit c3576889d87b603cb66b417e08844a53c1077a37
Author: Sumanth Korikkar <sumanthk@linux.ibm.com>
Date:   Thu Aug 7 20:35:45 2025 +0200

    mm: fix accounting of memmap pages

    For !CONFIG_SPARSEMEM_VMEMMAP, memmap page accounting is currently done
    upfront in sparse_buffer_init().  However, sparse_buffer_alloc() may
    return NULL in failure scenario.

    Also, memmap pages may be allocated either from the memblock allocator
    during early boot or from the buddy allocator.  When removed via
    arch_remove_memory(), accounting of memmap pages must reflect the original
    allocation source.

    To ensure correctness:
    * Account memmap pages after successful allocation in sparse_init_nid()
      and section_activate().
    * Account memmap pages in section_deactivate() based on allocation
      source.

    Link: https://lkml.kernel.org/r/20250807183545.1424509-1-sumanthk@linux.ibm.com
    Fixes: 15995a3524 ("mm: report per-page metadata information")
    Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
    Suggested-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
    Cc: Alexander Gordeev <agordeev@linux.ibm.com>
    Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
    Cc: Heiko Carstens <hca@linux.ibm.com>
    Cc: Vasily Gorbik <gor@linux.ibm.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Signed-off-by: Rafael Aquini <raquini@redhat.com>
2026-07-31 14:51:02 -04:00
2026-07-31 14:50:55 -04:00
2026-07-01 16:15:37 -04:00
2026-07-31 14:51:02 -04:00
2026-01-19 14:33:01 -05:00
2026-07-01 16:16:28 -04:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
S
Description
No description provided
Readme
2.8 GiB
Languages
C 97.5%
Assembly 1%
Shell 0.6%
Python 0.3%
Makefile 0.3%