[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <74580442-2a9a-4055-b92d-23f5e5664878@redhat.com>
Date: Mon, 4 Aug 2025 15:30:45 +0200
From: David Hildenbrand <david@...hat.com>
To: Nadav Amit <nadav.amit@...il.com>
Cc: Li Qiang <liqiang01@...inos.cn>, Andrew Morton
<akpm@...ux-foundation.org>, "open list:MEMORY MANAGEMENT"
<linux-mm@...ck.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
lorenzo.stoakes@...cle.com, "Liam R . Howlett" <Liam.Howlett@...cle.com>,
Vlastimil Babka <vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>,
Suren Baghdasarya <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH] mm: memory: Force-inline PTE/PMD zapping functions for
performance
On 04.08.25 15:01, Nadav Amit wrote:
>
>
>> On 4 Aug 2025, at 15:51, David Hildenbrand <david@...hat.com> wrote:
>>
>> On 04.08.25 14:39, Li Qiang wrote:
>>> This change converts several critical page table zapping functions from
>>> `inline` to `__always_inline`, resulting in measurable performance
>>> improvements in process spawning workloads.
>>> Performance Impact (Intel Xeon Gold 6430 2.1GHz):
>>> - UnixBench 'context1' test shows ~6% improvement (single-core)
>>> - UnixBench shows ~0.6% improvement (single-core)
>>> - mm/memory.o size reduced by 2.49% (70190 -> 68445 bytes)
>>> - Net code reduction of 1745 bytes (add/remove: 211/166)
>>> The modified functions form a hot path during process teardown:
>>> 1. zap_present_ptes()
>>> 2. do_zap_pte_range()
>>> 3. zap_pte_range()
>>> 4. zap_pmd_range()
>>> Signed-off-by: Li Qiang <liqiang01@...inos.cn>
>>> ---
>>
>> What's the object file size change?
>
> I think that Li wrote that the size is reduced by 2.49% .
Ah, missed it after the performance numbers. As Vlastimil mentioned, I
would have expected a bloat-o-meter output.
>
> My 2 cents is that usually it may be better to understand why it is
> not inlined and address that (e.g., likely() hints or something else)
> instead of blindly putting __always_inline. The __always_inline might
> stay there for no reason after some code changes and therefore become
> a maintenance burden. Concretely, in this case, where there is a single
> caller, one can expect the compiler to really prefer to inline the
> callees.
Agreed, although the compiler is sometimes hard to convince to do the
right thing when dealing with rather large+complicated code in my
experience.
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists