Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1926175pxj; Wed, 19 May 2021 17:57:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7zDMaWBlG09sjd4SHeDK5E+iFqDIfc2d8p7/6RNTbiQCswD8TKw+o8bs+VNvwgDwwA1Lu X-Received: by 2002:a50:fb16:: with SMTP id d22mr2043743edq.88.1621472276066; Wed, 19 May 2021 17:57:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621472276; cv=none; d=google.com; s=arc-20160816; b=mUSp8SZmtY8nswxVnWEqxwrjbNc4BwKFGMBlHLn+wkgVfNvV4ZhJnIRkz6EU7nsfu0 QUzMY8jUXGVAmHbdUrsAyLwvGQzQpR8R4bY0krf9Grcwqqd0mFXiUujIi8c6Yod1JXde RhLurnTx2bwm5uRDpElBxWkqizuRPvHnUIiS1Tc0KfApRs00YQgmBxMgBt9mH+gD/QFo ocsR0yjlhWKSBUKHHKU5q74FteOqlQEkfMCdMFxLma1dKigic7dhef2URdVZpViPKqN7 XvZAT8QamfJjrMPllLha+hIHl3Itz3o+iF/eaOE8ODDqBgwWc1F2Rmp+SHxEcoN8LfT3 6UsQ== 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=nhDmRxInOFYfN8ZGVHYhB53SayegE83YUVD0WDC62tI=; b=gQ8bc7FWVXgKaSib7FSecn5y7S25zAABPJcjhbZQeNtqDTH/2qSk7bYZe5QtBAIc4w wWHHWBncjU3AY/3WUmtaWU3XtGoflmP23a3OBiJEW4hcd7KCCMtShBgkmaKAr4bTZRlo oMO/9Y4y0QDQBrM9sUl2yqHMlv9EtHdqadd4uk6kRHdb2v07Hz+3yNoXc8PwqH2NAj8f lhzUiCTPZu3+c1U93sQ7EcVYAjCRhJDzC7dos2gU3N0CQgOYimmt1m2mdCVtZgLT6xa1 BH1wCQkvVRxM+5MwqbLUYL64O+wNQz4Y/HVIKJJiyCXT9Nmqu/rGZn6X74DJBpiEhExJ WAbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZcPXE4oJ; 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 gt10si1178892ejc.392.2021.05.19.17.57.31; Wed, 19 May 2021 17:57:56 -0700 (PDT) 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=ZcPXE4oJ; 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 S230123AbhETAzt (ORCPT + 99 others); Wed, 19 May 2021 20:55:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:57428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbhETAzt (ORCPT ); Wed, 19 May 2021 20:55:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 862E66112F; Thu, 20 May 2021 00:54:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621472069; bh=hjBeTHSzYWy9v1O+Drq6tKItvMTUDsuzqft2T93yh/8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZcPXE4oJCXN8wUgdzQCnvMIF14P6mGM1yvqwN34pV2v0+RfT4UHLYYUBvDwxwqJEf lurNjwszb5qyPQCXqVnwi+nTX7Q1r/Aj2j7EywjdejDiRvXVUXHfDqScA39jsS7fVw Ch94wTg81i64g7V7otRDUMtU18QgPnkZ6I1naxgF77TMZcfQ+dmlZ16TRFTy/a4pFB pMjmlrRSpnhFdigfh7w1D5zhAmEz01UHcVmmZtlABnkKhxWwMnYoWDYqbaiKBVV5OL TjnnplvzU/MzCNLrXcI+vti2L6YSWDIbehfwZgJFmk+5SVZMWlCnPGJJjOdsKdUxg/ U7vGhA8HuFs2w== Date: Thu, 20 May 2021 02:54:26 +0200 From: Frederic Weisbecker To: "Paul E. McKenney" Cc: LKML , rcu@vger.kernel.org Subject: Re: [PATCH 3/3] rcu: Assume rcu_report_dead() always deals with local CPU Message-ID: <20210520005426.GB22836@lothringen> References: <20210519000930.15702-1-frederic@kernel.org> <20210519000930.15702-4-frederic@kernel.org> <20210519185107.GB4441@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210519185107.GB4441@paulmck-ThinkPad-P17-Gen-1> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 19, 2021 at 11:51:07AM -0700, Paul E. McKenney wrote: > On Wed, May 19, 2021 at 02:09:30AM +0200, Frederic Weisbecker wrote: > > rcu_report_dead() is always called locally from the idle path. Passing > > a CPU number to it suggests otherwise and is rather error-prone as the > > code inside relies on locality. > > > > Robustify the function prototype and refine the name along the way. > > > > Signed-off-by: Frederic Weisbecker > > Makes a lot of sense, thank you! > > On the function name, here is the list: > > int rcutree_prepare_cpu(unsigned int cpu) -- notifier from any CPU. > void rcu_cpu_starting(unsigned int cpu) -- direct call on incoming CPU. > int rcutree_online_cpu(unsigned int cpu) -- notifier from any CPU. > > int rcutree_offline_cpu(unsigned int cpu) -- notifier from any CPU. > void rcu_report_dead(unsigned int cpu) -- direct call on outgoing CPU. > void rcutree_migrate_callbacks(int cpu) -- direct call from surviving CPU. > int rcutree_dead_cpu(unsigned int cpu) -- notifier from any CPU. > > Note that rcu_report_dead() can also be invoked from cpu_die_early() on > other CPU when onlining a CPU fails. This happens on arm64. Which might > be an arm64 bug, but unless I am missing something it is a case where > rcu_report_dead() is called non-locally. Hmm, I see it only called with smp_processor_id() from cpu_die_early(). > > And the naming is currently a bit random, isn't it? :-/ > > Maybe rcutree_*_cpu() if there is a CPU parameter and rcutree_*_self() > if all calls run on the CPU in question? Makes sense. Or rcutree_*_curr_cpu() but it's going to produce long names. > I cannot immediately think of a reason to make names reflect whether > the corresponding functions are directly called or are called via notifier. > Thoughts? No indeed, let's wait for some convention to ever emerge :) Thanks!