From: Vlastimil Babka <vbabka@suse.cz>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
Li Qiang <liqiang01@kylinos.cn>
Cc: akpm@linux-foundation.org, david@redhat.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Liam.Howlett@oracle.com,
rppt@kernel.org, surenb@google.com, mhocko@suse.com
Subject: Re: [PATCH] mm: memory: Force-inline PTE/PMD zapping functions for performance
Date: Mon, 4 Aug 2025 16:41:42 +0200 [thread overview]
Message-ID: <805fb8a3-6f95-4f20-b5da-87dc3b1e3b60@suse.cz> (raw)
In-Reply-To: <2a1b7ebc-f27c-444e-be89-df14ac1dc97d@lucifer.local>
On 8/4/25 15:59, Lorenzo Stoakes wrote:
> OK,
>
> So I hacked -fopt-info-inline-all into the mm/ Makefile in a rather quick and
> dirty way and it seems some stuff gets inlined locally, but we're mostly hitting
> the '--param max-inline-insns-single limit reached' limit here.
>
> Which maybe is just a point where the compiler possibly arbitrarily gives up?
>
> Vlasta rightly pointed out off-list that given this appears to only be used in
> one place you'd expect inlining as register spill isn't such a concern (we'll
> spill saving the stack before function invocation anyway).
>
> So there might actually be some validity here?
>
> This is gcc 15.1.1 running on an x86-64 platform by the way.
>
> mm/memory.c:1871:10: optimized: Inlined zap_p4d_range/6380 into unmap_page_range/6381 which now has time 1458.996712 and size 65, net change of -11.
> mm/memory.c:1850:10: optimized: Inlined zap_pud_range.isra/8017 into zap_p4d_range/6380 which now has time 10725.428482 and size 29, net change of -12.
> mm/memory.c:1829:10: missed: not inlinable: zap_pud_range.isra/8017 -> zap_pmd_range.isra/8018, --param max-inline-insns-single limit reached
> mm/memory.c:1800:10: missed: not inlinable: zap_pmd_range.isra/8018 -> zap_pte_range/6377, --param max-inline-insns-auto limit reached
> mm/memory.c:1708:8: optimized: Inlined do_zap_pte_range.constprop/7983 into zap_pte_range/6377 which now has time 4244.320854 and size 148, net change of -15.
> mm/memory.c:1664:9: missed: not inlinable: do_zap_pte_range.constprop/7983 -> zap_present_ptes.constprop/7985, --param max-inline-insns-single limit reached
I got some weird bloat-o-meter on this patch:
add/remove: 1/0 grow/shrink: 2/2 up/down: 693/-31 (662)
Function old new delta
__handle_mm_fault 3817 4403 +586
do_swap_page 4497 4560 +63
mksaveddirty_shift - 44 +44
unmap_page_range 4843 4828 -15
copy_page_range 6497 6481 -16
but even without this patch, "objdump -t mm/memory.o" shows no zap
functions, so they are already inlined?
gcc also 15.1.1 but maybe opensuse has some non-default tunings.
next prev parent reply other threads:[~2025-08-04 14:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-04 12:39 Li Qiang
2025-08-04 12:51 ` David Hildenbrand
2025-08-04 13:01 ` Nadav Amit
2025-08-04 13:30 ` David Hildenbrand
2025-08-05 12:04 ` Li Qiang
2025-08-05 13:15 ` Vlastimil Babka
2025-08-06 5:40 ` [PATCH] mm: memory: Force-inline PTE/PMD zapping functions Li Qiang
2025-08-05 13:35 ` [PATCH] mm: memory: Force-inline PTE/PMD zapping functions for performance Lorenzo Stoakes
2025-08-06 5:51 ` Li Qiang
2025-08-07 10:25 ` Vlastimil Babka
2025-08-04 13:15 ` Vlastimil Babka
2025-08-04 13:29 ` Lorenzo Stoakes
2025-08-04 13:59 ` Lorenzo Stoakes
2025-08-04 14:41 ` Vlastimil Babka [this message]
2025-08-04 14:50 ` Nadav Amit
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=805fb8a3-6f95-4f20-b5da-87dc3b1e3b60@suse.cz \
--to=vbabka@suse.cz \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liqiang01@kylinos.cn \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=surenb@google.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