Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp79611rdg; Tue, 10 Oct 2023 05:02:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFM6sPhindS7AUAz4NOKnMoqF7+QiRHBFD7hPpyCvAjtWSIF+vT+vmEUFVWLe7fjuOcETmr X-Received: by 2002:a17:902:d485:b0:1c8:791c:d782 with SMTP id c5-20020a170902d48500b001c8791cd782mr17178072plg.29.1696939341309; Tue, 10 Oct 2023 05:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696939341; cv=none; d=google.com; s=arc-20160816; b=mNRhb13QYwEsUpso5OOAt3T974w/D0o3jeqyr4OZqNmCUZfAvxE2ILk38RcoLQUf59 n+0KQeI28E+ylVK2VpGKatcvr4jt7Kxbz933n0wSmdeWVAF6Xt6NGp5Va3X7HtuB8lBR Kq9BDf6U89UOWAq72Qs0X8X4jvd1olbgPOOuywu0bNNiC0OhvmptGY0RIGiImU7axSaB FFKOwfXVVwsuej391AFUFRqwHsObVJML8tJV0ls+dHzYd+9i+tCPvdDY7jbciNuqyrFo 4BmcXDmY+uKYy80qon+iyZBCUoewcD70fBS8szof9F5eTgshYIv/y2z4u5ze5bfQKlDr DEuQ== 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=9xGiSdtWzBexzPJrd0Huh3kYqFOzXy1aOjKCkgs9W5c=; fh=kZAMmQ7GunejCIEFj6gestrsMKMJ39cNhWmhF5tVphc=; b=J1Y5pbGKNkz5Ebq0+TRhZT5YajwMeD6SQH8CY3QYNOvdonsehWXFqF1aDVgBr6CAE/ Yz2Ax6aUFPsMO6g2bIPfPH0QouviyBFXf90ygK+8/rE1bUOUZulhvKra+iF68ir63cFo IHT4rOOKspljg0bOq6IWbutZuxPQEsxzOzy4+tefJIPe1+vuq7bfBh15iyztrLJH6ZQX vYdastMOm7YDIIxJrNGBW5X3R3yknlAwewO6KkR1VxsTW+y/07+V+EBcZRRaiQiUuLAm GymEp4yxxzPukpaBZ0Pi6+sFwm1bxg8pDX/Ek63+Lz7rVPq3KYfAOcVJQvQAwlA1a/Ua LdBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SevFf07q; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id u16-20020a170902e5d000b001b8a3e851d2si12498250plf.342.2023.10.10.05.02.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 05:02:21 -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=@kernel.org header.s=k20201202 header.b=SevFf07q; 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=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2170F8166893; Tue, 10 Oct 2023 05:01:50 -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 S231605AbjJJMBr (ORCPT + 99 others); Tue, 10 Oct 2023 08:01:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231871AbjJJMBP (ORCPT ); Tue, 10 Oct 2023 08:01:15 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A049183; Tue, 10 Oct 2023 05:00:33 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E92AC433C8; Tue, 10 Oct 2023 12:00:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696939232; bh=WjajcRSI0f6RpjQNiJdpi/EFUKeHV3KUSmO6ZEPHXJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SevFf07qfzV2qTiFE9fXw9e6IR+4fkyxBlhySJCNXIhwT4PZBAqNrh4SUOD0tLRUD /ZF7HtUlGMz4rFj2HbfuY6MkDOIClndbUOS2oycNRsFLfpWdMx5fOc6Z9/OcueeNth Q9A/nLfYQBHa27C1KPuOjzp1yo/ncLqTEXc35E1u8LQAEXSwQDMuOPpO8shZYMPIQa PelcEAmuHe8MKOLrM7TUPmV+cOExoWLSwZ/pVJ4ZYutDkn8OITZ5VPZsfuE3wcVU9l dZ+p7DFDqpuglf63lcFh2RihU3zgf/3V7mnpFe1cYOC7vGZEUW6b8iS7M3Tz+fMXii Oau8KEtqgbaXQ== From: Frederic Weisbecker To: LKML Cc: Zqiang , Boqun Feng , Joel Fernandes , Josh Triplett , Mathieu Desnoyers , Neeraj Upadhyay , "Paul E . McKenney" , Steven Rostedt , Uladzislau Rezki , rcu , Frederic Weisbecker Subject: [PATCH 21/23] rcutorture: Traverse possible cpu to set maxcpu in rcu_nocb_toggle() Date: Tue, 10 Oct 2023 13:59:19 +0200 Message-Id: <20231010115921.988766-22-frederic@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231010115921.988766-1-frederic@kernel.org> References: <20231010115921.988766-1-frederic@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 10 Oct 2023 05:01:50 -0700 (PDT) From: Zqiang Currently, the maxcpu is set by traversing online CPUs, however, if the rcutorture.onoff_holdoff is set zero and onoff_interval is set non-zero, and the some CPUs with larger cpuid has been offline before setting maxcpu, for these CPUs, even if they are online again, also cannot be offload or deoffload. This can result in rcutorture attempting to (de-)offload CPUs that have never been online, but the (de-)offload code handles this. This commit therefore use for_each_possible_cpu() instead of for_each_online_cpu() in rcu_nocb_toggle(). Signed-off-by: Zqiang Reviewed-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker --- 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 8136fec0310b..b17ad45cd67e 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -2126,7 +2126,7 @@ static int rcu_nocb_toggle(void *arg) VERBOSE_TOROUT_STRING("rcu_nocb_toggle task started"); while (!rcu_inkernel_boot_has_ended()) schedule_timeout_interruptible(HZ / 10); - for_each_online_cpu(cpu) + for_each_possible_cpu(cpu) maxcpu = cpu; WARN_ON(maxcpu < 0); if (toggle_interval > ULONG_MAX) -- 2.34.1