Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Daniil Tatianin <d-tatianin@yandex-team.ru>
Cc: linux-mm@kvack.org, Vlastimil Babka <vbabka@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	Brendan Jackman <brendan.jackman@linux.dev>,
	Johannes Weiner <hannes@cmpxchg.org>, Zi Yan <ziy@nvidia.com>,
	David Hildenbrand <david@kernel.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Mike Rapoport <rppt@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/vmstat: add per-order allocation slow path statistics
Date: Thu, 20 Aug 2026 15:49:13 -0700	[thread overview]
Message-ID: <20260820154913.3d6a821f6ba5c1f81d134a0a@linux-foundation.org> (raw)
In-Reply-To: <20260820133659.712111-1-d-tatianin@yandex-team.ru>

On Thu, 20 Aug 2026 16:36:58 +0300 Daniil Tatianin <d-tatianin@yandex-team.ru> wrote:

> Production incidents caused by bursts of high-order allocations all
> entering direct compaction are currently hard to attribute from
> /proc/vmstat: pgalloc_* has no order breakdown, and compact_stall does
> not say which order stalled. Tracepoints can recover this on a single
> machine, but they are impractical as an always-on fleet-wide monitoring
> source, which is what is needed to correlate latency regressions with
> allocation behavior after the fact.
> 
> Add per-order event counters to /proc/vmstat, covering only the
> allocation slow path, so the page allocator fast path is not touched
> at all:
> 
>  - pgalloc_slowpath_orderN: entries into __alloc_pages_slowpath(),
>    counted once per allocation, before the restart loop
>  - pgalloc_fail_orderN: allocations that returned NULL to the caller
>    (including a successful allocation freed by memcg charge failure)
>  - compact_stall_orderN / compact_success_orderN: per-order split of
>    the existing direct compaction counters, order 0 is omitted since
>    direct compaction is never entered for it
> 
> All new counters are purely additive: the existing keys are untouched
> and compact_stall == sum of compact_stall_orderN.
> 
> alloc_pages_nolock() is deliberately not counted: it is opportunistic,
> never enters the slow path, and its NULL returns are expected rather
> than failures.
> 
> Counter names are generated for any MAX_PAGE_ORDER the arch Kconfig
> ranges allow (10..13), a static_assert catches larger values.

AI review got upset about this:
	https://sashiko.dev/#/patchset/20260820133659.712111-1-d-tatianin@yandex-team.ru

> A per-order split of PGALLOC itself was proposed in 2017 but stalled
> over fast path overhead concerns, restricting the counters to the slow
> path avoids that overhead entirely while still capturing the
> allocations that cause latency.

Seems useful, thanks.

It would be easier for others to understand the proposal if the
changelog were to quote some sample /proc/vmstat output.

> Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>

Merging patches from Russian-affiliated individuals is problematic.  As
I understand it (not well) it's OK if the contributor's organization
isn't on the US's OFAC list, and it appears that Yandex is not on that
list.



  reply	other threads:[~2026-08-20 22:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20 13:36 [PATCH] mm/vmstat: add per-order allocation slow path statistics Daniil Tatianin
2026-08-20 22:49 ` Andrew Morton [this message]
2026-08-21  0:24   ` Daniil Tatianin
2026-08-21  7:50   ` Michal Hocko
2026-08-21  7:42 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260820154913.3d6a821f6ba5c1f81d134a0a@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=brendan.jackman@linux.dev \
    --cc=d-tatianin@yandex-team.ru \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox