On Tue, Jul 16, 2024 at 6:00 AM Kirill A. Shutemov kirill.shutemov@linux.intel.com wrote:
Unaccepted memory is considered unusable free memory, which is not counted as free on the zone watermark check. This causes get_page_from_freelist() to accept more memory to hit the high watermark, but it creates problems in the reclaim path.
The reclaim path encounters a failed zone watermark check and attempts to reclaim memory. This is usually successful, but if there is little or no reclaimable memory, it can result in endless reclaim with little to no progress. This can occur early in the boot process, just after start of the init process when the only reclaimable memory is the page cache of the init executable and its libraries.
To address this issue, teach shrink_node() and shrink_zones() to accept memory before attempting to reclaim.
Signed-off-by: Kirill A. Shutemov kirill.shutemov@linux.intel.com Reported-by: Jianxiong Gao jxgao@google.com Fixes: dcdfdd40fa82 ("mm: Add support for unaccepted memory") Cc: stable@vger.kernel.org # v6.5+
Tested-by: Jianxiong Gao jxgao@google.com I have verified that the patch fixes the systemd issue reported.