Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3511638lqp; Tue, 26 Mar 2024 11:03:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUovQ1loPMePcyNIRejFbZUDMiSRMDtd/4Wjmqzg7F6ZDNCDhVwU7W0nrMNHUB0+zFHi+0MYwQ5ZHZrFUQ+Kivrjkezh2nSDplBtbEIBg== X-Google-Smtp-Source: AGHT+IHAlH6/3czw4m25eGOTMpyXlTSuOEpNv38AbQyK6MOuyyUXX+QRLiJczLrFdr0Wd6lwmWUl X-Received: by 2002:a05:6214:e6c:b0:690:b3a3:2261 with SMTP id jz12-20020a0562140e6c00b00690b3a32261mr1874539qvb.53.1711476193955; Tue, 26 Mar 2024 11:03:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711476193; cv=pass; d=google.com; s=arc-20160816; b=X6pUF2VbN/pLJWAWj21yewTI39LqDdymdSesQKtf/H1hyoGd5DCMWPIl6LYku6smDV 7+UrvM4sAbzbuQy3+NYCXuxWNa79thuJwde4qUY4xrPqkx00GnQ3bT0o8XPoDiacGqG+ LuTRPdCkjpwuNQBmXrZg/EbJDr/fMTGa3J0V1h32rUmwjtE4ImGl+cYj9oztiNzVbEUk 5lb+I3SS1b4IhVfLN1UkNXQeb+qX4yFGMyhx6bz0KFROAcQ6RlMjexCZP8MpUm098ex/ 33Cpkqlqkat5iVs9Qx1Vo8aaDPTQMqMPlB4ua1P2Dcgx+x7NactSTcVmv6QI7p80CIvJ OEdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=8OXCZQPVqmi3DuXYk1Bz1xQLhB5ELKrgndmmKgLdetQ=; fh=WCLPHHe9biV/2Xz3UvWPS48CcQrIiFvdTYcyjizavVU=; b=qHCQNO5h0zy2RBnwh2j0//IOf6Eqj/KzR/HPHjzUZK3iAppmL7wml+TzuQ/JZkuuOI tW9IfPj3yCqY9xitzXEIjKwvtLFBqdEVotuhxunO6uDA9OCtMjapr1nckW9DEF5ci9HE ggfJNZf/swLj+o8K+CQPiQ5aEomGLt33ZwYbScNdAl4viRwJhpoJAWHwFjjD81uBH99d EVAJaf3NzglmwIyFWM2HVlZk70BpjL+aQjJo4DSwT9VRfD06Eb2CHc+uKMiyF4j+ddlY XbN3CG84Uc595UQa2um4n87RU87yvWs5NFie23f+vFjGWWHzCddk6VFTx0PtBh/JlukW pSww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fS3m6FJy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-119642-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119642-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s6-20020a0562140ca600b006968b731f34si833410qvs.108.2024.03.26.11.03.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 11:03:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119642-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fS3m6FJy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-119642-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119642-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A8D7A1C270F3 for ; Tue, 26 Mar 2024 18:03:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7F2D24CE09; Tue, 26 Mar 2024 18:03:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fS3m6FJy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B1C51B28D; Tue, 26 Mar 2024 18:03:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711476186; cv=none; b=EyBMCxb1h800IHvA7vNcnSEw3gC05ouKvuE6HASKSadhmA3yzwNPFGeaNpgzJYSB260uWwEvtyf1KfVD/W1bMqd2BmtyyVmAkB38NKwT70o8TYhRBDj/wo0zX3RUuwxAvI3rmTqWwxYYxm82d57PdEr34P4qQLKD1ycKwcbydJ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711476186; c=relaxed/simple; bh=ECUAAK2Nxs/H86gKiGl0W7txBlcNCaLixR40Qr44fhw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dmJycO8c0psMX4DloXSm20+Q7kdsfKv9Ejf2qE1eN+qVabKPrCP0HMN8j6+zd3zgk4m2Opx9J5puGjwtHIn22dFOYi2zKQQJId5HXkrWEHLW2ouT2f3zf643kGsL+yOk9d6LKDzVptmHZYuJBrvXDsMxl2sumoh9DRkB7aKJQ5A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fS3m6FJy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0809AC433F1; Tue, 26 Mar 2024 18:03:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711476186; bh=ECUAAK2Nxs/H86gKiGl0W7txBlcNCaLixR40Qr44fhw=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=fS3m6FJyJInIyCiPC6QB1VIvgS6KX+/WPWDbPUOcKZXnmBogEmK1ve+rdUv4vSDR+ OB34KGOHPcZHA9ZtwUKytXgL8JueBGM0UCMj9M/LtR2gANZS4kMJyB0x+ejQUVjE2W lTR18/+tR8TF1YCb0qp8ArWu4rQHgpcFlR6+xoI6z1nqWz955cvJQMG1CaI3Y3we5P Gx6MX2z1DET9n9ahwbYHZGDb0AQxpqQfgUZv7ObzDlNGUoKjqYs3pMzZWYcWmkxmIB ebK9jPjLy+kepfmgAmHHq/e8Oa9j1UtySl7x6xtnx9hf2lDek0rZTg0EQ5BbTJNwLA NJ+hnc3Rx2jWw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 60DF4CE129B; Tue, 26 Mar 2024 11:03:05 -0700 (PDT) Date: Tue, 26 Mar 2024 11:03:05 -0700 From: "Paul E. McKenney" To: Zqiang Cc: frederic@kernel.org, neeraj.upadhyay@kernel.org, joel@joelfernandes.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcutorture: Make stall-tasks directly exit when rcutorture tests end Message-ID: Reply-To: paulmck@kernel.org References: <20240321082850.1756-1-qiang.zhang1211@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240321082850.1756-1-qiang.zhang1211@gmail.com> On Thu, Mar 21, 2024 at 04:28:50PM +0800, Zqiang wrote: > When the rcutorture tests start to exit, the rcu_torture_cleanup() is > invoked to stop kthreads and release resources, if the stall-task > kthreads exist, cpu-stall has started and the rcutorture.stall_cpu > is set to a larger value, the rcu_torture_cleanup() will be blocked > for a long time and the hung-task may occur, this commit therefore > add kthread_should_stop() to the loop of cpu-stall operation, when > rcutorture tests ends, no need to wait for cpu-stall to end, exit > directly. > > Signed-off-by: Zqiang Good eyes! Queued for testing and further review, thank you! Thanx, Paul > --- > kernel/rcu/rcutorture.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c > index 3f9c3766f52b..6a3cd6ed8b25 100644 > --- a/kernel/rcu/rcutorture.c > +++ b/kernel/rcu/rcutorture.c > @@ -2490,7 +2490,7 @@ static int rcu_torture_stall(void *args) > pr_alert("%s start on CPU %d.\n", > __func__, raw_smp_processor_id()); > while (ULONG_CMP_LT((unsigned long)ktime_get_seconds(), > - stop_at)) > + stop_at) && !kthread_should_stop()) > if (stall_cpu_block) { > #ifdef CONFIG_PREEMPTION > preempt_schedule(); > -- > 2.17.1 >