Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp459144imm; Thu, 21 Jun 2018 22:57:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLVW82xXqb+Q5rnC3YBXJA9L/j6NVIacBXbHiwjiB1BHAO0sWASD6e/RXWXHsNUjPBhIfvx X-Received: by 2002:a62:c00e:: with SMTP id x14-v6mr266263pff.67.1529647074691; Thu, 21 Jun 2018 22:57:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529647074; cv=none; d=google.com; s=arc-20160816; b=aFLz6zwdYGLefw9W2uLb8Z3gEdLHO3oBFLQHMJEvDKqBJMmz7Dqf3sbE6vTVOba/Bj GP0lHwWTkx595a9UBBZl+lfuu8a/Y1KZMIwo0j71c4AbuhjhazYLc26QSkKpTuCK8Aqo vmRfc0h47YcmJQk2rKRU+0eft6KDwDMOY6Nl1OFDwqhio2o5np0TiKXWV01x4lvtGzyq 2xOdRhrq0Q8VJ80fRtW1uU53Nga5/kr8z5zY1KwIicebB9g5fzZehFansvPoSDcDYDVL 8KaO624jO1Mt3xdhyvoJVO9duKWy2kE1CPPnh93keQ7zR2/jSx8EOOWEzjSeI1oQixss HVLg== 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:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=M4CmSoGOyfjxK1VLs9xSjx7mW5J/v48ecLBzt8CKuPE=; b=lPMnieeGQE/UVncoqfJNu/oAATx5+UBo3iJTlbDrfS3foyo2W1sogWDmrsGhG2Un5O iS/4sCEMQ+3HE5ZbZf1nG5cho7554jKCaj9F2RGDsPtFfikA7YbMsovLWheeKJ0LF/ct +HY5SfhtPMjq0RnW9j5I04bVO96x64NLjPIdfP2P6m2iDpQhUpKUnzpRfpfy9WYAwwGc LoPjsWmmGjCM2wmxikwDFcKmrsLKPSA5nVVfHJbBtATX+fiH+i/n/IxZPEL5ljcbey6c ujgyjXKUJNAIkwfd+vpiI5xuXA9BDdz47S19jQH5iZrbGZaOyaGWkU8sho0kYQDUHF6P 7KIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=NGxXt8By; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8-v6si5308071pgs.145.2018.06.21.22.57.39; Thu, 21 Jun 2018 22:57:54 -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; dkim=pass header.i=@joelfernandes.org header.s=google header.b=NGxXt8By; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750913AbeFVF5C (ORCPT + 99 others); Fri, 22 Jun 2018 01:57:02 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36288 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbeFVF5B (ORCPT ); Fri, 22 Jun 2018 01:57:01 -0400 Received: by mail-pg0-f67.google.com with SMTP id m5-v6so2480680pgd.3 for ; Thu, 21 Jun 2018 22:57:00 -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:user-agent; bh=M4CmSoGOyfjxK1VLs9xSjx7mW5J/v48ecLBzt8CKuPE=; b=NGxXt8ByiOtYH9eDDksGgYU6+0KFdDFuuaO3g16dzchMf+uG9v4+nSFt++a96seIdd v8zA+lunwD53cyv9KBKQbwDsrtK4RKqcRLfCYUBAjwQuHuymO+EBohiFcMonEGtoz/rz sAX67AfA0RD+7lOL6dfdQsV6n7pHwWTqJbhJQ= 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:user-agent; bh=M4CmSoGOyfjxK1VLs9xSjx7mW5J/v48ecLBzt8CKuPE=; b=ImnqNO9dx+W+9aL9N90xpm7dEA8fN2LofMEI39qzLCnYKOxqFOrTSr1n8AktHTHapC +ng4YYeRifi7V+9HXY7IUfXn+F1VHAxdO4bR+njXZdUXfQ00/RcEKRcENoGs6VAuxb3W zDRSofwb68CflsIc+6McA/ABLemrOcKxyCzBX+2S2vOs3mKzqVqoeS8dJM48Kg8jYDKZ qb9uYvCOKWV39uPDgRm9e4BtWHWBIc+pwp3igq/5CEYaj7T9hd979QG/aamYBwoIzODW Sqg/ZTkBam/omql7Iwbtr03YV07B3f1fAPKXASQh83c5gvDsUZ4PSHxkcItCssZYJJ5U txrw== X-Gm-Message-State: APt69E3nzumQ+YU/5UUrKCaZ/Bj2R2MHqAUgNwwmqomKL09crFKJHdB2 4itlni4tdRq7qZSUocY0yQrTeQ== X-Received: by 2002:a65:4a4d:: with SMTP id a13-v6mr172704pgu.161.1529647020466; Thu, 21 Jun 2018 22:57:00 -0700 (PDT) Received: from localhost ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id y23-v6sm14151342pfa.73.2018.06.21.22.56.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Jun 2018 22:56:59 -0700 (PDT) Date: Thu, 21 Jun 2018 22:56:59 -0700 From: Joel Fernandes To: "Paul E. McKenney" Cc: Byungchul Park , Byungchul Park , jiangshanlai@gmail.com, josh@joshtriplett.org, Steven Rostedt , Mathieu Desnoyers , linux-kernel@vger.kernel.org, kernel-team@lge.com, luto@kernel.org Subject: Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks Message-ID: <20180622055659.GA255098@joelaf.mtv.corp.google.com> References: <1529484440-20634-1-git-send-email-byungchul.park@lge.com> <1529484440-20634-2-git-send-email-byungchul.park@lge.com> <20180620145814.GQ3593@linux.vnet.ibm.com> <20180620164902.GW3593@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180620164902.GW3593@linux.vnet.ibm.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paul, On Wed, Jun 20, 2018 at 09:49:02AM -0700, Paul E. McKenney wrote: > On Thu, Jun 21, 2018 at 01:05:22AM +0900, Byungchul Park wrote: > > On Wed, Jun 20, 2018 at 11:58 PM, Paul E. McKenney > > wrote: > > > On Wed, Jun 20, 2018 at 05:47:20PM +0900, Byungchul Park wrote: > > >> Hello folks, > > >> > > >> I'm careful in saying that ->dynticks_nmi_nesting can be removed but I > > >> think it's possible since the only thing we are interested in with > > >> regard to ->dynticks_nesting or ->dynticks_nmi_nesting is whether rcu is > > >> idle or not. > > > > > > Please keep in mind that NMIs cannot be masked, which means that the > > > rcu_nmi_enter() and rcu_nmi_exit() pair can be invoked at any point in > > > the process, between any consecutive pair of instructions. The saving > > And yes, I should have looked at this patch more closely before replying. > But please see below. > > > I believe I understand what NMI is and why you introduced > > ->dynticks_nmi_nesting. Or am I missing something? > > Perhaps the fact that there are architectures that can enter interrupt > handlers and never leave them when the CPU is non-idle. One example of > this is the usermode upcalls in the comment that you removed. I spent some time tonight and last night trying to understand this concept of never leaving an interrupt, I hope you don't mind me asking this dumb question... perhaps I will learn something : Could you let me know how is it possible that an interrupt never exits? Typically an interrupt never exiting sounds like a hard-lockup. This is how hardlock detector works: Since regular interrupts in linux can't nest, the hardlockup detector checks if hrtimer interrupts are being handled and if not, then it throws a splat, panics the kernel etc. So I am a bit troubled by this interrupt never exiting concept.. Further since an interrupt is an atomic context, it cannot sleep or schedule into usermode so how are these upcalls handled from the interrupt? Lastly, can you point me to an example how the rcu_nmi_enter/exit() pair can go out sync? That is they aren't paired and nested properly? In my mind they always should be but I may be missing the usecase. I'm happy to try and reproduce and trace this if you can let me know how to so that I can study it better. Thanks a lot Paul for your help, - Joel