Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp334787imn; Wed, 3 Aug 2022 06:00:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR5YDnkt00WDFL0LoX5NJqF0VJ2R1jw8ZdOVL+5Ly0g63u7D6m5lj8cu+UntXFTpfXfsKmaz X-Received: by 2002:a17:906:ef90:b0:730:9af7:5702 with SMTP id ze16-20020a170906ef9000b007309af75702mr8183522ejb.107.1659531604240; Wed, 03 Aug 2022 06:00:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659531604; cv=none; d=google.com; s=arc-20160816; b=WXmYAgeaD9BIPVvvx5OmOKGUtgCC/PBa7ZBtT5ZguGaoNwnb6D1xc8hk2q7bvfmPPx kdGdO2UazG5INjoqQs0XO4cd71p+mdSgwmi4C2KRBp4sgGZPlxskLgKJajR+ilVgl69T Xn2cXaHHQgqMJSY4Csvd6zQJMgKSPQiM/oVcjRwXrJRcYrSu62fY6JLP3r5KlFkaWdn7 F6phmYidfME3WSFyxvP3XWJAJvzx+gu21Ts8ZR1x4v71nCoO+q+gKy5Fsl7xaFd1OeD4 PMnIvq+tBCx8H2GzIZwy8HdvdINBCmYIfd7TahS/S6MZAXIlOPAP5NP807tVocTnr4gV YfVQ== 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:subject:cc:to:from:date; bh=fCM18tG9MAg6K1e8/OaiwJVnLSci8ra/dmu8a1T+oSU=; b=oswYvXlw9sSUAMmkE0M0Wlky9dOnnb1LTggfTIYQxjbT5wy6xwYpoNQrSE0b4d++nu GR/E0YU2k6qXyGGyJVqhdJSSRFOv0JJqoQxRS05E6hjgAXdt8VTVoyITNlAcDfJiubdx CizjcjwOp2iRxYpXEHerVN8jBia0yaGt4284fdkT3YoKf2jTEbyq6hQjBR3ib3dj9cy8 +uHd5UDl0x3mg5bKqMEivEgGHbUZb1aWPc7XJTCrPa2xwb6j37dnyLK2h9mHekC58RYY nqxvvNl30d6tzwDaBQEl21RMiYgrvgoN6hlsnEyixj1gxNYGbyCT+P2x1FyjimVPRBpB 6G2A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a0564020e8900b0043d1c157652si11264103eda.510.2022.08.03.05.59.38; Wed, 03 Aug 2022 06:00:04 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236046AbiHCMmn (ORCPT + 99 others); Wed, 3 Aug 2022 08:42:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbiHCMmm (ORCPT ); Wed, 3 Aug 2022 08:42:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43EA81EC4B for ; Wed, 3 Aug 2022 05:42:41 -0700 (PDT) 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 0954AB8211D for ; Wed, 3 Aug 2022 12:42:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8445DC433C1; Wed, 3 Aug 2022 12:42:37 +0000 (UTC) Date: Wed, 3 Aug 2022 08:42:35 -0400 From: Steven Rostedt To: Liu Song Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org, "Paul E. McKenney" Subject: Re: [PATCH] sched/debug: avoid executing show_state and causing rcu stall warning Message-ID: <20220803084235.5d56d1e4@gandalf.local.home> In-Reply-To: <1659489525-82994-1-git-send-email-liusong@linux.alibaba.com> References: <1659489525-82994-1-git-send-email-liusong@linux.alibaba.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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 [ Adding Paul ] On Wed, 3 Aug 2022 09:18:45 +0800 Liu Song wrote: > From: Liu Song > > If the number of CPUs is large, "sysrq_sched_debug_show" will execute for > a long time. Every time I execute "echo t > /proc/sysrq-trigger" on my > 128-core machine, the rcu stall warning will be triggered. Moreover, > sysrq_sched_debug_show does not need to be protected by rcu_read_lock, > and no rcu stall warning will appear after adjustment. > > Signed-off-by: Liu Song > --- > kernel/sched/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 5555e49..82c117e 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -8879,11 +8879,11 @@ void show_state_filter(unsigned int state_filter) > sched_show_task(p); > } > > + rcu_read_unlock(); > #ifdef CONFIG_SCHED_DEBUG > if (!state_filter) > sysrq_sched_debug_show(); If this is just because sysrq_sched_debug_show() is very slow, does RCU have a way to "touch" it? Like the watchdogs have? That is, to tell RCU "Yes I know I'm taking a long time, but I'm still making forward progress, don't complain about me". Then the sysrq_sched_debug_show() could have: for_each_online_cpu(cpu) { /* * Need to reset softlockup watchdogs on all CPUs, because * another CPU might be blocked waiting for us to process * an IPI or stop_machine. */ touch_nmi_watchdog(); touch_all_softlockup_watchdogs(); + touch_rcu(); print_cpu(NULL, cpu); } ?? -- Steve > #endif > - rcu_read_unlock(); > /* > * Only show locks if all tasks are dumped: > */