All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Yeoreum Yun <yeoreum.yun@arm.com>,
	kernel test robot <oliver.sang@intel.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>,
	oe-lkp@lists.linux.dev, lkp@intel.com,
	Andrew Morton <akpm@linux-foundation.org>,
	Muhammad Usama Anjum <usama.anjum@arm.com>,
	Vlastimil Babka <vbabka@kernel.org>, Zi Yan <ziy@nvidia.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Brendan Jackman <jackmanb@google.com>,
	David Sterba <dsterba@suse.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Liam Howlett <liam@infradead.org>,
	Lorenzo Stoakes <ljs@kernel.org>, Michal Hocko <mhocko@suse.com>,
	Mike Rapoport <rppt@kernel.org>, Nick Terrell <terrelln@fb.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Vishal Moola <vishal.moola@gmail.com>,
	linux-mm@kvack.org
Subject: Re: [linux-next:master] [vmalloc] 60ced5818f: stress-ng.shm.ops_per_sec 7.2% regression
Date: Mon, 15 Jun 2026 17:32:19 +0200	[thread overview]
Message-ID: <87b8a714-e2bd-449d-9560-c181e927497a@kernel.org> (raw)
In-Reply-To: <ai/LNIg42JYckH2B@e129823.arm.com>


>>> -- 
>>> 0-DAY CI Kernel Test Service
>>> https://github.com/intel/lkp-tests/wiki
>>
>> Thanks. I'll check it.

Thanks for digging into the details!

> 
> Looking at the patch [1], the regression reported by lkp [2] appears to
> be caused by a lack of order-0 pages in the PCP lists,
> which increases zone-locked allocations (mm_page_alloc_zone_locked).
> 
> On my reproduced setup (an x86_64 workstation), most pages freed through
> free_pages_bulk() were order-2 pages (nr_pages == 4), including
> vmalloc-backed stacks. With patch [1], these order-2 pages are returned to
> the order-2 PCP lists, unlike commit 4aa4abf1f1 (“mm/page_alloc: optimize free_contig_range()”),
> which effectively populated the order-0 PCP lists.
> 
> Since the shmem workload appears to fault memory at PAGE_SIZE granularity,
> the reduced availability of order-0 pages in PCP lists seems to increase
> zone-locked order-0 allocations, which may explain the regression observed by lkp.
> 
> Performance comparison (5 runs):
>   - perf stat -e 'kmem:mm_page_alloc_extfrag' --filter 'alloc_order == 0' \
>               -e 'kmem:mm_page_alloc_zone_locked' --filter 'order == 0' \
>               -e 'kmem:mm_page_alloc' --filter 'order == 0' -- ./repro-script
> 
> Metric                               4aa4abf1f1           60ced5818f        Difference
> 
> ------------------------------------------------------------------------------------------
> 
> Zone-locked Allocation Ratio (%)     46.39 ± 0.17%       48.31 ± 0.37%       +1.92 pp
> 
>   - Ratio = (mm_page_alloc_extfrag + mm_page_alloc_zone_locked) / mm_page_alloc × 100
>   - Values are reported as median ± relative half-range across three runs.
> 
> The shmem test appears to handle page faults at PAGE_SIZE granularity, which seems to amplify the impact of the reduced availability of order-0 pages.

Okay, so less fragmentation in the PCP results in fallback to the buddy for
order-0. Given that we don't split in the PCP and fallback to the buddy, that
makes sense.

> 
> 
> As an experiment, I modified free_pages_bulk() to free pages individually
> as order-0 pages when nr_contig <= (1 << PAGE_ALLOC_COSTLY_ORDER).
> This restores behavior closer to 4aa4abf1f1 and results in almost
> no difference compared to that commit.
> 
> Performance comparison (5 runs)
>   - ./repro-script
> 
> Metric                     4aa4abf1f1            change             Difference
> ----------------------------------------------------------------------------------
> bogo_ops                   656,513 ± 0.34%      656,488 ± 0.23%          -25
> 
> bogo_ops/s (realtime)      10,935.95 ± 0.34%    10,935.86 ± 0.23%      -0.09
> 
> bogo_ops/s (usr+sys time)     220.31 ± 0.40%       219.30 ± 0.21%      -1.01
> 
> The differences are negligible and essentially restore the performance
> observed with 4aa4abf1f1.

Makes sense.

Looking at the original results, I spotted

    354997 ± 14%    +111.6%     751255 ±  4%  meminfo.PageTables

So we consumed twice the (process) page tables. Did you also manage to reproduce
that or do you have an explanation for that?

> 
> Given that the regression appears to be driven by a synthetic workload that
> combines frequent shmem page faults with repeated stack allocation/free operations,
> I do not think this is a significant concern for typical real-world workloads.

Yeah, if it's "we have less fragmentation", I agree. Using order-2 folios for
shmem would likely similarly mitigate the problem I assume.

-- 
Cheers,

David

  reply	other threads:[~2026-06-15 15:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02 13:18 [linux-next:master] [vmalloc] 60ced5818f: stress-ng.shm.ops_per_sec 7.2% regression kernel test robot
2026-06-09  7:35 ` Yeoreum Yun
2026-06-15  9:51   ` Yeoreum Yun
2026-06-15 15:32     ` David Hildenbrand (Arm) [this message]
2026-06-15 16:45       ` Yeoreum Yun

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=87b8a714-e2bd-449d-9560-c181e927497a@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=dsterba@suse.com \
    --cc=hannes@cmpxchg.org \
    --cc=jackmanb@google.com \
    --cc=liam@infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=lkp@intel.com \
    --cc=mhocko@suse.com \
    --cc=oe-lkp@lists.linux.dev \
    --cc=oliver.sang@intel.com \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=surenb@google.com \
    --cc=terrelln@fb.com \
    --cc=urezki@gmail.com \
    --cc=usama.anjum@arm.com \
    --cc=vbabka@kernel.org \
    --cc=vishal.moola@gmail.com \
    --cc=yeoreum.yun@arm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.