From nobody Mon Feb 9 05:40:05 2026 Received: from mail-qk1-f202.google.com (mail-qk1-f202.google.com [209.85.222.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E45133E36B for ; Mon, 22 Dec 2025 20:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766434453; cv=none; b=gXCjcOUze41/7D5ws19ZyojrqWbfWH/3sAlokplcgMMSPToVkiIKSep1KQsZ0Os/wsKNfdoSm1zH+cdJg/Lr+5KK6fS7gUrvxiETErIGeC4V1sBJNj+GKrBtmVIr0/zt8m4+imJW4vcsOGy8e4nf4FUiOM3TVAGVrd51gXgG17A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766434453; c=relaxed/simple; bh=1wWFtK1j5aLC/dB+3nuUFA7j6RKxCmUAp/cdUTU8g00=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=DtExamwlYoICFImx+NEz4ggS3fV+py3UjxJbDCorwTmfGaOr/11ECfWWciNEH4A2d/qzjNd2YDj/zm+Nyojj9JJtsYjV3rbMqPfjUOKpCQv6y75Qh6+2nPBFbxQYQWvlZpe6fGhdDOMN4nLeXYgxo4j2+Mzt+lQT8f0gFmZhs4U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=SXGzRd3C; arc=none smtp.client-ip=209.85.222.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="SXGzRd3C" Received: by mail-qk1-f202.google.com with SMTP id af79cd13be357-8b4f267ba01so1382106785a.1 for ; Mon, 22 Dec 2025 12:14:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1766434451; x=1767039251; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=NNLZsYtyn59Fe1j676r7hqi4cnMKzJGrgkFXHjC+jqQ=; b=SXGzRd3CRtPmtDEvWQlrQDlyeCg+5UUCRvcAjw8UHyz0Z5DBpTlZZyr+UCfRtgyB/S ZFycEd6bXZeUyD+iaLK+ANb+tr0z4bmfzEy0B+X5B8v15uMn3hFykuDQcabXcLob0Jkd 5YlLck4uLVmwx6Nbl73jK49sDN3VDoNsft69Dc7aPjV0s/RMDLExrzUcVB9xG5aczigd U2x/8Ra0dcjO/mChRubQV1cMGBPYJz9YBzhyVSaS6pBBXQjvZMrcIEz3GYl4LevyA9YK uQsQgCUUAbvxhSOYzMlU9vhwmk5jcqu0wrWfwCQ2m3okWrjNtX5Ec2KJG4Y+9rju2/1Z LhbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766434451; x=1767039251; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NNLZsYtyn59Fe1j676r7hqi4cnMKzJGrgkFXHjC+jqQ=; b=OKfztzOtfoeHQ5DvdNCU78gvlTyIGhAFKjNGGy7YRgZaM7SAM3mLWo6zymUvUaZ6WK srLsgpzhk8agd6vOR2z11dpU5FypOrNEEC8YICR71lzB+kHgU3yBuNE7/IlxmvT6Hwhw ij7dFJ/Di6lFhEB0EoS8xh8lhcuhyXYL2zE3PO4WFzy3626ivG2Mgbf7qZgW3inO448O xe4vxRZcy9WVsyfH7vCZibF64YEzMh82flm3a9fcBpIVVA0YNp3/tkFgfCbxrBjq1n/o B2PrGMK5AOIB0EovXuAjd8KcDkzv4dj3OjzFmu6DfEtYL/m/qtrrGV5H0DaU3/lHamI+ 5V3g== X-Gm-Message-State: AOJu0YzTnNZHK5NEbFbLqsfyfjEqf+6F0Tdtqk1m8rJVfRlrJ+gSpj4+ R4ASSwxen7nHNr8WWWYip2mBtoIQTUm6fCgx+eBb7b1/45wtug1Fpa/JQBZ0EZJWKQigYZWKzOz /lmcvJwZZzUMOJA== X-Google-Smtp-Source: AGHT+IH1rjTuxCsxYG6D9mVu3Pg5pO/mB4IDxtX3s8AO6yhcPfzoklII5O0bgKFOurU0kcg+8qZHn9hQHHcLNA== X-Received: from qke7.prod.google.com ([2002:a05:620a:a107:b0:854:410d:7139]) (user=edumazet job=prod-delivery.src-stubby-dispatcher) by 2002:a05:620a:4055:b0:8b2:eb79:d37d with SMTP id af79cd13be357-8c08fc00228mr1664984385a.4.1766434451091; Mon, 22 Dec 2025 12:14:11 -0800 (PST) Date: Mon, 22 Dec 2025 20:14:05 +0000 In-Reply-To: <20251222201406.3725665-1-edumazet@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251222201406.3725665-1-edumazet@google.com> X-Mailer: git-send-email 2.52.0.351.gbe84eed79e-goog Message-ID: <20251222201406.3725665-3-edumazet@google.com> Subject: [PATCH 2/3] x86/smp: Use static_call for arch_smp_send_reschedule() From: Eric Dumazet To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Peter Zijlstra , x86@kernel.org, "H . Peter Anvin" Cc: linux-kernel , Eric Dumazet , Eric Dumazet Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use static_call to avoid an indirect call, especially expensive with retpoline. Signed-off-by: Eric Dumazet --- arch/x86/include/asm/smp.h | 7 +++++-- arch/x86/kernel/smp.c | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index 891a5d16bcd52d2da0b71d928d3728afe3d15ade..3b3ff77706fb72c18e66fc1785b= 21896d32c9ac9 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h @@ -49,6 +49,10 @@ void native_send_call_func_single_ipi(int cpu); DECLARE_STATIC_CALL(x86_send_call_func_single_ipi, native_send_call_func_single_ipi); =20 +void native_smp_send_reschedule(int cpu); +DECLARE_STATIC_CALL(x86_smp_send_reschedule, + native_smp_send_reschedule); + /* Globals due to paravirt */ extern void set_cpu_sibling_map(int cpu); =20 @@ -94,7 +98,7 @@ static inline void __noreturn play_dead(void) =20 static inline void arch_smp_send_reschedule(int cpu) { - smp_ops.smp_send_reschedule(cpu); + static_call(x86_smp_send_reschedule)(cpu); } =20 static inline void arch_send_call_function_single_ipi(int cpu) @@ -127,7 +131,6 @@ void wbnoinvd_on_cpus_mask(struct cpumask *cpus); void smp_kick_mwait_play_dead(void); void __noreturn mwait_play_dead(unsigned int eax_hint); =20 -void native_smp_send_reschedule(int cpu); void native_send_call_func_ipi(const struct cpumask *mask); =20 asmlinkage __visible void smp_reboot_interrupt(void); diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c index 2c8fdf1f59d953e49a6beeba8f76f5fe62bd5db7..6e25a86f67faf0a30e9b4920b1d= 4634aa9c64de7 100644 --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c @@ -302,11 +302,16 @@ EXPORT_SYMBOL_GPL(smp_ops); =20 DEFINE_STATIC_CALL(x86_send_call_func_single_ipi, native_send_call_func_single_ipi); +DEFINE_STATIC_CALL(x86_smp_send_reschedule, + native_smp_send_reschedule); +EXPORT_STATIC_CALL(x86_smp_send_reschedule); =20 void x86_smp_ops_static_call_update(void) { static_call_update(x86_send_call_func_single_ipi, smp_ops.send_call_func_single_ipi); + static_call_update(x86_smp_send_reschedule, + smp_ops.smp_send_reschedule); } EXPORT_SYMBOL_GPL(x86_smp_ops_static_call_update); =20 --=20 2.52.0.351.gbe84eed79e-goog