From patchwork Fri Jan 13 12:31:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 43241 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp243485wrt; Fri, 13 Jan 2023 04:35:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXvPnA+Row16opO7VfPsl8AfGVMG14DjJP6bYkM9xFAumUqWalQ8bPIvAq9amsprmLhMDgAX X-Received: by 2002:a05:6402:501c:b0:48f:a9a2:29fa with SMTP id p28-20020a056402501c00b0048fa9a229famr34390691eda.2.1673613357717; Fri, 13 Jan 2023 04:35:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673613357; cv=none; d=google.com; s=arc-20160816; b=kGF9QX05o/nL78OX8OK0bsuCPmAXINlSqfuGMRPFj/0BKHPTeYeBXiqmQNNQ9myy1m XXVQpE1mnReOcIf8DmM28t5FTN2HLG5Q3J/4S1oXYpYoKJ6JMEcuFMi/obI+qLTFYEKn DAY5OqgxNmuWblNgFyZPAeBpsR6cHiC20YTKsP9Kre3HKvbmu8GIYIOXGxkj29+/h/6L lJJoVzQtisKt+Blujqqan7PXEgfPYkJ7I/tdGo4Rri/O1MH22iqON6RTMOSdp0oscXgU 4lMnihByf6Nt0LIJNG0TfMtSNpWLINjsnEX5CtokQCKxZcOazTGj7mKua1G1iBVu09WF BpXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=hWUyIkdaQYU42lutK4TFmKKi5V4hFF4RSB+rS3NmQ6c=; b=heiedOndMi/KTwf/I35fqHmrZOQjU5VBSdSKFLIPDW4P8gNmJ4/JshPSx0Of4gpz1E 03szAgEbEwgrjpgCgxLOOD/yx3DwpeT4+4mDQM53JeyJoX1OTfJN7eTEBJMZ+PCE9XSI 9w7dmoMX46eCgTNRNwdLfA7khRzd5qxILBeyWkoPQm6T1HvhX64DedotIKKI/YHdcC0O NK5OrricvghuCzi78khrt72MLPwK0bqPViAvUFTh5QSC+z/DiP6TFl3GLlfcMt6wIl6n K+4BRLFZYPc5+wpFYKK2ApIOxd08NebZqgCIVUUHcaz1xxc/zxjQLcDzdMNnl3BeRNee onpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=XgvWSNLX; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="J0/YwKgL"; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds19-20020a170907725300b00860c51f7de8si7339733ejc.217.2023.01.13.04.35.33; Fri, 13 Jan 2023 04:35:57 -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=@linutronix.de header.s=2020 header.b=XgvWSNLX; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="J0/YwKgL"; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241643AbjAMMen (ORCPT + 99 others); Fri, 13 Jan 2023 07:34:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232202AbjAMMcO (ORCPT ); Fri, 13 Jan 2023 07:32:14 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D37D8551DF; Fri, 13 Jan 2023 04:31:12 -0800 (PST) Date: Fri, 13 Jan 2023 12:31:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673613070; 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=hWUyIkdaQYU42lutK4TFmKKi5V4hFF4RSB+rS3NmQ6c=; b=XgvWSNLXFtZrkcNcygdI9veWzfAN+6eXuWgVoor0lUKDz0KATXxbKG3i1ZXc7LExZCxe4N 7wi0CqdyVvZS7ifiJzOvtX7fU+7FNf7mHOa+j7AdGANj1RTLXQu8vq9KgvavjtQJhiyqZC inpL9HLdRoiopTCosT5AuxaqLQX/PdHZK3tsgj4iMFQ3GEFws1+mVEfpFNNV1/vjw1CJLP +sujqmLcF+X444myBpk5PPt9VXrfP04UEscUg3Ci+klS3Un1ffLxdM92YWSF0Yj31H5xXp uanQAJ/Zwo+9nnDuWY/pA52BPB8xHyrflh/+dfjPoV4XMsviVLZl5RzW73Ftfg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673613070; 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=hWUyIkdaQYU42lutK4TFmKKi5V4hFF4RSB+rS3NmQ6c=; b=J0/YwKgLSPTo2BTQoUF/pub1GzxVOBvtjnJsQolqtfI0Osyiefu2Xp6BOKJLeJtizWvvos hiAuc3rnS9nBkWAQ== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] time/tick-broadcast: Remove RCU_NONIDLE() usage Cc: "Peter Zijlstra (Intel)" , Ingo Molnar , Tony Lindgren , Ulf Hansson , Mark Rutland , "Rafael J. Wysocki" , Frederic Weisbecker , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230112195540.927904612@infradead.org> References: <20230112195540.927904612@infradead.org> MIME-Version: 1.0 Message-ID: <167361306982.4906.17198573695326641065.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754910800189145486?= X-GMAIL-MSGID: =?utf-8?q?1754910800189145486?= The following commit has been merged into the sched/core branch of tip: Commit-ID: e3ee5e66f78e9950b9ada276700abd95e9b144d7 Gitweb: https://git.kernel.org/tip/e3ee5e66f78e9950b9ada276700abd95e9b144d7 Author: Peter Zijlstra AuthorDate: Thu, 12 Jan 2023 20:43:40 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 13 Jan 2023 11:48:16 +01:00 time/tick-broadcast: Remove RCU_NONIDLE() usage No callers left that have already disabled RCU. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Tested-by: Tony Lindgren Tested-by: Ulf Hansson Acked-by: Mark Rutland Acked-by: Rafael J. Wysocki Acked-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230112195540.927904612@infradead.org --- kernel/time/tick-broadcast-hrtimer.c | 29 +++++++++++---------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/kernel/time/tick-broadcast-hrtimer.c b/kernel/time/tick-broadcast-hrtimer.c index 797eb93..e28f921 100644 --- a/kernel/time/tick-broadcast-hrtimer.c +++ b/kernel/time/tick-broadcast-hrtimer.c @@ -56,25 +56,20 @@ static int bc_set_next(ktime_t expires, struct clock_event_device *bc) * hrtimer callback function is currently running, then * hrtimer_start() cannot move it and the timer stays on the CPU on * which it is assigned at the moment. + */ + hrtimer_start(&bctimer, expires, HRTIMER_MODE_ABS_PINNED_HARD); + /* + * The core tick broadcast mode expects bc->bound_on to be set + * correctly to prevent a CPU which has the broadcast hrtimer + * armed from going deep idle. * - * As this can be called from idle code, the hrtimer_start() - * invocation has to be wrapped with RCU_NONIDLE() as - * hrtimer_start() can call into tracing. + * As tick_broadcast_lock is held, nothing can change the cpu + * base which was just established in hrtimer_start() above. So + * the below access is safe even without holding the hrtimer + * base lock. */ - RCU_NONIDLE( { - hrtimer_start(&bctimer, expires, HRTIMER_MODE_ABS_PINNED_HARD); - /* - * The core tick broadcast mode expects bc->bound_on to be set - * correctly to prevent a CPU which has the broadcast hrtimer - * armed from going deep idle. - * - * As tick_broadcast_lock is held, nothing can change the cpu - * base which was just established in hrtimer_start() above. So - * the below access is safe even without holding the hrtimer - * base lock. - */ - bc->bound_on = bctimer.base->cpu_base->cpu; - } ); + bc->bound_on = bctimer.base->cpu_base->cpu; + return 0; }