Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp827438pxb; Tue, 9 Nov 2021 00:27:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfl0szXn57Lf5cmceZpwUIfutXLbUEFBR2rBCk+tx6wlP9OeiBe0R4lNiOfMulP0E6PrPA X-Received: by 2002:a17:906:dc91:: with SMTP id cs17mr7295058ejc.461.1636446437774; Tue, 09 Nov 2021 00:27:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636446437; cv=none; d=google.com; s=arc-20160816; b=mowMFSaejyV1osG6YslgTdCthalGt+Tymt7SiHKcZhB7rEN7mRp2N0OFGN4CkYFQEG x/zH5LqGxq4ODb6Hy0qxcbdUIQIiQF+FA66A6Mfq6ctl5vXGjq6cg3AtC5Bs9Pz7K1+5 9mKVU2h512alUU0aTBrjFsiMbcaUa70QtXnvrdJlxkh2KVihNKsauQDrQ2ovZMS3tD7i V1322nuz4gUOobWgBxOxcR7jx/x/2F5rKcJapBYK7MaEkklimCrnBKHlUBe+qS0m7WwO iWWuGAHNKABOjEdKOtplG8m0EZO+8LgekGrYbMJCTXfETjVMD7fYW3xMpU+/6kxKY/tl okFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JPI3i+AnHWOa2SYonqP98ZLRjCSPY9IJQjtRDpe6INc=; b=xZCHuE5ib/KsKcjklqqCmMdAar0Cw+/8XtFiJ3gg5xFBjosBHWDSf105D/VFhdLyv3 A1rmQEhJgLNIGMNtMO28ENo9eiClyAvep/uLkrsRnfdlIfPT/CdEsQCKZvvCW6ZpbgyP WoU6x3wMHTXc2FJJt1E3k7MTb25Wzdm2CKNSYIWfSK/jpHhZ5RTmVJCio1YtDo0d3PoB NnsD9IuApeKHDWYlUKzTUFFtvdw17UAScBU1IINiIuC58VUh8dyRvcMdSlqnDnqA41ee BkQ9tEzuoYEyTah8bP6bDTLAoLcBiV8UnkkIZBJ+iwyvkuoF8qlKTil8V2ufNVTDKsdZ 7n6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fp6mP8wT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w19si39917858edc.336.2021.11.09.00.26.52; Tue, 09 Nov 2021 00:27:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fp6mP8wT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S241598AbhKIBDP (ORCPT + 99 others); Mon, 8 Nov 2021 20:03:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:59326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241535AbhKIBC6 (ORCPT ); Mon, 8 Nov 2021 20:02:58 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6685561279; Tue, 9 Nov 2021 01:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636419613; bh=RQZBkuTCNLkgmDs2BnOgeIkiEzrKkRq/yceimv6O7wQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fp6mP8wT/ywk6UCHoVwwGPi3EDAHt0WcP8gNjRz63LorV9YWeCh8WSIdnf+RTqJSX 3mthuRzMOh56ZBW++52cu5KnPj9NGngymppxSUhisqyY2Cff56vW8WTWx4aK/SkX8W XXgjSo5obyWid5UiFeiE3pwGAvYKF4odo2Jo4Q/ROeZ+R7DVJx8vNeXlX4KtAiIg64 /ALz+2C1Ad7sg95+vKYcG6SQ1GRB10ADnZXmMel7QobQQu2c2MI4/6UsPCRm9Aiypl Q80NgZPJynBxlu18gmQWHYdm0hnzR1qhqTED4BlD68H2rMDYR1nV0UmGxrFSte0EB/ 1p4aZdCeXVZmg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Paul E. McKenney" , Neeraj Upadhyay , Sasha Levin , josh@joshtriplett.org, rcu@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 017/146] rcu-tasks: Move RTGS_WAIT_CBS to beginning of rcu_tasks_kthread() loop Date: Mon, 8 Nov 2021 12:42:44 -0500 Message-Id: <20211108174453.1187052-17-sashal@kernel.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108174453.1187052-1-sashal@kernel.org> References: <20211108174453.1187052-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Paul E. McKenney" [ Upstream commit 0db7c32ad3160ae06f497d48a74bd46a2a35e6bf ] Early in debugging, it made some sense to differentiate the first iteration from subsequent iterations, but now this just causes confusion. This commit therefore moves the "set_tasks_gp_state(rtp, RTGS_WAIT_CBS)" statement to the beginning of the "for" loop in rcu_tasks_kthread(). Reported-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney Signed-off-by: Sasha Levin --- kernel/rcu/tasks.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index 806160c44b172..6591914af4864 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -197,6 +197,7 @@ static int __noreturn rcu_tasks_kthread(void *arg) * This loop is terminated by the system going down. ;-) */ for (;;) { + set_tasks_gp_state(rtp, RTGS_WAIT_CBS); /* Pick up any new callbacks. */ raw_spin_lock_irqsave(&rtp->cbs_lock, flags); @@ -236,8 +237,6 @@ static int __noreturn rcu_tasks_kthread(void *arg) } /* Paranoid sleep to keep this from entering a tight loop */ schedule_timeout_idle(rtp->gp_sleep); - - set_tasks_gp_state(rtp, RTGS_WAIT_CBS); } } -- 2.33.0