Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp781590imm; Wed, 20 Jun 2018 06:34:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLJde1QcwuekeOEGMJE3GQHTNx87PlNG9xIX1KHZrdlxKhrVZGMP+eJbFjtgrcLMuoRON+B X-Received: by 2002:a62:99db:: with SMTP id t88-v6mr22943584pfk.118.1529501650637; Wed, 20 Jun 2018 06:34:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529501650; cv=none; d=google.com; s=arc-20160816; b=g/rW961mcglh8Lxw0Id8A/P1iB9sqMKHuZR86qGyEmPezWJabOejRYonTPCxei7IiP tKefR8QY9nWYM3dL5GQPyLiIanucI444x0rLPj8reX4Y7Z1OUaQ5KGg/EBbRHsrPbYRn Zz7AKQ2bvZ1H4uarDN1/y83tXpE3XUbhEv3ar5pUTk4AG6zM/RRSEKlITsCejEkl5fwL pPZU7srO2WJMZ/5xiuP9YWKy6NZavi5Gz47FiE7ed1qvuKV+4nubK1OK7TQLbYnb11Nb gClVmQeWyciHJ/hpirW7fm5r3M1/ELAiWV7juVzDTnywCC5L+cbXRRAbqGDg7kOEwFp8 NcuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=lssq9aTnAevB/yc+kNKqPasRzpBW5k2WXHrVg2kbEdM=; b=BQeUtVfmEgYAVSRp6h1luRiagn+2h6oVvluaRCzFuhIABDD8BZ4WsIhM2lpFEnN+ff iYnEIltbuXZPAmLx4CGMsh+miaS4jPnWeG/ME5nWpJL10Iv0e9uQO7SfEr4WPeI5w1qV FkcSWQEu/CO5a2Yhqk0Rx+HeDttwOx3TNJ9G1DYvWdZst0/rUiE/8l3Kn4aFIYLA91RZ cG6OeGtwevrlJE0oF3eKd8i6EWcskCbVYrzLhWNBXcJvXF6d7dtRFFYewBB+qp4Z+H8e iXfZoS7fepwvHey9LIUf8hYL/Gs9el+GV4siqCfs+mXmBoL/T9jxe6GFmVjwPVfVF4XZ l/bA== ARC-Authentication-Results: i=1; mx.google.com; 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 x12-v6si2385411pln.163.2018.06.20.06.33.56; Wed, 20 Jun 2018 06:34:10 -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; 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 S1754303AbeFTNdN (ORCPT + 99 others); Wed, 20 Jun 2018 09:33:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:35130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753594AbeFTNdM (ORCPT ); Wed, 20 Jun 2018 09:33:12 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.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 812E520872; Wed, 20 Jun 2018 13:33:11 +0000 (UTC) Date: Wed, 20 Jun 2018 09:33:09 -0400 From: Steven Rostedt To: Byungchul Park Cc: jiangshanlai@gmail.com, paulmck@linux.vnet.ibm.com, josh@joshtriplett.org, mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org, kernel-team@lge.com, joel@joelfernandes.org Subject: Re: [RFC 1/2] rcu: Do prepare and cleanup idle depending on in_nmi() Message-ID: <20180620093309.7d07715a@gandalf.local.home> In-Reply-To: <1529484440-20634-1-git-send-email-byungchul.park@lge.com> References: <1529484440-20634-1-git-send-email-byungchul.park@lge.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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(); > } > > /*