[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d96d60b9-fa17-4981-a7e9-1b8bab1a7eed@zytor.com>
Date: Thu, 16 Jan 2025 21:54:35 -0800
From: Xin Li <xin@...or.com>
To: Ethan Zhao <haifeng.zhao@...ux.intel.com>,
"H. Peter Anvin"
<hpa@...or.com>, Ethan Zhao <etzhao@...look.com>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: tglx@...utronix.de, dave.hansen@...ux.intel.com, x86@...nel.org,
andrew.cooper3@...rix.com, mingo@...hat.com, bp@...en8.de
Subject: Re: [PATCH] x86/fred: Optimize the FRED entry by prioritizing
high-probability event dispatching
On 1/16/2025 9:18 PM, Ethan Zhao wrote:
>>
>> Just swap the 2 arguments, and it should be:
>> + switch_likely (etype, EVENT_TYPE_OTHER) {
>>
>>
> after swapped the parameters as following:
> +#define switch_likely(v,l) \
> + switch((__typeof__(v))__builtin_expect((v),(l)))
> +
> __visible noinstr void fred_entry_from_user(struct pt_regs *regs)
> {
> unsigned long error_code = regs->orig_ax;
> + unsigned short etype = regs->fred_ss.type & 0xf;
>
> /* Invalidate orig_ax so that syscall_get_nr() works correctly */
> regs->orig_ax = -1;
>
> - switch (regs->fred_ss.type) {
> + switch_likely (etype, (EVENT_TYPE_EXTINT == etype ||
> EVENT_TYPE_OTHER == etype)) {
This is not what I suggested, the (l) argument should be only one
constant; __builtin_expect() doesn't allow 2 different constants.
Powered by blists - more mailing lists