All of lore.kernel.org
 help / color / mirror / Atom feed
From: Byungchul Park <byungchul.park@lge.com>
To: jiangshanlai@gmail.com, paulmck@linux.vnet.ibm.com,
	josh@joshtriplett.org, rostedt@goodmis.org,
	mathieu.desnoyers@efficios.com
Cc: linux-kernel@vger.kernel.org, kernel-team@lge.com,
	joel@joelfernandes.org
Subject: Re: [PATCH] rcu: Refactor rcu_{nmi,irq}_{enter,exit}()
Date: Fri, 22 Jun 2018 15:23:51 +0900	[thread overview]
Message-ID: <20180622062351.GC17010@X58A-UD3R> (raw)
In-Reply-To: <1529647926-24427-1-git-send-email-byungchul.park@lge.com>

On Fri, Jun 22, 2018 at 03:12:06PM +0900, Byungchul Park wrote:
> When passing through irq or NMI contexts, the current code uses
> ->dynticks_nmi_nesting to detect if it's in the ourmost at the moment.
> 
> Here, the thing is that all the related functions, rcu_irq_enter(),
> rcu_nmi_enter(), rcu_irq_exit() and rcu_nmi_exit() are carrying out
> the check within each under the following call relationship so there
> must be redundant conditional branches:
> 
>    rcu_irq_enter()
>       /* A conditional branch with ->dynticks_nmi_nesting */
>       rcu_nmi_enter()
>          /* A conditional branch with ->dynticks_nmi_nesting */
                                               ^
                                  Precisely, ->dynticks
>       /* A conditional branch with ->dynticks_nmi_nesting */
> 
>    rcu_irq_exit()
>       /* A conditional branch with ->dynticks_nmi_nesting */
>       rcu_nmi_exit()
>          /* A conditional branch with ->dynticks_nmi_nesting */
>       /* A conditional branch with ->dynticks_nmi_nesting */
> 
>    rcu_nmi_enter()
>       /* A conditional branch with ->dynticks_nmi_nesting */
                                               ^
                                  Precisely, ->dynticks
> 
>    rcu_nmi_exit()
>       /* A conditional branch with ->dynticks_nmi_nesting */
> 
> In order to make the code more readable and remove redundant
> conditional branches, we need to refactor rcu_{nmi,irq}_{enter,exit}()
> so they use a common function for each like:
> 
>    rcu_irq_enter() inlining rcu_nmi_enter_common(irq)
>       /* A conditional branch with ->dynticks_nmi_nesting */
                                               ^
                                  Precisely, ->dynticks
> 
>    rcu_irq_exit() inlining rcu_nmi_exit_common(irq)
>       /* A conditional branch with ->dynticks_nmi_nesting */
> 
>    rcu_nmi_enter() inlining rcu_nmi_enter_common(nmi)
>       /* A conditional branch with ->dynticks_nmi_nesting */
                                               ^
                                  Precisely, ->dynticks
> 
>    rcu_nmi_exit() inlining rcu_nmi_exit_common(nmi)
>       /* A conditional branch with ->dynticks_nmi_nesting */

  reply	other threads:[~2018-06-22  6:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-22  6:12 [PATCH] rcu: Refactor rcu_{nmi,irq}_{enter,exit}() Byungchul Park
2018-06-22  6:23 ` Byungchul Park [this message]
2018-06-23 17:49   ` Paul E. McKenney
2018-06-25  8:21     ` Byungchul Park
2018-06-25 14:07     ` Steven Rostedt
2018-06-25 14:48       ` Paul E. McKenney
2018-06-25 15:02         ` Steven Rostedt
2018-06-25 15:43           ` Paul E. McKenney
2018-06-22  8:34 ` kbuild test robot
2018-06-22 13:39   ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180622062351.GC17010@X58A-UD3R \
    --to=byungchul.park@lge.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=kernel-team@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.