Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp762791rdf; Fri, 3 Nov 2023 14:33:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHutr47+9s74FfVPUjOiT06kfuHTg1jvnKu/WF/Rfx8XWC3bWy0/NIGoKWPSCpZsEV4JGr2 X-Received: by 2002:aa7:d613:0:b0:533:9df5:ede with SMTP id c19-20020aa7d613000000b005339df50edemr18938458edr.14.1699047201148; Fri, 03 Nov 2023 14:33:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699047201; cv=none; d=google.com; s=arc-20160816; b=M5D25PgZiNLETNpkEaO5ICPho78uxjBIKNDQNtFHyGyQOGkRoShvWEC+4qW6iZAl13 QENRXX34gYcix3UC+Irt79QH0csfi/3umqPtl18o2GQ8mKw2BmYvvEE4FJqkO112Pg7p h7oXGiOrJ0RlKY9G/et2LmG6cge34NenPjFwCQhSVOjueLwJydaVx/GRexWuGvM35sKz tP+f/uoFGL4WtBjbY2abbyZ++ynBPpba+po6PwwgiR9UwC1FbY9GAgYmpN071kY0PfqV f1GW0GUGDM78rZiwx+XFxJ+mut5K9U2rDK3ZqQSdrdyCHgkXesRvZqGULJd2ToH3wi01 lZ4w== 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-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=YYcmeoK++8C0QLGJRmYGS9SEOXM0x9ZrZS6KtRAee1k=; fh=SnZiMPaL5ubWGwPwHf96K25quhlJoUdbQrPjgmp11aY=; b=Czm4qnCkAbSeDC6tS6ZqQvjLSojXzOPbu7GFH6+wGzUPkoAeZj0daSXwHp/S4pi2N+ SAQClzrFTOC5E0aHsdD94xDY0ImI+p5NU2U4oGp8g0c+8OgEzhCRw19Q6z+RTfAylzIJ MrebqalaGSAVjyVunlavBHXQJaBYDWJcKBVDGhRICHtA27m4dGZMfzd7HaUbKXLhkDNr MRFK1Nra1zhRadgJvv0yCt2iFCxcx6C32pf6kNxNs7Y9dV8TGZn26ejaRqIRc9t9JVbv yY6tKBT2i5tmnespagmYy37hYjdRfXljVkW57LtDMqR+djeFhVeiHofdQo7qPMmUaYKY l3ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MRo4zvTl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id r19-20020a50d693000000b0053e2efecfebsi1357441edi.35.2023.11.03.14.33.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 14:33:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MRo4zvTl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 481EA8290983; Fri, 3 Nov 2023 14:33:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232251AbjKCVdI (ORCPT + 99 others); Fri, 3 Nov 2023 17:33:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230273AbjKCVdH (ORCPT ); Fri, 3 Nov 2023 17:33:07 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 995F11A8; Fri, 3 Nov 2023 14:33:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97329C433C9; Fri, 3 Nov 2023 21:13:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699045991; bh=+Igi/lFwr57gBQvQdonrHcdpinPyg9JShPR8XF/aqCY=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=MRo4zvTlhjpcwyhHiYMFbi3T+LMghihO8qW21zwDiKZAKHv/+4W9hEuAR2GlPmbQK 2iVtRSvMrf5Q0E98DyQ5v8rPiPJL22ISoCr+dQnkH9NSVH7ASDOCyYdwVWQ1rOVgVX m+RG+oQpvS081h5YIo52yqXQ3zKANORoiqXqeBeUC8Y7OkLgjLOGcUcN0vKyy1VK3V 6IkSTbWYuWDMgwdvOJxruUGk+f5r6JidYzlQMoCGdNmh9UEGfxZT7NawE5J9BaLLl6 +5RqzeKT5FtKf+d4qDu2e/SmJrI4Bq77fP1u5FtqJTgngykwvZCIUH/mq2uAchS8ly r8xvtnFi9BW5Q== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 359F6CE0E17; Fri, 3 Nov 2023 14:13:11 -0700 (PDT) Date: Fri, 3 Nov 2023 14:13:11 -0700 From: "Paul E. McKenney" To: Zqiang Cc: frederic@kernel.org, joel@joelfernandes.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcutorture: Add fqs_holdoff check before the fqs_task is created Message-ID: Reply-To: paulmck@kernel.org References: <20231103072639.11426-1-qiang.zhang1211@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231103072639.11426-1-qiang.zhang1211@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Fri, 03 Nov 2023 14:33:17 -0700 (PDT) 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 Queued and pushed, thank you! Thanx, Paul ------------------------------------------------------------------------ commit 964f05cdec9f84be006fd836d64d04e79a50cb31 Author: Zqiang 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 Signed-off-by: Paul E. McKenney 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);