Skip to content

Commit 9bad741

Browse files
edumazetThomas Gleixner
authored andcommitted
x86/apic: Inline __x2apic_send_IPI_dest()
Avoid one call/ret in networking RPS/RFS fast path, with no space cost. scripts/bloat-o-meter -t vmlinux.before vmlinux.after add/remove: 0/2 grow/shrink: 2/0 up/down: 96/-97 (-1) Function old new delta x2apic_send_IPI 146 198 +52 __x2apic_send_IPI_mask 326 370 +44 __pfx___x2apic_send_IPI_dest 16 - -16 __x2apic_send_IPI_dest 81 - -81 Total: Before=20861234, After=20861233, chg -0.00% Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20251223052026.4141498-1-edumazet@google.com
1 parent 63804fe commit 9bad741

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

arch/x86/kernel/apic/local.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <asm/apic.h>
1515

1616
/* X2APIC */
17-
void __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest);
1817
u32 x2apic_get_apic_id(u32 id);
1918

2019
void x2apic_send_IPI_all(int vector);
@@ -42,6 +41,15 @@ static inline unsigned int __prepare_ICR(unsigned int shortcut, int vector,
4241
return icr;
4342
}
4443

44+
#ifdef CONFIG_X86_X2APIC
45+
static inline void __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest)
46+
{
47+
unsigned long cfg = __prepare_ICR(0, vector, dest);
48+
49+
native_x2apic_icr_write(cfg, apicid);
50+
}
51+
#endif
52+
4553
void default_init_apic_ldr(void);
4654

4755
void apic_mem_wait_icr_idle(void);

arch/x86/kernel/apic/x2apic_phys.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,6 @@ void x2apic_send_IPI_self(int vector)
107107
apic_write(APIC_SELF_IPI, vector);
108108
}
109109

110-
void __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest)
111-
{
112-
unsigned long cfg = __prepare_ICR(0, vector, dest);
113-
native_x2apic_icr_write(cfg, apicid);
114-
}
115-
116110
static int x2apic_phys_probe(void)
117111
{
118112
if (!x2apic_mode)

0 commit comments

Comments
 (0)