Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp415992ybl; Fri, 23 Aug 2019 02:51:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGGSTQqJqCXlICNsAE1npBPxq+vAyDINpWs5tnh6J2h9q5yeQPXXHvOB2P0uzCbn9S5ggQ X-Received: by 2002:a17:90a:ad94:: with SMTP id s20mr4406583pjq.42.1566553908675; Fri, 23 Aug 2019 02:51:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566553908; cv=none; d=google.com; s=arc-20160816; b=yoaXvX+Jucnum5NBIsXCbh+wddT19pd+QuT9WyHZSMigM68t8AAa+5hclN9TqOBU2k DeTnq1yAO33xYdlCDDPL9MIbX2ToIbcTFhpY72Aomjofl4mwOlcKZ52XtudQ8gpRWl1+ OppURUw641dhk4nmnUzxBC682Cmb83YwLXTQJQvde3ZuEX0yjU/wm6aw2FlASnwYbg6b 8IF3qWI46cWloUaYLR+0Wd9u/ERzXwhmptgatfF61SlaWc66kZT0DQsa0RICMx2Mf8SV OX66+7+BRi68GvDW2cQOwvfQ4lRgjWahAs2G9XcINTHVqG9bqB93rNHjtBC859iOOOf6 iGpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=03Lwr3ahsyUArC9qESuO1DJ36foeTQIxqqLksBGIusQ=; b=PFPWb4aa3lWfeCNvyMwd9HFDKeCeOhLzjySLaQFhGKBJzJbhsUXe/WNEW7xH6zF41b s5IBGZ7mZGjFuAmJg7xP8zPhzIEIpPEmeDRK8E0N5crJ4cjdEsr3EvUqpvjNjJIpYtIm jzXZi8X0ATcg2wr2xSd7fbawv1u/Wx528vAlkMLTr9ICMXcWlZiiH20zLXWaQASBb2Lz 2bRmI9PRVtNoZYwnYM3Lu38UvFyTaLEoxH4M3FWDTMjLigioTnwBW6yN5L72pl73HD2V 5EzswDt0sQbRDMiy6uPLOv9xVlIpahfPOnvStZmLqm7LFcA3Y3JJPTp6qoRnLeDy4ieI RVvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cf17si2115872plb.48.2019.08.23.02.51.33; Fri, 23 Aug 2019 02:51:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391199AbfHWCg0 (ORCPT + 99 others); Thu, 22 Aug 2019 22:36:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43326 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389663AbfHWCgZ (ORCPT ); Thu, 22 Aug 2019 22:36:25 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 901B718C4271; Fri, 23 Aug 2019 02:36:25 +0000 (UTC) Received: from ovpn-117-150.phx2.redhat.com (ovpn-117-150.phx2.redhat.com [10.3.117.150]) by smtp.corp.redhat.com (Postfix) with ESMTP id B026D600CD; Fri, 23 Aug 2019 02:36:21 +0000 (UTC) Message-ID: <2981acb99554a80211118350975577ab8faa3a2d.camel@redhat.com> Subject: Re: [PATCH RT v2 1/3] rcu: Acquire RCU lock when disabling BHs From: Scott Wood To: paulmck@linux.ibm.com Cc: Sebastian Andrzej Siewior , linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, Joel Fernandes , Thomas Gleixner , Peter Zijlstra , Juri Lelli , Clark Williams Date: Thu, 22 Aug 2019 21:36:21 -0500 In-Reply-To: <20190821233358.GU28441@linux.ibm.com> References: <20190821231906.4224-1-swood@redhat.com> <20190821231906.4224-2-swood@redhat.com> <20190821233358.GU28441@linux.ibm.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Fri, 23 Aug 2019 02:36:25 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-08-21 at 16:33 -0700, Paul E. McKenney wrote: > On Wed, Aug 21, 2019 at 06:19:04PM -0500, Scott Wood wrote: > > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h > > index 388ace315f32..d6e357378732 100644 > > --- a/include/linux/rcupdate.h > > +++ b/include/linux/rcupdate.h > > @@ -615,10 +615,12 @@ static inline void rcu_read_unlock(void) > > static inline void rcu_read_lock_bh(void) > > { > > local_bh_disable(); > > +#ifndef CONFIG_PREEMPT_RT_FULL > > __acquire(RCU_BH); > > rcu_lock_acquire(&rcu_bh_lock_map); > > RCU_LOCKDEP_WARN(!rcu_is_watching(), > > "rcu_read_lock_bh() used illegally while idle"); > > +#endif > > Any chance of this using "if (!IS_ENABLED(CONFIG_PREEMPT_RT_FULL))"? > We should be OK providing a do-nothing __maybe_unused rcu_bh_lock_map > for lockdep-enabled -rt kernels, right? OK. > > @@ -185,8 +189,10 @@ void __local_bh_enable_ip(unsigned long ip, > > > > unsigned int cnt) > > WARN_ON_ONCE(count < 0); > > local_irq_enable(); > > > > - if (!in_atomic()) > > + if (!in_atomic()) { > > + rcu_read_unlock(); > > local_unlock(bh_lock); > > + } > > The return from in_atomic() is guaranteed to be the same at > local_bh_enable() time as was at the call to the corresponding > local_bh_disable()? That's an existing requirement on RT (which rcutorture currently violates) due to bh_lock. > I could have sworn that I ran afoul of this last year. Might these > added rcu_read_lock() and rcu_read_unlock() calls need to check for > CONFIG_PREEMPT_RT_FULL? This code is already under a PREEMPT_RT_FULL ifdef. -Scott