Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1914639pxj; Wed, 19 May 2021 17:36:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoVYDcf8cxcEY35OfPA2uFAKKpCdb7bAtdffLznNKdGiw0xvR1YxMs+3EfccMJBF+A1W2a X-Received: by 2002:a17:906:2a46:: with SMTP id k6mr1816316eje.406.1621470965804; Wed, 19 May 2021 17:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621470965; cv=none; d=google.com; s=arc-20160816; b=BdwNQkY8Y2sTvQrdh6RNYCSXqos+5vjuUEN32M84GQeTCwB9aw/tKVf5ERLorDkokf 2JP9mJcvp8UjCvywARh6zwzEzHgk4hCFfTfPKnVtsnbRNix7t43lcPqlOyWmcYbP5mOb Wz2L6RybpOL98xsOPsAuD/1AX+MaaQPkeXlSiM6Un+6/rAmFOQrv0CrtMzSAab67salT AvL5upwk8S7u/GYagLNX53qFFeK9FaybVxvsA9lte1wY3XHKtq4GUBwTSpD07Vr61fiD sZ3PYZIIXOL7nZVXnLk06U796baf2ugu9vs07bcwUzA0Iquv5TOba+9dmVEV5W4VI0k1 F7ZQ== 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=hVr+mpnPyp0CtN80czNONpz//EB+R/imqosTgcIcBZA=; b=GYFwizjO5x08bgo1E81hrWnR75XwWcy3oeDHej/3hdD46HfDxr2lgGQa7CDRIYPYlM lgVEuMRRxGSZ7az6EAZsty4ASy/dG3oNMfKBhdNd/ZftbpQbs2OiiqgkxErStQUkaldi iFy1jWkB6PbC6Bm1fNbuyYJIu773nWc7V5vmaJrRzqI0iZC7ggoH2KDMjO1kg4YZSj1J HLXqqa0zNI7RsPWlUOALqONlsBBwv5sYnnYcTYh3ac685feKQ1y43bfQQG5ZND1TlpLg Xnj6GIbXAgVM5Yswa+jDHUWTDIbg/EYFnH/Zwx2J321jQfs6mcPLK0Io+7SpuWfPM/RC OIAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CU4HA4zu; 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 l19si1111813ejq.96.2021.05.19.17.35.39; Wed, 19 May 2021 17:36:05 -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=CU4HA4zu; 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 S229953AbhETAf4 (ORCPT + 99 others); Wed, 19 May 2021 20:35:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:54950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbhETAfz (ORCPT ); Wed, 19 May 2021 20:35:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 414D961184; Thu, 20 May 2021 00:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621470875; bh=vM0rmIZYEhftmpGLJ0wW2b4mTDF87Ea5eJ0DqQxose4=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=CU4HA4zu+Vd0nnf7/w3Ozmn0H87GXQCCPOJc8EZ6YSN2cjDZnheRWF5kf+PagcdRE ZGZg86C08CXOuKrOg2Jm6vx3dJZyK0IEj42hdHXx+L2UNpULV3Q4S5+BorUGvUWR9Q HxmAtMEjY6gN9ZgrudQ9MAVhfZGZtAU/kY7ygEyE37Sg1Tq/oG/2NSSqdERrdIm9S3 1f6RfXz+XcTsntVEhFLK8iFhfva2xT5Arplq98NCqB5vslh6jM/byRzAjndFnEkiXz tcor/N8Ww0qIZj8dnpd3lkS6MTeWsf9i6XFfNNGX36E0PvZP50B7XVmtp9D4JPmJrf G0LcbDSg1tQBA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 11CEE5C0138; Wed, 19 May 2021 17:34:35 -0700 (PDT) Date: Wed, 19 May 2021 17:34:35 -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: <20210520003435.GE4441@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20210519000930.15702-1-frederic@kernel.org> <20210519000930.15702-3-frederic@kernel.org> <20210519155905.GY4441@paulmck-ThinkPad-P17-Gen-1> <20210520002553.GA22836@lothringen> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210520002553.GA22836@lothringen> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 20, 2021 at 02:25:53AM +0200, Frederic Weisbecker wrote: > On Wed, May 19, 2021 at 08:59:05AM -0700, Paul E. McKenney wrote: > > 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? > > Nope, rcu_report_dead() is called from the idle path right before > arch_cpu_idle_dead(). There should be no call to the scheduler until the > CPU comes back online. You are of course correct. I have pulled this one in as well, thank you! Thanx, Paul