From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA806C55185 for ; Wed, 22 Apr 2020 16:35:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94484214AF for ; Wed, 22 Apr 2020 16:35:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587573328; bh=jNZ2XblufIpi0vrQzSBu5BVc515uZDw+8pgopuJbjq8=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:List-ID: From; b=U+d9eWCEP5bhequlgM4fLLtPc8HgPmAv4sFFQqFhei1XX/9iRLqaMrK1neLeD+1Fs oyB5dfMC8EzFA77vXiUbqZ3F7RT85jRpGDmvA4WKRXWD+zzsdO+forxiNWXYaACGsW ipB6QSorm5yYmCcwH3vc2bbRLqSMg+QvnIP05sDI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726183AbgDVQf2 (ORCPT ); Wed, 22 Apr 2020 12:35:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:45856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725808AbgDVQf2 (ORCPT ); Wed, 22 Apr 2020 12:35:28 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (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 81D0B21473; Wed, 22 Apr 2020 16:35:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587573327; bh=jNZ2XblufIpi0vrQzSBu5BVc515uZDw+8pgopuJbjq8=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=alOkchklRnymEIyIKpApxaNR8jU3NTKJwj1KPMcgHdHZU67xdXTcwOS2lvR7b4S9+ Zw2GCbfKryj2fSN+tHZuEcN3vf/U6G6BgKPBu7kg0nOyL/elWIOySnFDxzQLVI/R9R PPVCfFMtSESPlxIiAahiR7H+04OZKkq54WkdT0Oc= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 60AF13520480; Wed, 22 Apr 2020 09:35:27 -0700 (PDT) Date: Wed, 22 Apr 2020 09:35:27 -0700 From: "Paul E. McKenney" To: Sebastian Andrzej Siewior Cc: Uladzislau Rezki , joel@joelfernandes.org, Steven Rostedt , rcu@vger.kernel.org, Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Thomas Gleixner , Mike Galbraith Subject: Re: [PATCH 1/3] rcu: Use static initializer for krc.lock Message-ID: <20200422163527.GZ17661@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200420172126.GG17661@paulmck-ThinkPad-P72> <20200420174019.GB12196@pc636> <20200421133947.cmdchrx73ru7szuz@linutronix.de> <20200421154101.GN17661@paulmck-ThinkPad-P72> <20200421170556.lvgb6gtjivjbr7gl@linutronix.de> <20200421180914.GT17661@paulmck-ThinkPad-P72> <20200422111324.cummbkw2faxoeaxk@linutronix.de> <20200422133346.GN17661@paulmck-ThinkPad-P72> <20200422154625.ub6xu5udlhtxsqdc@linutronix.de> <20200422161955.GY17661@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200422161955.GY17661@paulmck-ThinkPad-P72> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: rcu-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org On Wed, Apr 22, 2020 at 09:19:55AM -0700, Paul E. McKenney wrote: > On Wed, Apr 22, 2020 at 05:46:25PM +0200, Sebastian Andrzej Siewior wrote: > > On 2020-04-22 06:33:46 [-0700], Paul E. McKenney wrote: > > > On Wed, Apr 22, 2020 at 01:13:24PM +0200, Sebastian Andrzej Siewior wrote: > > > > On 2020-04-21 11:09:14 [-0700], Paul E. McKenney wrote: > > > > > > Yes but why do we do this raw_spinlock_t here? It is not yet needed on > > > > > > v5.6-RT as I *did* check. It also complicates the code for !RT but > > > > > > nobody responded to that part but… > > > > > > > > > > I did respond by pointing out that the essentially similar call_rcu() > > > > > function ends up being invoked pretty much everywhere, including early > > > > > boot before rcu_init() has been invoked. It is therefore only reasonable > > > > > to assume that there will be a need for kfree_rcu() to tolerate a similar > > > > > range of calling contexts. > > > > > > > > Early in the boot we have IRQs disabled but also one CPU and no > > > > scheduling. That means that not a single lock is contained. > > > > > > You are saying that call_rcu() is never invoked while holding a raw > > > spinlock? > > > > I didn't say that. I said if you use spin_lock() with interrupts > > disabled *but* early in the boot process (without the scheduler active) > > then it is okay. > > This was a response to your "including early boot before …". > > But since you ask: On top of my head I know that > > task_struct is released via RCU by the scheduler in a preempt-disabled > > section. We have a similar workaround for the mm struct. So yes, we have > > at the very least those two. In case your question is "Why can call_srcu() be restricted but not kfree_rcu()", the answer is that call_srcu() has all of five call sites outside of rcutorture and friends. So this restriction is much more likely to stick for call_srcu() than for kfree_rcu(). Thanx, Paul > > > Fair enough, and thank you for checking! > > > > > > The other work-queuing operations are also OK as they are, then? > > > > yes. > > Very good, and again, thank you! > > Thanx, Paul