[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251109113533.GB2545891@noisy.programming.kicks-ass.net>
Date: Sun, 9 Nov 2025 12:35:33 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Xie Yuanbin <qq570070308@...il.com>
Cc: david@...hat.com, tglx@...utronix.de, segher@...nel.crashing.org,
riel@...riel.com, linux@...linux.org.uk,
mathieu.desnoyers@...icios.com, paulmck@...nel.org, pjw@...nel.org,
palmer@...belt.com, aou@...s.berkeley.edu, alex@...ti.fr,
hca@...ux.ibm.com, gor@...ux.ibm.com, agordeev@...ux.ibm.com,
borntraeger@...ux.ibm.com, svens@...ux.ibm.com, davem@...emloft.net,
andreas@...sler.com, luto@...nel.org, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, hpa@...or.com,
acme@...nel.org, namhyung@...nel.org, mark.rutland@....com,
alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
irogers@...gle.com, adrian.hunter@...el.com, james.clark@...aro.org,
anna-maria@...utronix.de, frederic@...nel.org,
juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, vschneid@...hat.com, nathan@...nel.org,
nick.desaulniers+lkml@...il.com, morbo@...gle.com,
justinstitt@...gle.com, thuth@...hat.com, brauner@...nel.org,
arnd@...db.de, jlayton@...nel.org, aalbersh@...hat.com,
akpm@...ux-foundation.org, david@...nel.org,
lorenzo.stoakes@...cle.com, max.kellermann@...os.com,
ryan.roberts@....com, nysal@...ux.ibm.com, urezki@...il.com,
x86@...nel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
linux-s390@...r.kernel.org, sparclinux@...r.kernel.org,
linux-perf-users@...r.kernel.org, llvm@...ts.linux.dev,
will@...nel.org
Subject: Re: [PATCH v2 4/4] Make finish_task_switch and its subfuncs inline
in context switching
On Sun, Nov 09, 2025 at 01:23:46AM +0800, Xie Yuanbin wrote:
> `finish_task_switch` is a hot path in context switching, and due to
> possible mitigations inside switch_mm, performance here is greatly
> affected by function calls and branch jumps. Make it inline to optimize
> the performance.
>
> After `finish_task_switch` is changed to an inline function, the number of
> calls to the subfunctions (called by `finish_task_switch`) increases in
> this translation unit due to the inline expansion of `finish_task_switch`.
> Due to compiler optimization strategies, these functions may transition
> from inline functions to non inline functions, which can actually lead to
> performance degradation.
>
> Make the subfunctions of finish_task_stwitch inline to prevent
> degradation.
Yeah, try again without that _ainline garbage.
Powered by blists - more mailing lists