Skip to content
Commit 49cf2ba3 authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by Andrew Morton
Browse files

mm: fix endless reclaim on machines with unaccepted memory.

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.

Link: https://lkml.kernel.org/r/20240716130013.1997325-1-kirill.shutemov@linux.intel.com


Fixes: dcdfdd40 ("mm: Add support for unaccepted memory")
Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reported-by: default avatarJianxiong Gao <jxgao@google.com>
Tested-by: default avatarJianxiong Gao <jxgao@google.com>
Cc: Borislav Petkov (AMD) <bp@alien8.de>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: <stable@vger.kernel.org>	[6.5+]
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 3ac6f285
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment