Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp906130imm; Wed, 20 Jun 2018 08:27:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIWY2YtCA9WtuYRLIWXJy4h8eYxPVI2+KTKQgKKUBV2JOBVvpkrqJTggkJq+t16MQekHyMM X-Received: by 2002:a62:a30e:: with SMTP id s14-v6mr23622455pfe.168.1529508432528; Wed, 20 Jun 2018 08:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529508432; cv=none; d=google.com; s=arc-20160816; b=Xu6LiwFDCkadxnwX6kC2y++M3ETlKfitXj+8k32RWzNKFwy9zUV8qMMdF5qoCdKpxL zT7Cz+bFC5HvHDmCKWiB9lp412DzOg+V8JjxKobVtpdwhT2khBSxeO3Zt0hyfRhRCcrV 2kfHpRWOq9bCYFu1KrF1+K21Om+XDzgGaT5xz880MFzEfvKUTaueTjBGh5PS2jKBA7AE drVBgjXr/Y7dNM+kbV6pOCkAkkDaKlgIWqjuiJVDyuJk1igi/8fi+3yP6RSJ5dMV0zQ8 IqE70/0lG/dzAMU3C/OHoxjgukUErlx4TwsXWXf8qhz3nul5pbGGgA2+w11jgZY4Je/7 L1wQ== 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=h1ibE3kEoENvIaTx2f9HGNodpszw2vE575My1OoQ4e4=; b=as0jdzWjPsIW0LP6GLkzJG6NEIPMaY5YM+wbb4VnSpEHQrhSMBHw1Mat9RhdeoN4Nk ptANUQRibX7sS8NRDSmqxniVplc2R/9wwB/X5kjTfJJ7TqC4axlcN33c1kPRy+Y9t+25 smVWU2hFZ4GgOqtR07LDU1DG9pKTrj5JsYTPrmXK+5Nkrt9Ard9RGO6ol3n+VbnPK2LY prbP1O/oOgLxK7quN+38QDPFohHF4ZpN1LUDlG5HTzhZipvUa6HelTPmPO3KI8fS3+ok w+vyuJ40fW2AZs7OtBJxAU1SEzeLDNQ/+rjLteaIM/kcJ/bX+jHseEvanbNIKqsLXasC jc3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SvlHFZap; 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 d30-v6si85686pla.110.2018.06.20.08.26.58; Wed, 20 Jun 2018 08:27:12 -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=SvlHFZap; 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 S932599AbeFTPZs (ORCPT + 99 others); Wed, 20 Jun 2018 11:25:48 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:35196 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932232AbeFTPZq (ORCPT ); Wed, 20 Jun 2018 11:25:46 -0400 Received: by mail-lf0-f68.google.com with SMTP id i15-v6so5609750lfc.2 for ; Wed, 20 Jun 2018 08:25:46 -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=h1ibE3kEoENvIaTx2f9HGNodpszw2vE575My1OoQ4e4=; b=SvlHFZappOP0ffGsfyD5iimSYmbAQHFPA8rVs061eOCuP3jTj+vn1yqyo/w5hx91gc 1fR+zheb0e3rgoNBlheta7HrH9IjMrC04FCjfC32Ai/seZortzuLL2XkbmbRMNMS0xAJ l8cPd14D0Jq1kDuLX4zAsdQxicOfTg7rT2HpzgSjgqO4ayDpL72drY8UYfx6Q/TEJk1I 3X/fepuRSmPOxGLmE6iMU8u651EU4CJb7nqpG4CqEiAKwUSTMRbKJ7A4CjkNbPLNEinX oCzKxmCQ2ZdYUF3wcHlA6kqtnrRJn3NyYAklpBkRRyDETpfllAdD1L2TASxLlscbYuGi S99w== 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=h1ibE3kEoENvIaTx2f9HGNodpszw2vE575My1OoQ4e4=; b=TrLj0Dk3hX3arFBn8Zo9Tj3sEsMR7uanBkbSzA54IAaNc8Q4S0+d5BbWLaMy4x45gf XmUBhgFX813sreHXqXPq+3lvyMJXpUHaXrCyZbIQ/DJ0X3xvex0HR5hlcDDRmdKX1lnL D6spPjVaFnkq/KM7faG2g29vo6KaUnL1JBqvgHm4nJmQAp3wficsVXT7tif0MD25NpNF zl6A8sMJiDh8b7BDVbly2VWK81xdy08ux2wDh2GyOi1aFH4+Vd7I816o9g1xBLzgt4m9 zOim4CxcgJxPRbNToBrChnfy3ZX/j3ASF31q05lrO3k65GwvZQelq/1sO4gq3cPEtuAE RbhQ== X-Gm-Message-State: APt69E2uo9mRI3b/5jU9BgFo2Ur+zQ8v3zDk0zNdAs6/7OvooNolokaL 7fUW6JKNiJa40j0iJwQfyRWl+OzYADJub+7YDnDZlr0g X-Received: by 2002:a2e:3810:: with SMTP id f16-v6mr15699573lja.25.1529508345357; Wed, 20 Jun 2018 08:25:45 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:44ec:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 08:25:44 -0700 (PDT) In-Reply-To: <20180620093309.7d07715a@gandalf.local.home> References: <1529484440-20634-1-git-send-email-byungchul.park@lge.com> <20180620093309.7d07715a@gandalf.local.home> From: Byungchul Park Date: Thu, 21 Jun 2018 00:25:44 +0900 Message-ID: Subject: Re: [RFC 1/2] rcu: Do prepare and cleanup idle depending on in_nmi() To: Steven Rostedt Cc: Byungchul Park , jiangshanlai@gmail.com, Paul McKenney , 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 Wed, Jun 20, 2018 at 10:33 PM, Steven Rostedt wrote: > On Wed, 20 Jun 2018 17:47:19 +0900 > Byungchul Park wrote: > >> Get rid of dependency on ->dynticks_nmi_nesting. > > This is not a trivial change. Can you please explain the rational and > background in the change log. Add enough context here to know why this > change is needed. I'm sorry I didn't. I thought I could add enough explanation after requesting for comment and getting answer. But I should've done that :( The 1st patch is the 1st step for removing ->dynticks_nmi_nesting entirely from the code, which is done mainly in the 2nd patch. At the next spin(not RFC), I will add full explanation about what you point out. Thanks a lot. > Thanks! > > -- Steve > >> >> 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()) { >> + rcu_prepare_for_idle(); >> + rcu_dynticks_task_enter(); >> + } >> + >> /* This NMI interrupted an RCU-idle CPU, restore RCU-idleness. */ >> trace_rcu_dyntick(TPS("Startirq"), rdtp->dynticks_nmi_nesting, 0, rdtp->dynticks); >> WRITE_ONCE(rdtp->dynticks_nmi_nesting, 0); /* Avoid store tearing. */ >> @@ -824,14 +829,8 @@ void rcu_nmi_exit(void) >> */ >> void rcu_irq_exit(void) >> { >> - struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks); >> - >> lockdep_assert_irqs_disabled(); >> - if (rdtp->dynticks_nmi_nesting == 1) >> - rcu_prepare_for_idle(); >> rcu_nmi_exit(); >> - if (rdtp->dynticks_nmi_nesting == 0) >> - rcu_dynticks_task_enter(); >> } >> >> /* >> @@ -944,6 +943,11 @@ void rcu_nmi_enter(void) >> if (rcu_dynticks_curr_cpu_in_eqs()) { >> rcu_dynticks_eqs_exit(); >> incby = 1; >> + >> + if (!in_nmi()) { >> + rcu_dynticks_task_exit(); >> + rcu_cleanup_after_idle(); >> + } >> } >> trace_rcu_dyntick(incby == 1 ? TPS("Endirq") : TPS("++="), >> rdtp->dynticks_nmi_nesting, >> @@ -977,14 +981,8 @@ void rcu_nmi_enter(void) >> */ >> void rcu_irq_enter(void) >> { >> - struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks); >> - >> lockdep_assert_irqs_disabled(); >> - if (rdtp->dynticks_nmi_nesting == 0) >> - rcu_dynticks_task_exit(); >> rcu_nmi_enter(); >> - if (rdtp->dynticks_nmi_nesting == 1) >> - rcu_cleanup_after_idle(); >> } >> >> /* > -- Thanks, Byungchul