Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3012980rdb; Tue, 29 Aug 2023 02:43:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF1KQx611vrwATXyqhliRmO9cND9tFFvoRaKz/i2sO3EnAXPhtV32jayPBzOcsTijdWLr3I X-Received: by 2002:a17:90a:414f:b0:271:a9b2:5162 with SMTP id m15-20020a17090a414f00b00271a9b25162mr2031220pjg.27.1693302181366; Tue, 29 Aug 2023 02:43:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693302181; cv=none; d=google.com; s=arc-20160816; b=OEL9dDd7hsW5/3ciwTIE/5SvL8Roq5TUbvbrX0w0tq0eTSy94hy4o66E5WJ0qmi/VM SCjJKV3vMZZY9zED+ZX/gMwexvxVo6OnO3grl1gVHZoU1pZIZuXrnbtZS3jcRjHHuZdU gZdM0orwkOF2NEHzn2RWrcSbof/JIP93G7gbenqEs3q5MFswpzh32BIYcKQhYdWzJpL+ kjSFw/Htk3BOppvhwjIIoQ8xb1HHdg8WGa4aoVYnaPgpR/5e9HoVwp4ZuorE7m17wqGb spzCHrho/sA/B4rf4sJ+f7aaLbH9APS0BOrnBrEffd9GQ1fyuAPRd8EIA2y3pqDdOl2i YEDw== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=1ag8JXgRz0MVlFmkf2VeZbdKwcG4CyR/vItRfYLZr84=; fh=lgn1ViolKP8KB5Gop5U+EiyEQGnbwyfOnixY+lAWyi8=; b=F0YekCoHk5mub13hU8tuwHPbe9ZolRBsAAhWBZz4UO3+nHvd/O+3ZTsMzcKIwElZ+c ah6OD5ReHEUwybuiN7V90Lsdggsoj53C3rPixm1gICvwFCbMbm4Ba26CMSDDXueMiVmj iuhT0yEfvPY7SeW3taTxWAbUhyn+8ktTS6tyb7omjKqXtK8F68k5Dh/Ds0JI/NmG4aZD vyvh5nwCsfVZaoZzDl/NCyAsl6awlGhaQPqrGUvgmJlgE/mz24crZDH0Tv91dmAX7wS4 tzcB/OkASCVdtWbamK7RfSbXNwi23NQ891x/vO48OySTggPtYOQqAwEYYC/VFRTzsvDV pBsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gPQ9DdWz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z1-20020a17090a7b8100b0025945de4165si436773pjc.141.2023.08.29.02.42.41; Tue, 29 Aug 2023 02:43:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gPQ9DdWz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234657AbjH2JZJ (ORCPT + 99 others); Tue, 29 Aug 2023 05:25:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234715AbjH2JYc (ORCPT ); Tue, 29 Aug 2023 05:24:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65FC412F; Tue, 29 Aug 2023 02:24:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F1FF465293; Tue, 29 Aug 2023 09:24:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0108DC433C8; Tue, 29 Aug 2023 09:24:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693301067; bh=kusXvvvdY8OjEpV+HMrNfp/7EGwgt1unwYM4Lul4vKU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gPQ9DdWzjNt5oSvZl1nQFaQSAtJr1zH1zoI0Lj/fEsd3/d0rdfh+ZZ2fD5K98eruE O+ZPACzU9tblMQ8o9V88rs0lJo4yBA97ylSFoX82syWxQtiPDbRQO9n3QZoaK8DhxL KGDsq0bh3xMy5LD6g/xIBSM3zEAmo7r+4nT45Io8akfYKFxHGM8Qt+QXkUPZsaB/rf XxzW6NG8Mp9JhXAfR3vhCe/OJqRyFCaaAlxAPlch70nhbqkTmcrogUKwWw+xkHYMj/ gK/N6DQmEDXtHHMDaUCX/LZn/6JnWiu8rC93vp8ahuiMjqOFyEU1qhKbZhiX/Q4WQg j7KBJO939+zKQ== Date: Tue, 29 Aug 2023 11:24:24 +0200 From: Frederic Weisbecker To: Joel Fernandes Cc: "Paul E. McKenney" , Z qiang , linux-kernel@vger.kernel.org, rcu@vger.kernel.org Subject: Re: [PATCH] rcutorture: Traverse possible cpu to set maxcpu in rcu_nocb_toggle() Message-ID: References: <16F11103-75C4-4DCE-8272-D619ECAA96BD@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16F11103-75C4-4DCE-8272-D619ECAA96BD@joelfernandes.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 On Mon, Aug 28, 2023 at 05:51:09PM -0400, Joel Fernandes wrote: > I think the issue is the loop later in the function does > not try to toggle cpus that came online too late. > > So it does not test offloading on all CPUs just because max got updated too > late. Right, and therefore for_each_possible_cpu() or for_each_present_cpu() should be fine to iterate since it's ok to try to toggle an offline CPU. > > One fix could be to periodically check in the loop if a new cpu at maxcpu + 1 > ever got onlined. If it did, update the maxcpu. Is it worth the complication though? Thanks. > > Thanks. > > > > > > Thanks.