* [PATCH] rcu: Remove some superfluous lines
@ 2016-03-10 8:49 Peter Zijlstra
2016-03-10 13:41 ` Paul E. McKenney
0 siblings, 1 reply; 4+ messages in thread
From: Peter Zijlstra @ 2016-03-10 8:49 UTC (permalink / raw)
To: Paul McKenney; +Cc: Thomas Gleixner, linux-kernel
I think you'll find this condition is superfluous, as the whole function
is under #ifdef of that same.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
kernel/rcu/tree.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 4f7369d54de0..dd2646e56456 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -4237,9 +4237,6 @@ static void rcu_cleanup_dying_idle_cpu(int cpu, struct rcu_state *rsp)
struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu);
struct rcu_node *rnp = rdp->mynode; /* Outgoing CPU's rdp & rnp. */
- if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
- return;
-
/* Remove outgoing CPU from mask in the leaf rcu_node structure. */
mask = rdp->grpmask;
raw_spin_lock_irqsave_rcu_node(rnp, flags); /* Enforce GP memory-order guarantee. */
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rcu: Remove some superfluous lines
2016-03-10 8:49 [PATCH] rcu: Remove some superfluous lines Peter Zijlstra
@ 2016-03-10 13:41 ` Paul E. McKenney
2016-03-10 13:55 ` Peter Zijlstra
0 siblings, 1 reply; 4+ messages in thread
From: Paul E. McKenney @ 2016-03-10 13:41 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: Thomas Gleixner, linux-kernel
On Thu, Mar 10, 2016 at 09:49:04AM +0100, Peter Zijlstra wrote:
>
> I think you'll find this condition is superfluous, as the whole function
> is under #ifdef of that same.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Right you are! It got moved under that #ifdef in the process of merging
the RCU, hotplug, and swait changes, and I failed to notice. Good catch!
I will apply this to my tree once -rc1 comes out, as it will apply to
-rcu at that point.
Or maybe we should remove the #ifdef and add IS_ENABLED() to the other
functions under that #ifdef. Thoughts?
Thanx, Paul
> ---
> kernel/rcu/tree.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 4f7369d54de0..dd2646e56456 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -4237,9 +4237,6 @@ static void rcu_cleanup_dying_idle_cpu(int cpu, struct rcu_state *rsp)
> struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu);
> struct rcu_node *rnp = rdp->mynode; /* Outgoing CPU's rdp & rnp. */
>
> - if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
> - return;
> -
> /* Remove outgoing CPU from mask in the leaf rcu_node structure. */
> mask = rdp->grpmask;
> raw_spin_lock_irqsave_rcu_node(rnp, flags); /* Enforce GP memory-order guarantee. */
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rcu: Remove some superfluous lines
2016-03-10 13:41 ` Paul E. McKenney
@ 2016-03-10 13:55 ` Peter Zijlstra
2016-04-12 14:44 ` Paul E. McKenney
0 siblings, 1 reply; 4+ messages in thread
From: Peter Zijlstra @ 2016-03-10 13:55 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: Thomas Gleixner, linux-kernel
On Thu, Mar 10, 2016 at 05:41:46AM -0800, Paul E. McKenney wrote:
> On Thu, Mar 10, 2016 at 09:49:04AM +0100, Peter Zijlstra wrote:
> >
> > I think you'll find this condition is superfluous, as the whole function
> > is under #ifdef of that same.
> >
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>
> Right you are! It got moved under that #ifdef in the process of merging
> the RCU, hotplug, and swait changes, and I failed to notice. Good catch!
>
> I will apply this to my tree once -rc1 comes out, as it will apply to
> -rcu at that point.
>
> Or maybe we should remove the #ifdef and add IS_ENABLED() to the other
> functions under that #ifdef. Thoughts?
I'd go with the #ifdef, its the conventional pattern.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rcu: Remove some superfluous lines
2016-03-10 13:55 ` Peter Zijlstra
@ 2016-04-12 14:44 ` Paul E. McKenney
0 siblings, 0 replies; 4+ messages in thread
From: Paul E. McKenney @ 2016-04-12 14:44 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: Thomas Gleixner, linux-kernel
On Thu, Mar 10, 2016 at 02:55:00PM +0100, Peter Zijlstra wrote:
> On Thu, Mar 10, 2016 at 05:41:46AM -0800, Paul E. McKenney wrote:
> > On Thu, Mar 10, 2016 at 09:49:04AM +0100, Peter Zijlstra wrote:
> > >
> > > I think you'll find this condition is superfluous, as the whole function
> > > is under #ifdef of that same.
> > >
> > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> >
> > Right you are! It got moved under that #ifdef in the process of merging
> > the RCU, hotplug, and swait changes, and I failed to notice. Good catch!
> >
> > I will apply this to my tree once -rc1 comes out, as it will apply to
> > -rcu at that point.
> >
> > Or maybe we should remove the #ifdef and add IS_ENABLED() to the other
> > functions under that #ifdef. Thoughts?
>
> I'd go with the #ifdef, its the conventional pattern.
Longer term, I am moving from #ifdef to IS_ENABLED(), as it makes for
easier detection of compiler errors in oddball combinations of Kconfig
options. But no point in carrying redundant code in the meantime,
so queued for 4.8.
Thanx, Paul
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-04-12 14:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10 8:49 [PATCH] rcu: Remove some superfluous lines Peter Zijlstra
2016-03-10 13:41 ` Paul E. McKenney
2016-03-10 13:55 ` Peter Zijlstra
2016-04-12 14:44 ` Paul E. McKenney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox