Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1293514ybg; Thu, 4 Jun 2020 06:15:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+zilkKEOcd1s0AOxvK/MgOX8kui2Ea666K/5lTx3iRBqTm5qPJqnWj76MILm8owjpwAPA X-Received: by 2002:a05:6402:21c2:: with SMTP id bi2mr4211464edb.296.1591276512980; Thu, 04 Jun 2020 06:15:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591276512; cv=none; d=google.com; s=arc-20160816; b=zBd/5jUxmfk+7U68Ji7fHD+m63o4hb5TWwcdnRekanLjx5zkQTBckNHCbWEZZ9XbQ2 a78dbyFZwAl1eMtArxTrWnc9g3AueA9mQNlQVy4Ln+TYGZZ+sPCqGdw6wAR7yKhRyjm/ nCsbth6I80jMAhW1I1MjGyWBCNceGiUBClBIEy8DOEJ8shwStJW55ssgB/n3QAcB56vT zhz/EU4pQJoHsAtOH+IZYheQ8c0G06GpcI6tSb8Qt8RSvHxmwTc4tMgmmAz42R1tZQ/K lPllB6A7tC9I+628E5Kb5sUNHk44OuZiGXE/cPhJQb/29YPSvVV7UsrlQYfEgx4/Muy8 3Z5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qe+nhpcvy6nG5YRNxcTihiRI1k9yXoyUNyii+X6GMjQ=; b=JTmU16HU4DgiSnDXF7eRBgQwl9bnyjJHxa7XlocuBg1dGyUS4dfldYoIjbF5fLwKSi uhTQKv6D29PHDsXwgDHmVIhql/Mg5IT+IKHI2T+qyC+vn1I4SlGf4eGCDlzrpn6UB/uI a+V4kM36uXGKIYTLYYmj8Fok4NjI6kzhHie4cYq1SCqdACAI1oxLPLAy6QogtKQa6Dc1 9SNvKuLvsBqk/aZc26JmakVYH+kJhE5RPx18c8LCfZUGja4017SRK6qPV2Zchne9AvEe eEP6e7qTlYNCqxYqhBDL/wxjfcpbnj+mUL8SpBGCNGoLiwe41wvTmP1K/yGF1zeqxVAS FvQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yEqGvYPW; 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 d23si1565942ejt.618.2020.06.04.06.14.49; Thu, 04 Jun 2020 06:15:12 -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=default header.b=yEqGvYPW; 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 S1728353AbgFDNKd (ORCPT + 99 others); Thu, 4 Jun 2020 09:10:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:58838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727850AbgFDNKd (ORCPT ); Thu, 4 Jun 2020 09:10:33 -0400 Received: from localhost (lfbn-ncy-1-324-171.w83-196.abo.wanadoo.fr [83.196.159.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8FD3D206C3; Thu, 4 Jun 2020 13:10:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591276233; bh=KhaotgH0l//otNB03AB1rir98Xd5bkTWiUjmhQOMhDI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yEqGvYPW0O+EKKbZKW/d8lT7v1yqRUrXjq3TUgL2yQzJiHyRK2O+haCEROS2rOul+ mhWcLqwSXGU2roa3QPGkCwirNqKuePmcz3vd4D3Oq3+0bv6hCpIbGzH11vLv5CrHvw /wSpvi/1EK177OgJlHaemMBV/STgGQAB3MezK9uA= Date: Thu, 4 Jun 2020 15:10:30 +0200 From: Frederic Weisbecker To: Joel Fernandes Cc: "Paul E . McKenney" , LKML , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Josh Triplett Subject: Re: [PATCH 08/10] rcu: Allow to deactivate nocb on a CPU Message-ID: <20200604131029.GA27571@lenoir> References: <20200513164714.22557-1-frederic@kernel.org> <20200513164714.22557-9-frederic@kernel.org> <20200526212017.GE76276@google.com> <20200526224908.GC16672@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200526224908.GC16672@google.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 26, 2020 at 06:49:08PM -0400, Joel Fernandes wrote: > On Tue, May 26, 2020 at 05:20:17PM -0400, Joel Fernandes wrote: > > > > The switch happens on the target with IRQs disabled and rdp->nocb_lock > > > held to avoid races between local callbacks handling and kthread > > > offloaded callbacks handling. > > > nocb_cb kthread is first parked to avoid any future race with > > > concurrent rcu_do_batch() executions. Then the cblist is set to offloaded > > > so that the nocb_gp kthread ignores this rdp. > > > > nit: you mean cblist is set to non-offloaded mode right? > > > > Also, could you clarify better the rcu_barrier bits in the changelog. I know > > there's some issue if the cblist has both offloaded and non-offloaded > > callbacks, but it would be good to clarify this here better IMHO. > > And for archival purposes: rcu_barrier needs excluding here because it is > possible that for a brief period of time, the callback kthread has been > parked to do the mode-switch, and it could be executing a bunch of callbacks > when it was asked to park. > > Meanwhile, more interrupts happen and more callbacks are queued which are now > executing in softirq. This ruins the ordering of callbacks that rcu_barrier > needs. I think in that case the callbacks would still be executed in order. We wait for the kthread to park before switching to softirq callback execution. Initially it was to avoid callback ordering issues but I don't recall exactly which. Maybe it wasn't actually needed. But anyway I'll keep it for the next version where, for a brief period of time, nocb kthread will be able to compete with callback execution in softirq. I'll clarify that in the changelog. Thanks.