Message ID | 20231103072639.11426-1-qiang.zhang1211@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp854501vqu; Fri, 3 Nov 2023 00:27:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDnW5FFBietlQvfrj0HTecVsVgtgMZ5LimDNJW1PCqhiDpWrw9Lkk1Yy37niQTSybzigJg X-Received: by 2002:a17:902:d48b:b0:1c9:dff6:58e8 with SMTP id c11-20020a170902d48b00b001c9dff658e8mr21652192plg.54.1698996421154; Fri, 03 Nov 2023 00:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698996421; cv=none; d=google.com; s=arc-20160816; b=RVbu8wsV1vjmGJ96I4r7vK4BBwQehDVROCWB8ZE0CALSI6Q31b7JZQzypwPpsFiuPo o8PCxTryMzziRBqSMXWHnYVy2aJfjSKV5C7h7V0OjJzxF7vd8NX7qnXELxXnuTCukPum WeSuJFpSguhFXr2gQZRNHQaf7nsLe8hlv8uC/RsNH5mozyGPNAjS4W/oeW6tjkGAZU3h hciJvmsq3hE6Yq0CKsmX5onMTfEFCs5wq+l6tIUdHt06lNcgkdaYRpDnkXTQrshmGUht 8qp9eKbelNtFiO60ln/LywA6YjrBwtB/bXQuAFZTw+kohUHs1/6stuIuJI588FhqiDLT /ruQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=cAgvdtIcQPX971sbAD4m0YcUgmn+p4/agvvmTkVVwws=; fh=6A/WgWowr3MjDd6Yuo8Ot7KrHR7lgRtzC3pQaPShFVI=; b=fsInLNirxIpsk67E5DLYJ2H3YY+jX4zEYiAcfmWhLTKrgvb31Kpf4u97oX5CX7u2fU 8R2iT9rT23QYzsu/vqBnHN3HLrUuBv2aV8lfdnBva7i2v0iIl4TeKC4xaa8/wSKlH4kM GteDQPKZXjOCCz+w9ytVBuUGNcTI7jJHfARcy+m1DC40+rlpnQmk79ErqlNOgpOri3bx 5PKrA0/IxBozCJSDR3c7w6NuczSZ/kxUufjVcKWZOMewDh4gVCnEN4t8SeuzmPpreanr +0GCql64f9HZlk5e95qGa0ccNJljfe/gD2LmLB/DpKK9qio9SjQH1GTBeKI5f/K8Tqcv 3vUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RIxMLPHc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i9-20020a17090332c900b001c3323ff53asi1086079plr.139.2023.11.03.00.27.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 00:27:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RIxMLPHc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0ED468311BFC; Fri, 3 Nov 2023 00:27:00 -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 S229526AbjKCH05 (ORCPT <rfc822;lhua1029@gmail.com> + 36 others); Fri, 3 Nov 2023 03:26:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232992AbjKCH04 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 3 Nov 2023 03:26:56 -0400 Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F21D7184; Fri, 3 Nov 2023 00:26:51 -0700 (PDT) Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-1efa01323b4so987930fac.3; Fri, 03 Nov 2023 00:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698996409; x=1699601209; darn=vger.kernel.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cAgvdtIcQPX971sbAD4m0YcUgmn+p4/agvvmTkVVwws=; b=RIxMLPHcWnl2PvPYRttSRvVoJ71fezeH+pUmynO6wnZEwNJkGKUYGpu/XnrMCcSgdR 5hABNVLR12X5MVGR7H1/BiPz4aeb7NFWXPHq/7rFvZ60GDzPwO1Dv/jpHI0pQsKnEViq AidaSjhfsRtcD9uLTpSlg7kemYMSW9MEnuKUZedGmKfEOjD5BzHHMme/ZCvX0uu+KCzQ Jyy5aVz+ZMbHynohgfU/tF5I+7d1oUfStfnPeIu9LyzRfaQ/1bNjxVfxQE8H79lTrgsr uDxSYVTf+Raf2dpZU7DtRCSr2On7t8dzmQvTwXNnHKCN4X2IFL0bLSvHgt3WjQ39F8Cw QTHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698996409; x=1699601209; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cAgvdtIcQPX971sbAD4m0YcUgmn+p4/agvvmTkVVwws=; b=f5YAwpNy0c2fOh03FW7aIqYgD//XYRY5j5aEa9xvAnOKd3byTHZtS5Q0JWsRRNqxGp h/o2rI/RPisU5TpbGDk3gy1xQNDzZm+S7fwZXFBsFFWWCZs1bjhecQ25pu2D9PH1OtgO QRy9oZyL7YhTWStoxaOY7puX2hE62xjVQFvByvZTd9OKZfOJx6Z2ZzI9KoTlmuJ3Cks2 CCb45+OF4QovuA3lqO4SklQcDYUwjlQejN6Y0EfDSh6BMyy7sfMh4VCYia0ZL2h9sJxX bcZIvvrSdNmzeVI8dovFjEwRtBeL1KHPkeJe+aMUvP/rPAd1+lXtM5inel1EfJEnOTCe pLgQ== X-Gm-Message-State: AOJu0YxKf9EH3lmZ60Wvix3DXO0zIHwSFR1hB0uFqjEHlnuGAxndNESX LPNcbJ3AYgAErQ5OETscgA4= X-Received: by 2002:a05:6871:723:b0:1ef:a87f:5d52 with SMTP id f35-20020a056871072300b001efa87f5d52mr20315557oap.6.1698996408708; Fri, 03 Nov 2023 00:26:48 -0700 (PDT) Received: from MSCND1355B05.fareast.nevint.com ([183.242.39.186]) by smtp.gmail.com with ESMTPSA id b3-20020a63cf43000000b0056c2f1a2f6bsm773341pgj.41.2023.11.03.00.26.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 00:26:47 -0700 (PDT) From: Zqiang <qiang.zhang1211@gmail.com> To: paulmck@kernel.org, frederic@kernel.org, joel@joelfernandes.org Cc: qiang.zhang1211@gmail.com, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rcutorture: Add fqs_holdoff check before the fqs_task is created Date: Fri, 3 Nov 2023 15:26:39 +0800 Message-Id: <20231103072639.11426-1-qiang.zhang1211@gmail.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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: <linux-kernel.vger.kernel.org> 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, 03 Nov 2023 00:27:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781526871600198332 X-GMAIL-MSGID: 1781526871600198332 |
Series |
rcutorture: Add fqs_holdoff check before the fqs_task is created
|
|
Commit Message
Z qiang
Nov. 3, 2023, 7:26 a.m. UTC
For rcutorture tests that support fqs operations and set fqs_duration
greater than zero, the fqs_task kthread will be created. but if the
fqs_holdoff is not set, the default value is zero, this cause fqs_task
enter a long-term busy loop and won't voluntarily give up the CPU until
stopped by kthread_stop(). this commit therefore add for fqs_holdoff check
before the fqs_task is created, make sure the fqs_task is created when
the fqs_holdoff is also greater than zero.
Signed-off-by: Zqiang <qiang.zhang1211@gmail.com>
---
kernel/rcu/rcutorture.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
> > For rcutorture tests that support fqs operations and set fqs_duration > greater than zero, the fqs_task kthread will be created. but if the > fqs_holdoff is not set, the default value is zero, this cause fqs_task > enter a long-term busy loop and won't voluntarily give up the CPU until > stopped by kthread_stop(). this commit therefore add for fqs_holdoff check > before the fqs_task is created, make sure the fqs_task is created when > the fqs_holdoff is also greater than zero. > > Signed-off-by: Zqiang <qiang.zhang1211@gmail.com> > if not apply this patch, will trigger rcu stall for built with PREEMPT_RCU=n kernels. runqemu kvm nographic slirp qemuparams="-smp 2 -m 1024" bootparams="rcutorture.fqs_duration=4" -d [ 31.071252] rcu: INFO: rcu_sched self-detected stall on CPU [ 31.071264] rcu: 0-....: (25999 ticks this GP) idle=a10c/1/0x4000000000000000 softirq=3064/3065 fqs=2038552 [ 31.071273] rcu: hardirqs softirqs csw/system [ 31.071277] rcu: number: 0 212 0 [ 31.071281] rcu: cputime: 166 1 12830 ==> 12999(ms) [ 31.071286] rcu: (t=26000 jiffies g=1373 q=13803 ncpus=2) [ 31.071292] CPU: 0 PID: 48 Comm: rcu_torture_fqs Tainted: G L 6.6.0-rc2-rt4zqiang #54 [ 31.071299] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014 [ 31.071303] RIP: 0010:_raw_spin_unlock_irqrestore+0x47/0x60 [ 31.071314] Code: 08 e8 cd c6 92 fe 4c 89 e7 e8 b5 2d 93 fe 81 e3 00 02 00 00 75 1d 9c 58 f6 c4 02 75 1d 48 85 db 74 01 fb 65 ff 0d 51 86 98 66 <5b> b [ 31.071319] RSP: 0018:ffff888004237e38 EFLAGS: 00000246 [ 31.071326] RAX: 0000000000000046 RBX: 0000000000000200 RCX: ffffffff981ab987 [ 31.071331] RDX: 0000000000000003 RSI: dffffc0000000000 RDI: ffffffff99883445 [ 31.071335] RBP: ffff888004237e48 R08: 0000000000000000 R09: 0000000000000000 [ 31.071339] R10: fffffbfff3672d80 R11: ffffffff9b396c07 R12: ffffffff9ac02518 [ 31.071344] R13: 0000000000000246 R14: 0000000000000000 R15: 0000000000000000 [ 31.071348] FS: 0000000000000000(0000) GS:ffff888035e00000(0000) knlGS:0000000000000000 [ 31.071355] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 31.071359] CR2: 0000561df3203100 CR3: 0000000024a78000 CR4: 00000000001506f0 [ 31.071364] Call Trace: [ 31.071367] <IRQ> [ 31.071372] ? show_regs+0x66/0x70 [ 31.071379] ? dump_cpu_task+0x68/0x70 [ 31.071387] ? rcu_dump_cpu_stacks+0x179/0x2b0 [ 31.071396] ? rcu_sched_clock_irq+0xb5c/0x11a0 [ 31.071402] ? irqtime_account_process_tick+0x158/0x210 [ 31.071411] ? update_process_times+0x6e/0xa0 [ 31.071418] ? tick_sched_timer+0x185/0x1d0 [ 31.071425] ? __pfx_tick_sched_timer+0x10/0x10 [ 31.071431] ? __hrtimer_run_queues+0x403/0x640 [ 31.071438] ? hrtimer_interrupt+0x77/0x350 [ 31.071445] ? __pfx___hrtimer_run_queues+0x10/0x10 [ 31.071451] ? kvm_clock_get_cycles+0x1c/0x30 [ 31.071457] ? ktime_get_update_offsets_now+0x102/0x200 [ 31.071464] ? hrtimer_interrupt+0x1ae/0x350 [ 31.071473] ? __sysvec_apic_timer_interrupt+0xaa/0x240 [ 31.071480] ? sysvec_apic_timer_interrupt+0x75/0x90 [ 31.071487] </IRQ> [ 31.071491] <TASK> [ 31.071494] ? asm_sysvec_apic_timer_interrupt+0x1f/0x30 [ 31.071502] ? lockdep_hardirqs_on_prepare+0x17/0x230 [ 31.071510] ? _raw_spin_unlock_irqrestore+0x55/0x60 [ 31.071516] ? _raw_spin_unlock_irqrestore+0x47/0x60 [ 31.071524] swake_up_one+0x47/0x60 [ 31.071531] rcu_gp_kthread_wake+0x63/0x90 [ 31.071537] rcu_force_quiescent_state+0xfb/0x160 [ 31.071544] rcu_torture_fqs+0xc4/0x160 [ 31.071552] ? __pfx_rcu_torture_fqs+0x10/0x10 [ 31.071559] kthread+0x197/0x1d0 [ 31.071565] ? kthread+0x107/0x1d0 [ 31.071571] ? __pfx_kthread+0x10/0x10 [ 31.071577] ret_from_fork+0x40/0x60 [ 31.071583] ? __pfx_kthread+0x10/0x10 [ 31.071590] ret_from_fork_asm+0x1b/0x30 [ 31.071599] </TASK> Thanks Zqiang > --- > kernel/rcu/rcutorture.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c > index 83999e57b3ea..9f0e6c1cad44 100644 > --- a/kernel/rcu/rcutorture.c > +++ b/kernel/rcu/rcutorture.c > @@ -3886,7 +3886,9 @@ rcu_torture_init(void) > } > if (fqs_duration < 0) > fqs_duration = 0; > - if (fqs_duration) { > + if (fqs_holdoff < 0) > + fqs_holdoff = 0; > + if (fqs_duration && fqs_holdoff) { > /* Create the fqs thread */ > firsterr = torture_create_kthread(rcu_torture_fqs, NULL, > fqs_task); > -- > 2.17.1 >
On Fri, Nov 03, 2023 at 03:26:39PM +0800, Zqiang wrote: > For rcutorture tests that support fqs operations and set fqs_duration > greater than zero, the fqs_task kthread will be created. but if the > fqs_holdoff is not set, the default value is zero, this cause fqs_task > enter a long-term busy loop and won't voluntarily give up the CPU until > stopped by kthread_stop(). this commit therefore add for fqs_holdoff check > before the fqs_task is created, make sure the fqs_task is created when > the fqs_holdoff is also greater than zero. > > Signed-off-by: Zqiang <qiang.zhang1211@gmail.com> Queued and pushed, thank you! Thanx, Paul ------------------------------------------------------------------------ commit 964f05cdec9f84be006fd836d64d04e79a50cb31 Author: Zqiang <qiang.zhang1211@gmail.com> Date: Fri Nov 3 15:26:39 2023 +0800 rcutorture: Add fqs_holdoff check before fqs_task is created For rcutorture tests on RCU implementations that support force-quiescent-state operations and that set the fqs_duration module parameter greater than zero, the fqs_task kthread will be created. However, if the fqs_holdoff module parameter is not set, then its default value of zero will cause fqs_task enter a long-term busy loop until stopped by kthread_stop(). This commit therefore adds a fqs_holdoff check before the fqs_task is created, making sure that whenever the fqs_task is created, the fqs_holdoff will be greater than zero. Signed-off-by: Zqiang <qiang.zhang1211@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 83999e57b3eaf..9f0e6c1cad443 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -3886,7 +3886,9 @@ rcu_torture_init(void) } if (fqs_duration < 0) fqs_duration = 0; - if (fqs_duration) { + if (fqs_holdoff < 0) + fqs_holdoff = 0; + if (fqs_duration && fqs_holdoff) { /* Create the fqs thread */ firsterr = torture_create_kthread(rcu_torture_fqs, NULL, fqs_task);
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 83999e57b3ea..9f0e6c1cad44 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -3886,7 +3886,9 @@ rcu_torture_init(void) } if (fqs_duration < 0) fqs_duration = 0; - if (fqs_duration) { + if (fqs_holdoff < 0) + fqs_holdoff = 0; + if (fqs_duration && fqs_holdoff) { /* Create the fqs thread */ firsterr = torture_create_kthread(rcu_torture_fqs, NULL, fqs_task);