[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251128130823.GA222920@cmpxchg.org>
Date: Fri, 28 Nov 2025 08:08:23 -0500
From: Johannes Weiner <hannes@...xchg.org>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Hongru Zhang <zhanghongru06@...il.com>, akpm@...ux-foundation.org,
david@...nel.org, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
surenb@...gle.com, mhocko@...e.com, jackmanb@...gle.com,
ziy@...dia.com, lorenzo.stoakes@...cle.com, Liam.Howlett@...cle.com,
rppt@...nel.org, axelrasmussen@...gle.com, yuanchu@...gle.com,
weixugc@...gle.com, Hongru Zhang <zhanghongru@...omi.com>
Subject: Re: [PATCH 0/3] mm: add per-migratetype counts to buddy allocator
and optimize pagetypeinfo access
On Fri, Nov 28, 2025 at 10:24:16AM +0100, Vlastimil Babka wrote:
> On 11/28/25 04:10, Hongru Zhang wrote:
> > On mobile devices, some user-space memory management components check
> > memory pressure and fragmentation status periodically or via PSI, and
> > take actions such as killing processes or performing memory compaction
> > based on this information.
>
> Hm /proc/buddyinfo could be enough to determine fragmentation? Also we have
> in-kernel proactive compaction these days.
>
> > Under high load scenarios, reading /proc/pagetypeinfo causes memory
> > management components or memory allocation/free paths to be blocked
> > for extended periods waiting for the zone lock, leading to the following
> > issues:
> > 1. Long interrupt-disabled spinlocks - occasionally exceeding 10ms on Qcom
> > 8750 platforms, reducing system real-time performance
> > 2. Memory management components being blocked for extended periods,
> > preventing rapid acquisition of memory fragmentation information for
> > critical memory management decisions and actions
> > 3. Increased latency in memory allocation and free paths due to prolonged
> > zone lock contention
>
> It could be argued that not capturing /proc/pagetypeinfo (often) would help.
> I wonder if we can find also other benefits from the counters in the kernel
> itself.
In earlier iterations of the huge allocator patches, I played around
with using these for compaction_suitable():
https://lore.kernel.org/linux-mm/20230418191313.268131-17-hannes@cmpxchg.org/
ISTR it cut down compaction numbers, because it would avoid runs where
free pages are mostly in unsuitable targets (free_unmovable). But this
was also in a series that used compaction_suitable() to stop kswapd,
which in hindsight was a mistake; it would need re-evaluating by itself.
I also found these counters useful to have in OOM/allocfail dumps to
see if allocator packing or compaction could have done better.
Powered by blists - more mailing lists