Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1760389pxj; Wed, 19 May 2021 13:17:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx7FfYr2YqoiBp7zaVLR29PFo47AY+oxKVi/tkIfvi3Ms7lIM/B2Wj/acgelo2tSrwGQvv X-Received: by 2002:a05:6402:35c5:: with SMTP id z5mr904943edc.210.1621455423626; Wed, 19 May 2021 13:17:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621455423; cv=none; d=google.com; s=arc-20160816; b=zc3/BPTnAAVRQ8jOYwPmR0ZIw9hrzEnB8/2J5gbSId51V7EFvQzhooE5o/4GhVxX+k qNRGzKqW47msyjsQ/+bc4Ow4x9YCZzlWAf8cfBEOS75gOPbo6ii+oEtqCMd9i/9L+TSe azF4ForalgtH+Z3Dp9WYAinCCbPe9Z8CObH5RBRLCZp74iQiFHp0FHad0nnObQvR4kMp h2GvytKU6Db4yGBgaiT3nEuxskR9LvVrunqbYkxW4sgIcJAUKZIdlNzrbIo82M0DUAep h8KRn49lCNBt7CYdn8iLgCXDs/3iAZTjjdrQQVZZ8VsIIVdLmHznjjddtPOaxb/K2BWl Jorw== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=TDvom+Q6pD3kUtTvBqd8CoHN4AcXWzubtRIoBAmjPTc=; b=kW/vIRTmPH9/W02cbzUnyonCjW06ql2n8rG6J+XJ4Ld07ujelIATaFZlht3Z4fskUY Y4BFM2EEaUBAFQZw3Cfod05ewWxlth0ShcuUAPn14SqV8lSgLJQveZFNshSrjtjU9XPE Vct9CccSZvd27pkuASlsxu54+NvPxC6UwzccpGAhfgCE9iJBfMT+6UAW+M9iZh1flyW+ qtyK4JjyansTx4g8dNIm3VyBedBjYrtViixGRL77Fyg2Bdwh0KYTajW7dhaTkJzZJ2Iv EYWLbgtwXMut4QGUZN3yuimyjpJp9/yV9ZSv/V3gi3/v0Xt6yB8pUOY5ryXbuwNxlgoP vgVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cd9yGhgS; 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 f10si252550edy.212.2021.05.19.13.16.39; Wed, 19 May 2021 13:17:03 -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=Cd9yGhgS; 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 S1355048AbhESQA1 (ORCPT + 99 others); Wed, 19 May 2021 12:00:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:49998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347104AbhESQAZ (ORCPT ); Wed, 19 May 2021 12:00:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1C66660FE6; Wed, 19 May 2021 15:59:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621439946; bh=5QAGP8Jnd/0oosn50Cd3duuJnlkzLqAaJbYaVmj9A/Q=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=Cd9yGhgSKwxswN8HxyCUDIpI3jIoumJm/Ypfd385N/i+zUCUn2iwulDEqsQY9nqxj KtwMoq0ExEHT3h5qpECrSe5WEhhpqH6p9ls6e4dCBcTtOuv4Yta1h4wwdBsJk7pV2q qysyY3DbjOEnYG6XSFM3DG7WOOx4UzNHfd6uGOeGdokL9LYXLGCZzqauum+3VEz3dy Pj2Af9hQbzsVd/np977KCdAxYFbhjJAgDhEBruE3E+H1p9ioeEyxLKI2QPzSdmcviC sPsfVaC60t6ianOpWTJsBZwXc921SsLPHquBi1ifZeLWjsWDAM/WSVZ6CbqZ5FwDoW 1Q5hcgOzPCpIQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id CC8ED5C00D9; Wed, 19 May 2021 08:59:05 -0700 (PDT) Date: Wed, 19 May 2021 08:59:05 -0700 From: "Paul E. McKenney" To: Frederic Weisbecker Cc: LKML , rcu@vger.kernel.org Subject: Re: [PATCH 2/3] rcu/nocb: Remove NOCB deferred wakeup from rcutree_dead_cpu() Message-ID: <20210519155905.GY4441@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20210519000930.15702-1-frederic@kernel.org> <20210519000930.15702-3-frederic@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210519000930.15702-3-frederic@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 19, 2021 at 02:09:29AM +0200, Frederic Weisbecker wrote: > At CPU offline time, we make sure to flush any pending wakeup for the > nocb_gp kthread linked to the outgoing CPU. > > Now we are making sure of that twice: > > 1) From rcu_report_dead() when the outgoing CPU makes the very last > local cleanups by itself before switching offline. > > 2) From rcutree_dead_cpu(). Here the offlining CPU has gone and is truly > now offline. Another CPU takes care of post-portem cleaning up and > check if the offline CPU had pending wakeup. > > Both ways are fine but we have to choose one or the other because we > don't need to repeat that action. Simply benefit from cache locality > and keep only the first solution. But between those two calls, the CPU takes a full pass through the scheduler and heads into the idle loop. What if there is a call_rcu() along the way, and if this was the last online CPU in its rcuog kthread's group of CPUs? Wouldn't that callback be stranded until one of those CPUs came back online? Thanx, Paul > Signed-off-by: Frederic Weisbecker > --- > kernel/rcu/tree.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index 28f1093027b9..a6b448e6e059 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -2469,9 +2469,6 @@ int rcutree_dead_cpu(unsigned int cpu) > WRITE_ONCE(rcu_state.n_online_cpus, rcu_state.n_online_cpus - 1); > /* Adjust any no-longer-needed kthreads. */ > rcu_boost_kthread_setaffinity(rnp, -1); > - /* Do any needed no-CB deferred wakeups from this CPU. */ > - do_nocb_deferred_wakeup(per_cpu_ptr(&rcu_data, cpu)); > - > // Stop-machine done, so allow nohz_full to disable tick. > tick_dep_clear(TICK_DEP_BIT_RCU); > return 0; > -- > 2.25.1 >