Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp956072imm; Wed, 20 Jun 2018 09:12:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLpWgC159SrF6BVhyI368MRKxULE+Q2ArKkbq2wphYJ+gEqAo3jhc487MFje2w7SlQDeFu1 X-Received: by 2002:a65:4b46:: with SMTP id k6-v6mr19581308pgt.113.1529511156303; Wed, 20 Jun 2018 09:12:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529511156; cv=none; d=google.com; s=arc-20160816; b=xHgNCbV5xmyBxKBsUIsu4Fmt8trXKVP5tJlMBOpryrRW87UjLL5PKeDZxErfAGTSaw uRm/XLt5OLFGLPfZwYa/YQ3cc8dZG3HF05ya6p/Y+vtxfvQ3jeVGlVJYbE6DsMCS/xoC pPKlZeUseCw/snxOzAO0g1LtuXTgtYKeU4at3X0Mt60P+eA+siURwuKDkilGXfKqRy8n QCaHL/sULfCR/5suo3J8C/585oxUDh3fMMfitNA4tKLtzLXkrpPE1ixbVwZ+MxdJS5wc dxF96DybToKIGdtT02voWza1cD8lFd655/u1VJPAS+MSYfpq1zLCylbGXW1iXtxBx6DP QCFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=FezQaT2WjnN4UJEQr1DEDLkBcIfT9Kw2aSSuu5zu/0s=; b=WeP1B1bCXjpvodscwwMAZA5cpDglsYYaPL8Bgb4ZiYs6j+bVhBgiUzGCxa8dj8JdEy O94O9Bpn0djPYah2hUTYFtwHrVMCzZzkaHowPrFHUKZM39h7YkuMLEvLXTwJ55/f85oh rQdkHKtm8f5FFVTOd85TO/TPvWzBdj32yOwuOgLdU5Yig+b6KBRuplk+X2YzHd9xLWnk zMBvpWcngwaWFzgTK8y7Vf/Ykllh0RF4SdWFebvUkgWLwbFPHbAnM9MFRdz/LpGCEzgL JpcXz7DBZ57oaNqK6RMeGgJBIuCH1ojWoR6sheRnKbyQAarGmC/mLKZLuOlhZKPJX9mL ZnHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FtQRlwwH; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p33-v6si2585098pld.318.2018.06.20.09.12.21; Wed, 20 Jun 2018 09:12:36 -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=@gmail.com header.s=20161025 header.b=FtQRlwwH; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754260AbeFTQLj (ORCPT + 99 others); Wed, 20 Jun 2018 12:11:39 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:39043 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754085AbeFTQLi (ORCPT ); Wed, 20 Jun 2018 12:11:38 -0400 Received: by mail-lf0-f65.google.com with SMTP id t2-v6so149473lfd.6 for ; Wed, 20 Jun 2018 09:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=FezQaT2WjnN4UJEQr1DEDLkBcIfT9Kw2aSSuu5zu/0s=; b=FtQRlwwH3psv7sqP3zeCTcXOF1kSIPQwqDUol8FUNgdqWqyG47WFhXM2uY2T9PBGGl 9HUYvbtIVBvt3JFnR7rBxNzWYBR4triokKS+UFG31m8mqyFFgvJ0ERztk6grhYxU+1ys uaoOlVw/9P7f6PD830e0bQOcohFfZE6Isg84mQ8ASOfE5Z6qNJLugIaJuHSi+EVYPhXB Mg0MsHXOE4PqSBNzhIOGpcPLqIkefJfF68cuNP3nfSjFgfvi9nuqEiiQGCfIkM9qVqmk M2GsMXUcQo6P9XKVSjMEtb94faIZlKHiCSPONhz8kw4eIZD8GFoa7RyhEU1V/nEzGyp4 QZqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=FezQaT2WjnN4UJEQr1DEDLkBcIfT9Kw2aSSuu5zu/0s=; b=A9NI1eLi0SkyMUXeNLRtnQIHKcsLs4tJaE3uyiuUJwXpBj+uKMyHASlTWj4NkiFUig NY7WzCpAAURjgNyu5+RUW2Rf3JHhzSgGpxcIouPVTBq1VMHAurU5yfKhQutxXjGTUads NBoz3rSW3421quSQwIni4PcwiKW+eN2w9LtyNRAzXHJjiFMjwwL8s3aYFVu9MEclYRIs maDc17JUP2xLDNbTvjeTbLtC3yPxc2mu4RgLGTSyzb++8SDZDQTftDNbfxqztLVKWeva C0WMxy0iy02kTbZGEtVWZ8afVWmVQad/nEdGI7Fw5Dj9GmO/PxhNAHS+vLbDzWai2sQU vNAQ== X-Gm-Message-State: APt69E33wDEvVvVg/RAGgiiozNiiPEVJ/nOUxq1C02ze6dSkWoabeg8P IvhG66Dm8Hu2h4voe6H3enmtafvd5qAUy+U/2LE= X-Received: by 2002:a19:110:: with SMTP id 16-v6mr2768947lfb.10.1529511096765; Wed, 20 Jun 2018 09:11:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:44ec:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 09:11:36 -0700 (PDT) In-Reply-To: <20180620155658.GU3593@linux.vnet.ibm.com> References: <1529484440-20634-1-git-send-email-byungchul.park@lge.com> <20180620145058.GP3593@linux.vnet.ibm.com> <20180620114335.7a314642@gandalf.local.home> <20180620155658.GU3593@linux.vnet.ibm.com> From: Byungchul Park Date: Thu, 21 Jun 2018 01:11:36 +0900 Message-ID: Subject: Re: [RFC 1/2] rcu: Do prepare and cleanup idle depending on in_nmi() To: Paul McKenney Cc: Steven Rostedt , Byungchul Park , jiangshanlai@gmail.com, josh@joshtriplett.org, Mathieu Desnoyers , linux-kernel@vger.kernel.org, kernel-team@lge.com, Joel Fernandes Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 21, 2018 at 12:56 AM, Paul E. McKenney wrote: > On Wed, Jun 20, 2018 at 11:43:35AM -0400, Steven Rostedt wrote: >> On Wed, 20 Jun 2018 07:50:58 -0700 >> "Paul E. McKenney" wrote: >> >> > On Wed, Jun 20, 2018 at 05:47:19PM +0900, Byungchul Park wrote: >> > > Get rid of dependency on ->dynticks_nmi_nesting. >> > > >> > > Signed-off-by: Byungchul Park >> > > --- >> > > kernel/rcu/tree.c | 22 ++++++++++------------ >> > > 1 file changed, 10 insertions(+), 12 deletions(-) >> > > >> > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c >> > > index deb2508..59ae94e 100644 >> > > --- a/kernel/rcu/tree.c >> > > +++ b/kernel/rcu/tree.c >> > > @@ -797,6 +797,11 @@ void rcu_nmi_exit(void) >> > > return; >> > > } >> > > >> > > + if (!in_nmi()) { >> > >> > Is in_nmi() sufficiently reliable for use here? In the past, there have >> > been tracepoints that invoked these functions between the time that the >> > handlers were entered and the time that software updated the state so that >> > the various handler-check functions (such as in_nmi()) would return true. >> > >> > Steve, has there been any change in this situation? >> >> There shouldn't be any "trace events", but what we had to deal with was >> function tracing. And in the near future, we will be getting "function >> based events" that will allow you to create an event in any function. >> >> That said, even the function tracer shouldn't be called from the time >> the NMI triggers to "in_nmi()" is set. Because there's some function >> tracer callbacks that should not be executed from an NMI, and I use >> in_nmi() to determine if they get called or not. > > OK, so in theory this change is safe from a tracing perspective. But > it does add conditionals to a fastpath. > > Byungchul, is there any reason to make this change other than preparation > for your second patch? Sorry again I didn't explain it fully in advance. The only reason is to prepare for the 2nd. It was harder to read the patch when I made them into one. But I can make them into one if you don't think so. > > Thanx, Paul > -- Thanks, Byungchul