Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2416336rwd; Mon, 15 May 2023 11:20:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/Hes1++/3SnpgSRQeVpBTgO4zQ78n4kF3VMoS0FDN9z7RMBidlHVS9O8PfHLtXbuM31lf X-Received: by 2002:a17:90a:384b:b0:24d:dc79:5901 with SMTP id l11-20020a17090a384b00b0024ddc795901mr35658213pjf.26.1684174815553; Mon, 15 May 2023 11:20:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684174815; cv=none; d=google.com; s=arc-20160816; b=fM9jpfCs4NjTDLXbp0pV8S8Gyhcx0CuUxKRFUbn7iqnvO4x1XcggfXwO/aSKr7yi96 Ic4bXi5kPloD1Ojj0T4k8E5yIkhEYH4381L2avjxmT4sg+caUBSLQafeXwwHWqvRKxEv Ncd15wLVZrcX4ymJ9PygfLEB3WEGCMl+Ynexd0tH6DjdwM8tduJlNynUqeLrXjc4l+JK wBLPjPHkBJWhnqFpRp/kkndm4OgwWjrO4ApcrCrcdKRPmBk63cuctkS15MqGjSSZRnqx h1//KgEw6HKJh/gqTX6ZgvxmsAZi1dEY1QYMtGpGDK0/Xk2KQCrakhOt/S4JJLR8zrFo bmZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=58a/XJOU/xb3bnRPHU915pfNGuB0OCHJx7FPDv75DPY=; b=l/uRzStK42AZdDKNVOC4dyyQSF3K9Ypk01gqmoI8J+Mc6KZsgPery2T2b9di7ERl7y LkTv8P5PJlpCez1sYnouVLKJEZEtNoUnYj4D2YGdRwAGPWn5xgMGiLlIKwMsHmaumqyA RHXWBRk3e0SK5w7b8ujNusv63XN2HZ/RslzZ2lzN3KDnLb7pwjttiop+RB0MI0uHZzQN WErs2QvL42qXaGeiEhu/eHdp697H70FX3DHtbCgG4C+hsJOCD4yK9Eoa3olbzM3ju+Gx P1BvzYJcBlH8BrGddj5ZuGHWGMkTQ46d/V7QdUxwsb2V79QbStP1qWeIei3sJhnSzQnV sSsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tJ1w317a; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y192-20020a638ac9000000b0050bfa82c243si18174946pgd.17.2023.05.15.11.20.02; Mon, 15 May 2023 11:20:15 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tJ1w317a; 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 S245121AbjEOSH5 (ORCPT + 99 others); Mon, 15 May 2023 14:07:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244997AbjEOSHB (ORCPT ); Mon, 15 May 2023 14:07:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1A2821071; Mon, 15 May 2023 11:04:33 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 805CA630B1; Mon, 15 May 2023 18:04:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4020C433D2; Mon, 15 May 2023 18:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684173872; bh=w/tD1VgUWIZXjc4ZO9uAIcHfFZfFG43mlWXV784BVlQ=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=tJ1w317a8iaHz1VGX6pm1812CQT1CvbM4o1OUpBtLFPrhBfqSm1D7A8t3RzBum81C tc0CXxzxdPjt+oPiu/ofkSx6oI+QOk/s2nPrImBoHKrqMmtlVwGPjSKakwadtDllsZ cVyRiYxlZxsgFQIGh1HaX9l/ltuoxq48wsV4Ky7Vx/cVVXyYkOGRi/JYUbPe/p4L0P EYVLyyaIpNL1RPJsKEzLwJRUTXo28flTcu0yN4VW1ARuxJhzY3Zo9YKIJm/a2Ta/Rj p6l8rn4JdZoM4cC9Afk+pJUZ4FGdY0nQqpEwqCW4iaWWlBwXBPF3IoaDZ8YsRlNVbV 0/G+LFrSm9dMw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 7E6D1CE0C8D; Mon, 15 May 2023 11:04:32 -0700 (PDT) Date: Mon, 15 May 2023 11:04:32 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, Zqiang Subject: Re: [PATCH rcu 5/6] doc/rcutorture: Add description of rcutorture.stall_cpu_block Message-ID: Reply-To: paulmck@kernel.org References: <7ffd4a5d-61e9-4b4c-a312-a85bcde08c39@paulmck-laptop> <20230510171238.2189921-5-paulmck@kernel.org> <0146f6ad-9a2c-4a28-8992-e054afade42c@paulmck-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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,T_SCC_BODY_TEXT_LINE 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 On Thu, May 11, 2023 at 10:00:18PM -0700, Joel Fernandes wrote: > On Thu, May 11, 2023 at 11:11 AM Paul E. McKenney wrote: > > > > On Wed, May 10, 2023 at 10:47:36PM -0700, Joel Fernandes wrote: > > > On Wed, May 10, 2023 at 10:12 AM Paul E. McKenney wrote: > > > > > > > > From: Zqiang > > > > > > > > If you build a kernel with CONFIG_PREEMPTION=n and CONFIG_PREEMPT_COUNT=y, > > > > then run the rcutorture tests specifying stalls as follows: > > > > > > > > runqemu kvm slirp nographic qemuparams="-m 1024 -smp 4" \ > > > > bootparams="console=ttyS0 rcutorture.stall_cpu=30 \ > > > > rcutorture.stall_no_softlockup=1 rcutorture.stall_cpu_block=1" -d > > > > > > > > The tests will produce the following splat: > > > > > > > > [ 10.841071] rcu-torture: rcu_torture_stall begin CPU stall > > > > [ 10.841073] rcu_torture_stall start on CPU 3. > > > > [ 10.841077] BUG: scheduling while atomic: rcu_torture_sta/66/0x0000000 > > > > .... > > > > [ 10.841108] Call Trace: > > > > [ 10.841110] > > > > [ 10.841112] dump_stack_lvl+0x64/0xb0 > > > > [ 10.841118] dump_stack+0x10/0x20 > > > > [ 10.841121] __schedule_bug+0x8b/0xb0 > > > > [ 10.841126] __schedule+0x2172/0x2940 > > > > [ 10.841157] schedule+0x9b/0x150 > > > > [ 10.841160] schedule_timeout+0x2e8/0x4f0 > > > > [ 10.841192] schedule_timeout_uninterruptible+0x47/0x50 > > > > [ 10.841195] rcu_torture_stall+0x2e8/0x300 > > > > [ 10.841199] kthread+0x175/0x1a0 > > > > [ 10.841206] ret_from_fork+0x2c/0x50 > > > > > > Another way to get rid of the warning would be to replace the > > > cur_ops->readlock() with rcu_read_lock(). Though perhaps that will not > > > test whether the particular RCU flavor under testing is capable of > > > causing a stall :-). > > > > Exactly! > > > > > > rcutorture.stall_cpu_block= [KNL] > > > > Sleep while stalling if set. This will result > > > > - in warnings from preemptible RCU in addition > > > > - to any other stall-related activity. > > > > + in warnings from preemptible RCU in addition to > > > > + any other stall-related activity. Note that > > > > + in kernels built with CONFIG_PREEMPTION=n and > > > > + CONFIG_PREEMPT_COUNT=y, this parameter will > > > > + cause the CPU to pass through a quiescent state. > > > > + Any such quiescent states will suppress RCU CPU > > > > + stall warnings, but the time-based sleep will > > > > + also result in scheduling-while-atomic splats. > > > > > > Could change last part to "but may also result in > > > scheduling-while-atomic splats as preemption might be disabled for > > > certain RCU flavors in order to cause the stall". > > > > Is that needed given the earlier "in kernels built with > > CONFIG_PREEMPTION=n and CONFIG_PREEMPT_COUNT=y"? > > Hmm, I guess is not clear to the reader without code reading about why > preempt got disabled. So I would add that last part I mentioned, but I > am Ok either way, it is just a suggestion. I will figure something out to more tightly tie this to the previous CONFIG_PREEMPTION=n. > > > > + Which might or might not be what you want. > > > > + > > > > > > Suggest drop this line ;-). > > > > OK, I will bite. ;-) > > > > What is your concern with this line? > > It is not needed IMO. It actually is, otherwise the various testing services complain about getting splats. I will upgrade it to something more explicit. Thanx, Paul > thanks, > > - Joel > > > > > > rcutorture.stall_cpu_holdoff= [KNL] > > > > Time to wait (s) after boot before inducing stall. > > > > -- > > > > 2.40.1 > > > >