[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZyCfZHU3B4PBNR0A@localhost.localdomain>
Date: Tue, 29 Oct 2024 09:40:04 +0100
From: Oscar Salvador <osalvador@...e.de>
To: Gregory Price <gourry@...rry.net>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org, kernel-team@...a.com,
akpm@...ux-foundation.org, ying.huang@...el.com, weixugc@...gle.com,
dave.hansen@...ux.intel.com, shy828301@...il.com,
stable@...r.kernel.org
Subject: Re: [PATCH] vmscan,migrate: fix double-decrement on node stats when
demoting pages
On Fri, Oct 25, 2024 at 10:17:24AM -0400, Gregory Price wrote:
> When numa balancing is enabled with demotion, vmscan will call
> migrate_pages when shrinking LRUs. Successful demotions will
> cause node vmstat numbers to double-decrement, leading to an
> imbalanced page count. The result is dmesg output like such:
>
> $ cat /proc/sys/vm/stat_refresh
>
> [77383.088417] vmstat_refresh: nr_isolated_anon -103212
> [77383.088417] vmstat_refresh: nr_isolated_file -899642
>
> This negative value may impact compaction and reclaim throttling.
>
> The double-decrement occurs in the migrate_pages path:
>
> caller to shrink_folio_list decrements the count
> shrink_folio_list
> demote_folio_list
> migrate_pages
> migrate_pages_batch
> migrate_folio_move
> migrate_folio_done
> mod_node_page_state(-ve) <- second decrement
>
> This path happens for SUCCESSFUL migrations, not failures. Typically
> callers to migrate_pages are required to handle putback/accounting for
> failures, but this is already handled in the shrink code.
>
> When accounting for migrations, instead do not decrement the count
> when the migration reason is MR_DEMOTION. As of v6.11, this demotion
> logic is the only source of MR_DEMOTION.
>
> Signed-off-by: Gregory Price <gourry@...rry.net>
> Fixes: 26aa2d199d6f2 ("mm/migrate: demote pages during reclaim")
> Cc: stable@...r.kernel.org
Reviewed-by: Oscar Salvador <osalvador@...e.de>
--
Oscar Salvador
SUSE Labs
Powered by blists - more mailing lists