From nobody Sun Feb 8 17:03:59 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1DE8C6FD1F for ; Wed, 22 Mar 2023 22:48:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229928AbjCVWs6 (ORCPT ); Wed, 22 Mar 2023 18:48:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229864AbjCVWsx (ORCPT ); Wed, 22 Mar 2023 18:48:53 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D9FB40FC; Wed, 22 Mar 2023 15:48:53 -0700 (PDT) Date: Wed, 22 Mar 2023 22:48:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1679525331; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SDhT9TCsh0+kGa2j9Qd4A7H8TlQT3/KNsLPRBXRfuuI=; b=YG7Wzowa3aD/5R4c7J2Eo/Mt+bNUqpoaMiQHZG6NbLj5dQSzySr/X+uP8or/R8PcrCFT4d R7Xi3GXVkx9GIvg2d8GdmovMbf2CSyxOhl0c12YYYIMx66duozIJqpVKPSh8XL5krlX6Y2 OmjTmT64lcjhc9jDtWENixhPh0iW0siy7MMVr4LNM70C8e1BMzSIkzz81cDmhyDFQluBx6 a9xd3eC5wkoDmstisF0biTGFVVXtLx1x9tn5bVOL7/1+p2rOeufat+gRpcrIj4KP+GrmRU EO+gM9hmxnFZ74xGVb6tTzqXsMGgghHA5xMX7dAR59mK2HM8adWBmSONb5g3cQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1679525331; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SDhT9TCsh0+kGa2j9Qd4A7H8TlQT3/KNsLPRBXRfuuI=; b=jCTTiZkOgCochuKJ1LCQsIrhv/sEJIZla733ujD8RCOG3u0NJFZP2HN2idOMej03l2iMbd 2E8ySdl6te3JJlAw== From: "tip-bot2 for Josh Poimboeuf" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] livepatch: Skip task_call_func() for current task Cc: Josh Poimboeuf , "Peter Zijlstra (Intel)" , Petr Mladek , "Seth Forshee (DigitalOcean)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <4b92e793462d532a05f03767151fa29db3e68e13.1677257135.git.jpoimboe@kernel.org> References: <4b92e793462d532a05f03767151fa29db3e68e13.1677257135.git.jpoimboe@kernel.org> MIME-Version: 1.0 Message-ID: <167952533112.5837.7165959544411828393.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: 383439d3d400d4c5a7ffb4495124adc6be6a05e2 Gitweb: https://git.kernel.org/tip/383439d3d400d4c5a7ffb4495124adc6b= e6a05e2 Author: Josh Poimboeuf AuthorDate: Fri, 24 Feb 2023 08:49:59 -08:00 Committer: Peter Zijlstra CommitterDate: Wed, 22 Mar 2023 17:09:28 +01:00 livepatch: Skip task_call_func() for current task The current task doesn't need the scheduler's protection to unwind its own stack. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Petr Mladek Tested-by: Seth Forshee (DigitalOcean) Link: https://lore.kernel.org/r/4b92e793462d532a05f03767151fa29db3e68e13.16= 77257135.git.jpoimboe@kernel.org --- kernel/livepatch/transition.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index 135fc73..824e2e3 100644 --- a/kernel/livepatch/transition.c +++ b/kernel/livepatch/transition.c @@ -312,7 +312,11 @@ static bool klp_try_switch_task(struct task_struct *ta= sk) * functions. If all goes well, switch the task to the target patch * state. */ - ret =3D task_call_func(task, klp_check_and_switch_task, &old_name); + if (task =3D=3D current) + ret =3D klp_check_and_switch_task(current, &old_name); + else + ret =3D task_call_func(task, klp_check_and_switch_task, &old_name); + switch (ret) { case 0: /* success */ break;