Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp265851ybm; Tue, 26 May 2020 16:25:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypO2jVwJp+CydeQmr3VQOIEVu1EutbflKpYkZxEkaRtXqM5JJjt1BuEmGFDbrRRq0CN6xO X-Received: by 2002:a17:906:f74c:: with SMTP id jp12mr3314665ejb.490.1590535512507; Tue, 26 May 2020 16:25:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590535512; cv=none; d=google.com; s=arc-20160816; b=BLixGXXo6YkOLne+MbdQk2zs7EF1J8NNO/9OUz8p7Pb8O6yfFje38FVtGymPZchdwk zJhw4YFUONAKmR2rcukuyxOhkStKl2duVUK2SHWJ/0wK/Cx/mVWOHHDJnGiKMXjDcfN8 Wg2j/Hl4VhMqCTTpwtGRtDoZtFxjHPYCiXL851BCTBlPi7KSK1QkPK/iYixpHjSc3szR JIxH6Hp3HJtUVdLIDGubJNMk0mhhKfSsHDQwEEn8rKNSJMIfi4XeHTO3klUvH3J6YdqC ODkLAHaj0RUmTIgm5cAdGUAp1zejiH7nQwr7rjPTTJuLw2tv8z0RxQxZcJqPLuvtybM3 8PPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=sWN+w1Fv4bIYBummlgoeyT/3ykM1S7qQr4+u580L+X0=; b=tGGj5cVY+G0lonaIAJ80azk5vCSoQnXcsjjeinR/A0y0nwp3Kgv355PQpFLTId6BSS n1r3T5nchyypLTyeIybWAP2cGRXJeqw48FGoWZE8qQKIHCpvtWgDLxOCkseYM1H5cEIc SGEQh5pSVnWnUmX3U8qQr+B6a6aF2smUFy7IcSR07pDYgJlbbd+quYey0HBrVln93ttP B0Lyw1M9OHsIScuk2aj07ZtPhCPM+BoS+02/+qNCwuQDmWJB8VS/t1GLGse8wHy3+qcZ DYDvNmHYx6O+fmS1tr2xwU47z3b/lB3gcbOdnh171kyBcrQZV4WwMy+d5pB/GFfyeZLX Mrgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=KRRoEtMW; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r20si723315edp.75.2020.05.26.16.24.49; Tue, 26 May 2020 16:25: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=@joelfernandes.org header.s=google header.b=KRRoEtMW; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390025AbgEZT7c (ORCPT + 99 others); Tue, 26 May 2020 15:59:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389192AbgEZT7a (ORCPT ); Tue, 26 May 2020 15:59:30 -0400 Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B6F6C03E96D for ; Tue, 26 May 2020 12:59:30 -0700 (PDT) Received: by mail-qv1-xf41.google.com with SMTP id p4so10056346qvr.10 for ; Tue, 26 May 2020 12:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=sWN+w1Fv4bIYBummlgoeyT/3ykM1S7qQr4+u580L+X0=; b=KRRoEtMWfjI5kcAmoTD3JZh7J4HE099FLTDx4GRXexZUZUiTMxsmztMFd8puPj037Y GU3FYtFUqUo1ecZ+N+yZYqd29THZFimV8EIUZ5lDWnh+ogNl5kyk0TmJelMrH6ZkhqDq iEUCNE2CXUghOqiQS24olpvmmX8eQnHsWY5uQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=sWN+w1Fv4bIYBummlgoeyT/3ykM1S7qQr4+u580L+X0=; b=lPfnr0MusrZy4KmxTDbO0h93nxMpQaPHNmTNPI0WVgYhulREzCzKjA4UdiPFmn1DfI lXZr8C0/CM05RPouul/dzXLW/F88LTRKp6fbU380RDolMn9C/67+vG4+1gaNcecMlYQ/ tYcpPF0fXIxARxsgRBCMzMsa00mOur1mY1u3Ehy0uCHxl15FqMPZ5m/M1KXy526ubdQB 4V4ATrtPlGT+eBomf2Km9xsG5G8411EpchAkKZ2YhnEY+S/n/mbZbpljM39oW+glbe8A aXkbYPsLJ/+1mEk+vHKyRVZh0QEu5ddzqeyuM8vfPjIM85TtO9cf+YILt7MSEP54i+K7 rqoA== X-Gm-Message-State: AOAM531/4gdqNvUPfHurrI68SGeNDzi7nBAe0lmo2NXx2UypaOx8Pgna FTH0S5RVBfzeK4dsvICp0ceBWg== X-Received: by 2002:ad4:5506:: with SMTP id az6mr20439931qvb.136.1590523169282; Tue, 26 May 2020 12:59:29 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id w10sm691146qtc.15.2020.05.26.12.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 12:59:28 -0700 (PDT) Date: Tue, 26 May 2020 15:59:28 -0400 From: Joel Fernandes To: Frederic Weisbecker Cc: "Paul E . McKenney" , LKML , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Josh Triplett Subject: Re: [PATCH 03/10] rcu: Make locking explicit in do_nocb_deferred_wakeup_common() Message-ID: <20200526195928.GC149611@google.com> References: <20200513164714.22557-1-frederic@kernel.org> <20200513164714.22557-4-frederic@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200513164714.22557-4-frederic@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 13, 2020 at 06:47:07PM +0200, Frederic Weisbecker wrote: > It can either be called inline (locally or CPU hotplug locked) when > rdp->nocb_defer_wakeup is pending or from the nocb timer. In both cases > the rdp is offlined and we want to take the nocb lock. s/offlined/offloaded/ thanks, - Joel > > Clarify the locking rules and expectations. > > Signed-off-by: Frederic Weisbecker > Cc: Paul E. McKenney > Cc: Josh Triplett > Cc: Steven Rostedt > Cc: Mathieu Desnoyers > Cc: Lai Jiangshan > Cc: Joel Fernandes > --- > kernel/rcu/tree_plugin.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h > index 1d22b16c03e0..1dd3fdd675a1 100644 > --- a/kernel/rcu/tree_plugin.h > +++ b/kernel/rcu/tree_plugin.h > @@ -2142,9 +2142,9 @@ static void do_nocb_deferred_wakeup_common(struct rcu_data *rdp) > unsigned long flags; > int ndw; > > - rcu_nocb_lock_irqsave(rdp, flags); > + raw_spin_lock_irqsave(&rdp->nocb_lock, flags); > if (!rcu_nocb_need_deferred_wakeup(rdp)) { > - rcu_nocb_unlock_irqrestore(rdp, flags); > + raw_spin_unlock_irqrestore(&rdp->nocb_lock, flags); > return; > } > ndw = READ_ONCE(rdp->nocb_defer_wakeup); > -- > 2.25.0 >