Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp262442imn; Wed, 3 Aug 2022 02:49:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR7GEsAzbDlrmVEaTyFZd30zKKhQdceSpc5FS7T373t/qLyYZHjX6BXCEHsPs1jZc6tdnsb3 X-Received: by 2002:a17:907:6e1e:b0:730:a923:421d with SMTP id sd30-20020a1709076e1e00b00730a923421dmr3670684ejc.118.1659520194536; Wed, 03 Aug 2022 02:49:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659520194; cv=none; d=google.com; s=arc-20160816; b=hnHs/qNM2aMippaHqbwZ2OFb6yJePQppF7kJyosr/DHagGEZU5n2tT+xuI+2OHjcBW INUtmAfDW0I8gOX6y2fxqLB4fZ4fYDwq8tJCjYwMl1i8XjnV0k7hde0O2RQkUDOswX/I TGyLcq71SgZ2E2BtEB7iP5EVXJMqXJjzRWWuoFlI7fSj635sRiGrjV59dUqytCGwFuyR XIaAn5ZD8xcv5cSGWVk7gZSsGSPn3vhTZbCScRJPNK86eSP3w4WZ4+BtzGCiI0G8nD18 CR54pdz1GvjqSPFIwqMAv29qlUVYRVdCwqUC0NNoGl6MM/zdhSLMTagvMuaeLcfF+w/z 2uhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=JxYZfzg55teJHdhaannVveTfUSuVrXuO13k6P6Vghuw=; b=rhEgLXnXvhbyXeqYVENv4WBsPAPaf0UT4F8FagDvfOs9fTNv1kfj7eNOVeQ17AW90u FkqZxevB09eyBJReMRFqwds7w4KTvJokzKd1yz3f23emlNF9Ttau0vBhf3eEHBZa7gLW 5kmyLOCRCD8oS2eS9teauZBLQhjcVmehPj2xBZgvUedohFr2gI0ZUHCN2eSR6OPHx6ki tU7z0d/ZeQlZ7EKwOJV52OrNtHuaZRH/U7wi7Igq9YIt5AV5eLXsGqdmPqUVWPHAeNC5 h7f66uDW3U58LZvhHzws3qWlYfv1yjVaMZfaC8A1R7BaY57BXp5cpRYuFRU8usjLo8Vr UVuQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a4-20020a170906468400b0072b3cb29befsi12580567ejr.445.2022.08.03.02.49.29; Wed, 03 Aug 2022 02:49:54 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237447AbiHCJ0C (ORCPT + 99 others); Wed, 3 Aug 2022 05:26:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237437AbiHCJZ5 (ORCPT ); Wed, 3 Aug 2022 05:25:57 -0400 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 891C55A14F for ; Wed, 3 Aug 2022 02:25:55 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R261e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=liusong@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0VLGENyx_1659518750; Received: from 30.178.80.143(mailfrom:liusong@linux.alibaba.com fp:SMTPD_---0VLGENyx_1659518750) by smtp.aliyun-inc.com; Wed, 03 Aug 2022 17:25:51 +0800 Message-ID: <10f7d339-c451-8284-ccd8-ce9a0fe14f48@linux.alibaba.com> Date: Wed, 3 Aug 2022 17:25:49 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.0.3 Subject: Re: [PATCH] sched/debug: avoid executing show_state and causing rcu stall warning To: Ingo Molnar Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org References: <1659489525-82994-1-git-send-email-liusong@linux.alibaba.com> From: Liu Song In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL 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 > * Liu Song wrote: > >>> * 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. >>>> >>> That doesn't mean it doesn't have to be protected by *any* lock - which >>> your patch implements AFAICS. >>> >>> There's a couple of lines such as: >>> >>> for_each_online_cpu(cpu) { >> Hi, >> >> Here I refer to the implementation of "sysrq_timer_list_show", and I don't >> see any lock. >> >> Maybe there is a problem with the implementation of "sysrq_timer_list_show". > But we are talking about sysrq_sched_debug_show(), which your patch tries > to relax the RCU locking of. Hi, I'm not sure for_each_online_cpu && print_cpu must need a lock to protect, so I refer to other codes under kernel that reference the implementation. It looks like some places use "get_online_cpus" to prevent cpu hotplug, but many places don't have obvious protection, so I'm also confused if protection is necessarily required. Thanks > > Thanks, > > Ingo