Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1235168ybg; Thu, 4 Jun 2020 04:45:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKcCq7Q8nZbXd/v5fdZMomnk3P37MfEJ7Dqoh49js9Y8ehRgqoOFxejUlY/1p7eav/WKjj X-Received: by 2002:a17:906:1558:: with SMTP id c24mr3468960ejd.48.1591271156208; Thu, 04 Jun 2020 04:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591271156; cv=none; d=google.com; s=arc-20160816; b=q00azE/ER6g/O7jybTg6+zay0ANp/dWVCjOB6Dcb0PicVN19wGj/ZXMqfZDBfn8qbn aoIFwLyygR6VpaykblR3k0pKNillal/NUEcbRn9A2LWOjHe0y5PWpkLIO60Gj8+doLkj pKYgSKmlFy8MQfkRgfPm8ireI82h7uogs6x/HvV6wNqUMtVRRxPWFJDAKCX5dWQydL8g x75lsaTsKl+fp9jNy5bUlI6mF0dsYF+7exoYVrSW0AkYqwBBH+Itkl5+pnQ9BxLbXKRj 6wFCB1BXjm5511B8fg+b39bR3RVTQ5ZUBLAhFFCj4/EfJR+1kCIOb1fIps/msGpazRIk 0VtQ== 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=Vm/X+KLy0wMon8udeBWnOdYnPRzOQ2RRcFWyavQcRiE=; b=wLHi3d96Yx2V5Ap/CRvkgpxEdxJv2pLH4cHH3TM+gj1JYgb0TmeuoJaE7RXB4P4ogu pRQ0/P30FZISeqTDJgBCKy8G71gL+NN4D/yRhmxCOVPCFzJ21HJTto2WzpSzAkJmFhHY +ziew7IJ04eDe7cD65h0HiLIQEYWQ7cw+V6F0MVDSikQ2L1R3CqNYzWUMwEa+QyZKWPi K9POoq5qg/5/I9mhQ20FfB8DxCU4eRbcZD6U70AJCbcBdXFhp+JJls0Vt+Mfb06JKTxR CypFTCFo/6dD/68wehzcXO0Lb1pT9mQVfcRoQ0AiACIGp2andORY44wrr8iPd8QmjbO+ 2U5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tlFp+QAK; 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 se27si1412857ejb.340.2020.06.04.04.45.33; Thu, 04 Jun 2020 04:45: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=default header.b=tlFp+QAK; 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 S1728034AbgFDLl3 (ORCPT + 99 others); Thu, 4 Jun 2020 07:41:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:53160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725601AbgFDLlZ (ORCPT ); Thu, 4 Jun 2020 07:41:25 -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 C9131206C3; Thu, 4 Jun 2020 11:41:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591270885; bh=UBKyy2292/Qs7yuV0PzlCmNj9QSdZxTW+WpRv18lofI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tlFp+QAKatXoF1qb5raWmqFj/A1wIzTWq2xphgk6psHrm5QNXvJbWT1adpygeXFK7 MsJhdM+XDyruBZ5vPL145/HNTtn2hTpnsJRK450BKZl6/sCR++8zJ8DdO7UUDuEFvI eL2617YoHicIftXJfMvO+RT8hjyAwPRjue8z+0iU= Date: Thu, 4 Jun 2020 13:41:22 +0200 From: Frederic Weisbecker To: "Paul E. McKenney" Cc: Joel Fernandes , LKML , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Josh Triplett Subject: Re: [PATCH 01/10] rcu: Directly lock rdp->nocb_lock on nocb code entrypoints Message-ID: <20200604114121.GA26398@lenoir> References: <20200513164714.22557-1-frederic@kernel.org> <20200513164714.22557-2-frederic@kernel.org> <20200520122949.GB16672@google.com> <20200522175739.GM2869@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200522175739.GM2869@paulmck-ThinkPad-P72> 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 Fri, May 22, 2020 at 10:57:39AM -0700, Paul E. McKenney wrote: > On Wed, May 20, 2020 at 08:29:49AM -0400, Joel Fernandes wrote: > > Reviewed-by: Joel Fernandes (Google) > > Thank you for looking this over, Joel! > > Is it feasible to make rcu_nocb_lock*() and rcu_nocb_unlock*() "do the > right thing", even when things are changing? If it is feasible, that > would prevent any number of "interesting" copy-pasta and "just now became > common code" bugs down the road. This won't be pretty: locked = rcu_nocb_lock(); rcu_nocb_unlock(locked); And anyway we still want to unconditionally lock on many places, regardless of the offloaded state. I don't know how we could have a magic helper do the unconditional lock on some places and the conditional on others. Also the point of turning the lock helpers into primitives is to make it clearer as to where we really need unconditional locking and where we allow it to be conditional. A gift to reviewers :-) Thanks.