Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2280270ybt; Tue, 16 Jun 2020 01:43:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUSOtIwzbRXrnQGCsa6JDcyuzlFhj+rZJD4GZ9rkjIJsoJeBdsRYwj4sXW7MGcZVf29F7r X-Received: by 2002:a17:906:2656:: with SMTP id i22mr1655555ejc.397.1592297005624; Tue, 16 Jun 2020 01:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592297005; cv=none; d=google.com; s=arc-20160816; b=r9+TqBmPTb/+i9m5LCEaNRT8uIVR5AAW9bd4CI24Yf+IOGVd5IHBM+Pl8udZqdZhg7 q1ikOesxEvQ1MmWCvu1M76Rtcy8X8DdJJYBBMjqmKc5LKVT6FRu0Mux4aBY7BB0dSmyg 7kO4n/qVqiR534v7X0FrMgeKvMohGKx+CbCmj2VZEfMUHQSYoU74De1cYqXGIvi4109n LGsiU8q3zYjMUUhD5zizvPp0pfnt2hDrb0Km/m0hPf5tUaUsrDqU5j41V7ppwdiw8SQT PjVzqkpx+gmWf4QgTwWfSDr8on9ccpoNMxSNEn/zm9zL6lme2Ts8415f8dQDAUVOj44C uspQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=BqbWmcClNnGSFIpHJgayAwXYOS4adJyAa6GmYOVkwlY=; b=U8GsrLvo+abSzENmz0Jpk6scl+Q2Y/kSrOUxTOXGHwFQni21X1ldYBTJ/lWGw8430i h//v9ZT/9HbSDoqRkrkgh2i2iT8QtRBNUpvc3zfxPgBDmGj/0a+aTmYEok5eLBaLegcR oG62jfKHW1p4VR7ywRa+N1b/FwbirroEugJP65KUI5/xb5+MfwJcl3LY338A2E2FG5Pi lwcddcVNCiDTZ44OeZPJ/XnaQjVniT+C2a96nbI3T+XM3O58ATqm4RkIlu6cx7HSBFHJ fB183Ay1MeOM0ZWqc071QaLyzx8DlssghiVFXPoAzy/o7jfQOHcPBiQI0OFKSTFz3D5r u2pQ== ARC-Authentication-Results: i=1; mx.google.com; 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 u1si10723405ejt.637.2020.06.16.01.43.03; Tue, 16 Jun 2020 01:43:25 -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; 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 S1728106AbgFPIk0 (ORCPT + 99 others); Tue, 16 Jun 2020 04:40:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728086AbgFPIkZ (ORCPT ); Tue, 16 Jun 2020 04:40:25 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B19CAC05BD43; Tue, 16 Jun 2020 01:40:25 -0700 (PDT) Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jl78X-0008Hw-0e; Tue, 16 Jun 2020 10:40:05 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 8A2C010154B; Tue, 16 Jun 2020 10:40:04 +0200 (CEST) From: Thomas Gleixner To: Joel Fernandes Cc: "Paul E. McKenney" , LKML , rcu@vger.kernel.org, Andrew Lutomirski , X86 ML , Frederic Weisbecker , Steven Rostedt , Mathieu Desnoyers , Will Deacon , Peter Zijlstra Subject: Re: [PATCH x86/entry: Force rcu_irq_enter() when in idle task In-Reply-To: <20200615201647.GC12037@google.com> References: <20200611235305.GA32342@paulmck-ThinkPad-P72> <871rmkzcc8.fsf@nanos.tec.linutronix.de> <87wo4cxubv.fsf@nanos.tec.linutronix.de> <20200615201647.GC12037@google.com> Date: Tue, 16 Jun 2020 10:40:04 +0200 Message-ID: <871rmfcskb.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Joel, Joel Fernandes writes: > On Fri, Jun 12, 2020 at 03:55:00PM +0200, Thomas Gleixner wrote: >> This is also correct vs. user mode entries in NOHZ full scenarios because >> user mode entries bring RCU out of EQS and force the RCU irq nesting state > > I had to re-read this sentence a couple of times. The 'user mode entries' > sounds like 'entry into user mode'. It would be good to reword it to 'IRQ > entry in user mode'. :) > My knowledge predates the rcu-watching reworks so apologies on the below > question but I still didn't fully follow why when the idle task behaves > differently from being in user mode. Even with user mode we should have: > > (in EQS) > <---------- exits EQS so now rcu is watching > > <-- the buggy !watching logic prevents rcu_irq_enter > -> report QS since tick thinks it is first level. > > Is there a subtlety here I'm missing? I checked the RCU code and I did not > see anywhere that rcu_user_enter() makes it behave differently. Both > rcu_user_enter() and rcu_idle_enter() call rcu_eqs_enter(). The interrupt hit user mode entry does: idtentry_enter_cond_rcu() if (user_mode(regs)) enter_from_user_mode() user_exit_irqoff() __context_tracking_exit(CONTEXT_USER) rcu_user_exit() rcu_eqs_exit(1) ... WRITE_ONCE(rdp->dynticks_nmi_nesting, DYNTICK_IRQ_NONIDLE); i.e. for interrupts which enter from user mode we are not invoking rcu_irq_enter() at all. The return from interrupt path has nothing to do with that because that's an entry in kernel mode. Thanks, tglx