Message ID | fe4deb491717279f6db8c58bfaf923d964b4a2ed.1675969869.git.jpoimboe@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp526892wrn; Thu, 9 Feb 2023 11:23:55 -0800 (PST) X-Google-Smtp-Source: AK7set/qkUjP1SlG4XtHEsj9b+tT5nXJJPhqzN8Uqv6vuQqxVrmgFL+uUkEVkopWaS9x2JCchr01 X-Received: by 2002:a17:90b:1d08:b0:230:c247:731b with SMTP id on8-20020a17090b1d0800b00230c247731bmr13935480pjb.7.1675970634984; Thu, 09 Feb 2023 11:23:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675970634; cv=none; d=google.com; s=arc-20160816; b=WTcrRp/M88lAYAkTWxw/WhNDqwd7G5BxDx+BxZ6q3QI6iyeM6RuqXtyzOq1cJBU2yj sYiXtUElZ+Jddn+evBchTDR4QvaNpZK1L7+Ft2ndHqn6SNjtsvTgFnxQGsnn4Afi4qlu eDdX/0uBFU/VfN+xHQt5GY8EvqwsxkiJTyKspoK5IGG1Ooj8xC4cQZDy6bvmTC//n0gO jyXKP+dbqIva61/AZdM6U+juk01JWZEpNpFEAigd4FsAcqH8pu/lHL1aaV6eqaIaQ796 U41YW+9QjOjyBkkWIWsAzgP+jkgljNzkRFN3cF/NJCa/kpyAPm1fGOceOo2b94s38XqT sttQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eIfe60XJJIiDJTKhVwgb+glJla9ENtL00sq047lFBiY=; b=c+cn0G+HUpE8Ns83sre/sWkNU7dy6XpQOUW45Vs19f30apIuFti2uYc8Gzi8aAhqoX 1S8GessnL4t52YY60W8/bOSZ7Ae72TxcgnUIBOb8O1b4QugYkqZPLZZXExcHY03V0Upl m1tnl5mBcWWTu4hLTsJd5yquFIZ7BgJhIIS9FQVl/1EeV3csEFZE6lAWbJRHQTUOhRn8 Ab7hZEO00QVyxEPdO0Ca24+k4StceOHdDfRsO9qSsFVci3NaKnzk1LGbQ+ZBMKkdIP0N Pn1Q1FmWW3CJHuIi4vglTylzOo9R6W3HAZCmxrbNHgvwMNdTanwBg+4bdNKV+1HY/bKw vMgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EJ+0bCl0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kk15-20020a17090b4a0f00b0021a1261c317si6513093pjb.126.2023.02.09.11.23.40; Thu, 09 Feb 2023 11:23:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EJ+0bCl0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230029AbjBITS2 (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Thu, 9 Feb 2023 14:18:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230016AbjBITS0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Feb 2023 14:18:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F898458A1; Thu, 9 Feb 2023 11:18:26 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C8574B8202F; Thu, 9 Feb 2023 19:18:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07908C433EF; Thu, 9 Feb 2023 19:18:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675970303; bh=2N2cNIU1XW5YmMOreRcBKEoSVcSbJ0JNBK/ngcNtt9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EJ+0bCl0DYiLH3J2h2I74scxWV26SXxTDm1arHtllsr8w1Bq1EuE6aoePIvqs6ryi CfWcMTuzcZQCO3ceinvRXyadBcBNfkzYhtrdAnqVWVpAenvUbPrt7o97lP71TOgneU A8qBJefAmcCCMWG8D9fOfo2n8Fqis275rcLismrol8xdsrD11GJ0qmzqc74v06XFeV 1ngvEc6mfBrKZeKCAl2ZvA2LV+l8vfFAkFMA93hyPUFH9JkybLkldcyVeSP0MmqHM+ JBWKklr8/bso6Ry+CjEaHttL2xa7Geu5OzAgO6W8W/PCzHGE8tINlDYZyeqII2Og47 atGwj4GGGuLSQ== From: Josh Poimboeuf <jpoimboe@kernel.org> To: live-patching@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Seth Forshee <sforshee@digitalocean.com>, Peter Zijlstra <peterz@infradead.org>, Song Liu <song@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Petr Mladek <pmladek@suse.com>, Joe Lawrence <joe.lawrence@redhat.com>, Miroslav Benes <mbenes@suse.cz>, Jiri Kosina <jikos@kernel.org>, Ingo Molnar <mingo@redhat.com> Subject: [PATCH 1/3] livepatch: Skip task_call_func() for current task Date: Thu, 9 Feb 2023 11:17:47 -0800 Message-Id: <fe4deb491717279f6db8c58bfaf923d964b4a2ed.1675969869.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <cover.1675969869.git.jpoimboe@kernel.org> References: <cover.1675969869.git.jpoimboe@kernel.org> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757382584608197108?= X-GMAIL-MSGID: =?utf-8?q?1757382584608197108?= |
Series |
livepatch,sched: Add livepatch task switching to cond_resched()
|
|
Commit Message
Josh Poimboeuf
Feb. 9, 2023, 7:17 p.m. UTC
The current task doesn't need the scheduler's protection to unwind its
own stack.
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
kernel/livepatch/transition.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Comments
On Thu 2023-02-09 11:17:47, Josh Poimboeuf wrote: > The current task doesn't need the scheduler's protection to unwind its > own stack. > > Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> I do not see any problem with it: Reviewed-by: Petr Mladek <pmladek@suse.com> Best Regards, Petr
diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index f1b25ec581e0..4d1f443778f7 100644 --- a/kernel/livepatch/transition.c +++ b/kernel/livepatch/transition.c @@ -307,7 +307,11 @@ static bool klp_try_switch_task(struct task_struct *task) * functions. If all goes well, switch the task to the target patch * state. */ - ret = task_call_func(task, klp_check_and_switch_task, &old_name); + if (task == current) + ret = klp_check_and_switch_task(current, &old_name); + else + ret = task_call_func(task, klp_check_and_switch_task, &old_name); + switch (ret) { case 0: /* success */ break;