From patchwork Fri Sep 22 09:59:26 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: 143644 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5850239vqi; Fri, 22 Sep 2023 13:32:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8aQPCh5qTr6nnlKxYbU1pusRbjl1P+1EcGgIggy5jS+etJefrqknlKIdji1lcQOooeOBb X-Received: by 2002:a05:6358:6f08:b0:143:97c6:1e3a with SMTP id r8-20020a0563586f0800b0014397c61e3amr628209rwn.9.1695414751107; Fri, 22 Sep 2023 13:32:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695414751; cv=none; d=google.com; s=arc-20160816; b=YOzjufoEJ0VD8REBrjqpBg1ALtrp2WtNLRaFTB13DXTPtpVF41nOws6R9hRqoFvHRt pJ0Wg8nynb74J6yDPpZESnDBAaDiDTQ1p9A6sIoNP1jdESrc8UdIzAgFhek1RiyVMhaE H/oW40gDPYLWjaapfkDGCtt/lUsmRXXlJO0LNjHRODOQ16Wm218L0cq8PEwnL1uT3NtN my56b1Z34u89rJho69LF4B9orKhEVXjNCRLeoEd6DaDEDnMsL8LBhum9tdW48odURGQS 4PIy/RWHak2/qlHnvSIPTFFeGTwF7fBQtmwm0iV4/Mf6e+eguFNoWYzrdTKUjs/GQTAH 3Zhg== 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=+xSQafXNxgQJP26IJtLUKRX4XIhQKDG5RuHCBFnIp8g=; fh=pOkm8L3nqqnh+mZfZSLTQzfBuA4IJylKcmEUn25i7DE=; b=bagtp3NfTaM5w/T9QyGJBcvrdKwFUej7lLZD/p579bokKNINIma8iuUg4mf1LUVW5B qQuu8mL/3WFHaxdrMCMaX7t+BNvz1yOP0Kkrl+gC/Ax7rqZYq7qSq+IxyuUc1NkXxHMf Knyp0zAdL21yFXYmPpHXXS/utbsl/Ud3f/O26gF3sMKuBNp4PvG6gwBs+SUl859+88Mo n3Z7vqxqWSVMnvOEHsye3ccp53VNt/CFek6Xy8utHMp/SjopbA7xoPvrv6fRW2grm7mn lhgC+s/nVR1+htEBgcvWOtTMY5LY9HaChMvKW5H8TjlbxY9PeTuNxVWPDfS4j2hjRLSG VB+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=jaNcmnth; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id o15-20020a656a4f000000b00563a0c1bf06si4993948pgu.428.2023.09.22.13.32.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 13:32:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=jaNcmnth; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3EDBA80C113A; Fri, 22 Sep 2023 02:59:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233039AbjIVJ7f (ORCPT + 30 others); Fri, 22 Sep 2023 05:59:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbjIVJ7e (ORCPT ); Fri, 22 Sep 2023 05:59:34 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7E638F; Fri, 22 Sep 2023 02:59:28 -0700 (PDT) Date: Fri, 22 Sep 2023 09:59:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695376767; 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=+xSQafXNxgQJP26IJtLUKRX4XIhQKDG5RuHCBFnIp8g=; b=jaNcmnthuYPSol5qKOD/vsvFaFB1k3oFRmtHE8VJUKjhnHuqdTDY0GxIu9aDeeYjG9C4oI DYdc8Cz4jHdvftno+lFAkRZyLEM/I/VbgN3nCguEAdPqmxOXvP94mxyIl/DBz8Na73/xpn si0r+Y0F16bbB4gqJUlXKtM6SZ5GQHUGfCBzKRVQ16GLzOCw7dV80mdJiB79Xp95HfrUS/ gNX4PibS/e6yjXN0SKe7v4zmSoEyPOIRmBhAOoQ5UEhM5Sj1UadYnnSURbplEZ/ZftASaE eNfhmsrMzo7F+J9FbUXfkRvpJVHenOjZVBg5NuA0Pl/cTtkgmnFwV76Q0X36Eg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695376767; 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=+xSQafXNxgQJP26IJtLUKRX4XIhQKDG5RuHCBFnIp8g=; b=bZ2Ho3YNt4nes4giczcw+3ZiOUbBjic66y6k6H2H38rplboWIBR2Z8Kj9iSR/R5i8i5Ngw uikxrHL9j+MWRKCA== From: "tip-bot2 for Liming Wu" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/debug: Avoid checking in_atomic_preempt_off() twice in schedule_debug() Cc: Liming Wu , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230825023501.1848-1-liming.wu@jaguarmicro.com> References: <20230825023501.1848-1-liming.wu@jaguarmicro.com> MIME-Version: 1.0 Message-ID: <169537676655.27769.432100540285605722.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,URIBL_BLOCKED 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 22 Sep 2023 02:59:33 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777771218004676508 X-GMAIL-MSGID: 1777771218004676508 The following commit has been merged into the sched/core branch of tip: Commit-ID: dc461c48deda8a2d243fbaf49e276d555eb833d8 Gitweb: https://git.kernel.org/tip/dc461c48deda8a2d243fbaf49e276d555eb833d8 Author: Liming Wu AuthorDate: Fri, 25 Aug 2023 10:35:00 +08:00 Committer: Ingo Molnar CommitterDate: Fri, 22 Sep 2023 11:50:49 +02:00 sched/debug: Avoid checking in_atomic_preempt_off() twice in schedule_debug() in_atomic_preempt_off() already gets called in schedule_debug() once, which is the only caller of __schedule_bug(). Skip the second call within __schedule_bug(), it should always be true at this point. [ mingo: Clarified the changelog. ] Signed-off-by: Liming Wu Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230825023501.1848-1-liming.wu@jaguarmicro.com --- kernel/sched/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 52ceb85..1074934 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5899,8 +5899,7 @@ static noinline void __schedule_bug(struct task_struct *prev) print_modules(); if (irqs_disabled()) print_irqtrace_events(prev); - if (IS_ENABLED(CONFIG_DEBUG_PREEMPT) - && in_atomic_preempt_off()) { + if (IS_ENABLED(CONFIG_DEBUG_PREEMPT)) { pr_err("Preemption disabled at:"); print_ip_sym(KERN_ERR, preempt_disable_ip); }