Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1207854ybj; Tue, 5 May 2020 15:26:47 -0700 (PDT) X-Google-Smtp-Source: APiQypJNxNouuUI/WpI8fRkZofyqvqkiG2H0zuND3d1AAaADj5H4CJi+zEnNpEomm/R1/3wPnbwr X-Received: by 2002:a05:6402:b99:: with SMTP id cf25mr4606005edb.372.1588717607623; Tue, 05 May 2020 15:26:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588717607; cv=none; d=google.com; s=arc-20160816; b=r3nsDK/S3H0O3/nRA8SSGsbixPR17HocIKEUuLbuEkUHWcrcyen3AjJe9Af/8RtFQd SKKlA99rzm2y8F160ATB29ifIq5xOcS/PbbslDzDig1U+yQgS3ExDB9G72HfMoB2Ae5C G8vZbHUD3XLObKbNN1Pd9Ot4mai2snwYCbYjPu0XLxzg6hvgBRL9t32AO1rOjHEFyaDH KbVXgmDX3JubytMUwsqvJ85F0pf6Z+Qg8mrwnukNKnRzL3sJhpXTMPtCRzWjINfyM/UN nFAxyhmPBIRstVB2DV7I52ulAtDhTkMFV03fbBTcsmbDoU1PJMhmhj/cgkFXtZnNxxqO 1kuw== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=ul7Ses9HrHSZWy1iUkegt3S55PS/R1zfQ2AKUlEv/4g=; b=x+AAae/0YY4N4U+IQuoQONpet0NXaIojHpN03mqZJ6DuT1JT/HlOU90XrcnkSDwFgb YxUwVrgQ4BW33k/YnYN1ZQt+a7sP11jQL5I2RNLsFoCdcECNrtS0NC/i2lEMDFLEXZ2F O34VYGJ4DGeDwZofVoJ2AFmXR/l5bP6WSDfWlD6pBwz5lSyg8QZbgN2XTllepbHW9Q8J gQ2AzBmSnE6XcesXdSWhtYLTSArLEAbwq5oxb5UNRGPUisqPZb+V/mk0AHbciMUDoXW8 Qvs2s7PJITjLHaQh98Jj6FSr4kb7Xhfyhq6ZwLE6LDBS1ryHpMGFeRDDTMMruWCip3jf 2URA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uw3+Lltx; 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 rp4si32385ejb.205.2020.05.05.15.26.21; Tue, 05 May 2020 15:26:47 -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=uw3+Lltx; 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 S1728934AbgEEWYa (ORCPT + 99 others); Tue, 5 May 2020 18:24:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:52318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727895AbgEEWY3 (ORCPT ); Tue, 5 May 2020 18:24:29 -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 25CE12064A; Tue, 5 May 2020 22:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588717469; bh=wc9GfyZFu/gad6fW5vIIWHoZJVzw+CNkLDISiHya/P8=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=uw3+LltxaM+L7DUAkO54xQreocePuU4q+3hELpV0jkyly+Di6HYj2pSNZtODiNMeO 40h0Iyp4/yq/P+JDYV0fG4FZ6hWkTLFxTed1PiRPwAnFMHwScEwRhra8LRAR6eH5Ew gmp36PxZt62vinCSx8Mrs+Cpqsh8RBbNs6lnnhTo= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 03A5A3523039; Tue, 5 May 2020 15:24:29 -0700 (PDT) Date: Tue, 5 May 2020 15:24:29 -0700 From: "Paul E. McKenney" To: Thomas Gleixner Cc: LKML , x86@kernel.org, Andy Lutomirski , Alexandre Chartre , Frederic Weisbecker , Paolo Bonzini , Sean Christopherson , Masami Hiramatsu , Petr Mladek , Steven Rostedt , Joel Fernandes , Boris Ostrovsky , Juergen Gross , Brian Gerst , Mathieu Desnoyers , Josh Poimboeuf , Will Deacon Subject: Re: [patch V4 part 3 11/29] rcu: Provide rcu_irq_exit_preempt() Message-ID: <20200505222428.GU2869@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200505220224.GT2869@paulmck-ThinkPad-P72> <87zhamnilr.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zhamnilr.fsf@nanos.tec.linutronix.de> 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 Wed, May 06, 2020 at 12:05:04AM +0200, Thomas Gleixner wrote: > "Paul E. McKenney" writes: > > > On Tue, May 05, 2020 at 03:44:05PM +0200, Thomas Gleixner wrote: > >> Interrupts and exceptions invoke rcu_irq_enter() on entry and need to > >> invoke rcu_irq_exit() before they either return to the interrupted code or > >> invoke the scheduler due to preemption. > >> > >> The general assumption is that RCU idle code has to have preemption > >> disabled so that a return from interrupt cannot schedule. So the return > >> from interrupt code invokes rcu_irq_exit() and preempt_schedule_irq(). > >> > >> If there is any imbalance in the rcu_irq/nmi* invocations or RCU idle code > >> had preemption enabled then this goes unnoticed until the CPU goes idle or > >> some other RCU check is executed. > >> > >> Provide rcu_irq_exit_preempt() which can be invoked from the > >> interrupt/exception return code in case that preemption is enabled. It > >> invokes rcu_irq_exit() and contains a few sanity checks in case that > >> CONFIG_PROVE_RCU is enabled to catch such issues directly. > >> > >> Signed-off-by: Thomas Gleixner > >> Cc: "Paul E. McKenney" > >> Cc: Joel Fernandes > > > > The ->dynticks_nmi_nesting field is going away at some point, but > > there is always "git merge". ;-) > > Yes. The logistics for merging all of this is going to be interesting :) ;-) ;-) ;-) Thanx, Paul