2014-07-15 22:31:28

by Pranith Kumar

[permalink] [raw]
Subject: [PATCH 1/3] rcu: tiny.c: Update reference to tree.c

This commit updates the references to rcutree.c which is now rcu/tree.c

Signed-off-by: Pranith Kumar <[email protected]>
---
kernel/rcu/tiny.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c
index d9efcc1..6bd785c 100644
--- a/kernel/rcu/tiny.c
+++ b/kernel/rcu/tiny.c
@@ -51,7 +51,7 @@ static long long rcu_dynticks_nesting = DYNTICK_TASK_EXIT_IDLE;

#include "tiny_plugin.h"

-/* Common code for rcu_idle_enter() and rcu_irq_exit(), see kernel/rcutree.c. */
+/* Common code for rcu_idle_enter() and rcu_irq_exit(), see kernel/rcu/tree.c. */
static void rcu_idle_enter_common(long long newval)
{
if (newval) {
@@ -114,7 +114,7 @@ void rcu_irq_exit(void)
}
EXPORT_SYMBOL_GPL(rcu_irq_exit);

-/* Common code for rcu_idle_exit() and rcu_irq_enter(), see kernel/rcutree.c. */
+/* Common code for rcu_idle_exit() and rcu_irq_enter(), see kernel/rcu/tree.c. */
static void rcu_idle_exit_common(long long oldval)
{
if (oldval) {
--
1.9.1


2014-07-15 22:31:33

by Pranith Kumar

[permalink] [raw]
Subject: [PATCH 3/3] rcu: Use rcu_num_nodes instead of NUM_RCU_NODES

NUM_RCU_NODES is set at build time and is usually a huge number. We calculate the
actual number of rcu nodes necessary at boot time based on nr_cpu_ids in
rcu_init_geometry() and store it in rcu_num_nodes. We should use this variable
instead of NUM_RCU_NODES.

This commit changes all such uses of NUM_RCU_NODES to rcu_num_nodes.

Signed-off-by: Pranith Kumar <[email protected]>
---
kernel/rcu/tree_plugin.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index cedb020..17ccb62 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -46,6 +46,8 @@ static bool __read_mostly rcu_nocb_poll; /* Offload kthread are to poll. */
static char __initdata nocb_buf[NR_CPUS * 5];
#endif /* #ifdef CONFIG_RCU_NOCB_CPU */

+extern int rcu_num_nodes;
+
/*
* Check the RCU kernel configuration parameters and print informative
* messages about anything out of the ordinary. If you like #ifdef, you
@@ -885,7 +887,7 @@ void synchronize_rcu_expedited(void)
/* Snapshot current state of ->blkd_tasks lists. */
rcu_for_each_leaf_node(rsp, rnp)
sync_rcu_preempt_exp_init(rsp, rnp);
- if (NUM_RCU_NODES > 1)
+ if (rcu_num_nodes > 1)
sync_rcu_preempt_exp_init(rsp, rcu_get_root(rsp));

put_online_cpus();
@@ -1475,7 +1477,7 @@ static void __init rcu_spawn_boost_kthreads(void)
BUG_ON(smpboot_register_percpu_thread(&rcu_cpu_thread_spec));
rnp = rcu_get_root(rcu_state_p);
(void)rcu_spawn_one_boost_kthread(rcu_state_p, rnp);
- if (NUM_RCU_NODES > 1) {
+ if (rcu_num_nodes > 1) {
rcu_for_each_leaf_node(rcu_state_p, rnp)
(void)rcu_spawn_one_boost_kthread(rcu_state_p, rnp);
}
--
1.9.1

2014-07-15 22:31:51

by Pranith Kumar

[permalink] [raw]
Subject: [PATCH 2/3] rcu: Remove stale comment in tree.c

This commit removes a stale comment in rcu/tree.c.
FYI, an updated comment exists a few lines below this.

Signed-off-by: Pranith Kumar <[email protected]>
---
kernel/rcu/tree.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index a1abaa8..e67246e 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -2211,8 +2211,6 @@ static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp)
/* Adjust any no-longer-needed kthreads. */
rcu_boost_kthread_setaffinity(rnp, -1);

- /* Remove the dead CPU from the bitmasks in the rcu_node hierarchy. */
-
/* Exclude any attempts to start a new grace period. */
mutex_lock(&rsp->onoff_mutex);
raw_spin_lock_irqsave(&rsp->orphan_lock, flags);
--
1.9.1

2014-07-15 22:52:18

by Josh Triplett

[permalink] [raw]
Subject: Re: [PATCH 1/3] rcu: tiny.c: Update reference to tree.c

On Tue, Jul 15, 2014 at 06:31:47PM -0400, Pranith Kumar wrote:
> This commit updates the references to rcutree.c which is now rcu/tree.c
>
> Signed-off-by: Pranith Kumar <[email protected]>

Reviewed-by: Josh Triplett <[email protected]>

> kernel/rcu/tiny.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c
> index d9efcc1..6bd785c 100644
> --- a/kernel/rcu/tiny.c
> +++ b/kernel/rcu/tiny.c
> @@ -51,7 +51,7 @@ static long long rcu_dynticks_nesting = DYNTICK_TASK_EXIT_IDLE;
>
> #include "tiny_plugin.h"
>
> -/* Common code for rcu_idle_enter() and rcu_irq_exit(), see kernel/rcutree.c. */
> +/* Common code for rcu_idle_enter() and rcu_irq_exit(), see kernel/rcu/tree.c. */
> static void rcu_idle_enter_common(long long newval)
> {
> if (newval) {
> @@ -114,7 +114,7 @@ void rcu_irq_exit(void)
> }
> EXPORT_SYMBOL_GPL(rcu_irq_exit);
>
> -/* Common code for rcu_idle_exit() and rcu_irq_enter(), see kernel/rcutree.c. */
> +/* Common code for rcu_idle_exit() and rcu_irq_enter(), see kernel/rcu/tree.c. */
> static void rcu_idle_exit_common(long long oldval)
> {
> if (oldval) {
> --
> 1.9.1
>

2014-07-15 22:53:20

by Josh Triplett

[permalink] [raw]
Subject: Re: [PATCH 2/3] rcu: Remove stale comment in tree.c

On Tue, Jul 15, 2014 at 06:31:48PM -0400, Pranith Kumar wrote:
> This commit removes a stale comment in rcu/tree.c.
> FYI, an updated comment exists a few lines below this.
>
> Signed-off-by: Pranith Kumar <[email protected]>

In general, when removing a stale comment, I'd suggest explaining why
the comment is stale. Was code removed without removing the
corresponding comment, or was code changed such that the comment no
longer applies, or...?

- Josh Triplett

> kernel/rcu/tree.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index a1abaa8..e67246e 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -2211,8 +2211,6 @@ static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp)
> /* Adjust any no-longer-needed kthreads. */
> rcu_boost_kthread_setaffinity(rnp, -1);
>
> - /* Remove the dead CPU from the bitmasks in the rcu_node hierarchy. */
> -
> /* Exclude any attempts to start a new grace period. */
> mutex_lock(&rsp->onoff_mutex);
> raw_spin_lock_irqsave(&rsp->orphan_lock, flags);
> --
> 1.9.1
>

2014-07-15 22:54:45

by Josh Triplett

[permalink] [raw]
Subject: Re: [PATCH 3/3] rcu: Use rcu_num_nodes instead of NUM_RCU_NODES

On Tue, Jul 15, 2014 at 06:31:49PM -0400, Pranith Kumar wrote:
> NUM_RCU_NODES is set at build time and is usually a huge number. We calculate the
> actual number of rcu nodes necessary at boot time based on nr_cpu_ids in
> rcu_init_geometry() and store it in rcu_num_nodes. We should use this variable
> instead of NUM_RCU_NODES.
>
> This commit changes all such uses of NUM_RCU_NODES to rcu_num_nodes.
>
> Signed-off-by: Pranith Kumar <[email protected]>

Reviewed-by: Josh Triplett <[email protected]>

(On a separate note, these names really need to provide clearer
explanations of the difference, grumble. Case and word order explains
little.)

> kernel/rcu/tree_plugin.h | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
> index cedb020..17ccb62 100644
> --- a/kernel/rcu/tree_plugin.h
> +++ b/kernel/rcu/tree_plugin.h
> @@ -46,6 +46,8 @@ static bool __read_mostly rcu_nocb_poll; /* Offload kthread are to poll. */
> static char __initdata nocb_buf[NR_CPUS * 5];
> #endif /* #ifdef CONFIG_RCU_NOCB_CPU */
>
> +extern int rcu_num_nodes;
> +
> /*
> * Check the RCU kernel configuration parameters and print informative
> * messages about anything out of the ordinary. If you like #ifdef, you
> @@ -885,7 +887,7 @@ void synchronize_rcu_expedited(void)
> /* Snapshot current state of ->blkd_tasks lists. */
> rcu_for_each_leaf_node(rsp, rnp)
> sync_rcu_preempt_exp_init(rsp, rnp);
> - if (NUM_RCU_NODES > 1)
> + if (rcu_num_nodes > 1)
> sync_rcu_preempt_exp_init(rsp, rcu_get_root(rsp));
>
> put_online_cpus();
> @@ -1475,7 +1477,7 @@ static void __init rcu_spawn_boost_kthreads(void)
> BUG_ON(smpboot_register_percpu_thread(&rcu_cpu_thread_spec));
> rnp = rcu_get_root(rcu_state_p);
> (void)rcu_spawn_one_boost_kthread(rcu_state_p, rnp);
> - if (NUM_RCU_NODES > 1) {
> + if (rcu_num_nodes > 1) {
> rcu_for_each_leaf_node(rcu_state_p, rnp)
> (void)rcu_spawn_one_boost_kthread(rcu_state_p, rnp);
> }
> --
> 1.9.1
>

2014-07-15 22:57:49

by Pranith Kumar

[permalink] [raw]
Subject: Re: [PATCH 2/3] rcu: Remove stale comment in tree.c


On 07/15/2014 06:53 PM, [email protected] wrote:
> On Tue, Jul 15, 2014 at 06:31:48PM -0400, Pranith Kumar wrote:
>> This commit removes a stale comment in rcu/tree.c.
>> FYI, an updated comment exists a few lines below this.
>>
>> Signed-off-by: Pranith Kumar <[email protected]>
> In general, when removing a stale comment, I'd suggest explaining why
> the comment is stale. Was code removed without removing the
> corresponding comment, or was code changed such that the comment no
> longer applies, or...?

I guess it was left out when code was moved around previously. And I did mention that an updated comment is there a few lines below.

For reference this is the new comment which is below the old comment, they mean the same :)

/* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */

2014-07-16 12:45:27

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH 3/3] rcu: Use rcu_num_nodes instead of NUM_RCU_NODES

On Tue, Jul 15, 2014 at 06:31:49PM -0400, Pranith Kumar wrote:
> NUM_RCU_NODES is set at build time and is usually a huge number. We calculate the
> actual number of rcu nodes necessary at boot time based on nr_cpu_ids in
> rcu_init_geometry() and store it in rcu_num_nodes. We should use this variable
> instead of NUM_RCU_NODES.
>
> This commit changes all such uses of NUM_RCU_NODES to rcu_num_nodes.
>
> Signed-off-by: Pranith Kumar <[email protected]>
> ---
> kernel/rcu/tree_plugin.h | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
> index cedb020..17ccb62 100644
> --- a/kernel/rcu/tree_plugin.h
> +++ b/kernel/rcu/tree_plugin.h
> @@ -46,6 +46,8 @@ static bool __read_mostly rcu_nocb_poll; /* Offload kthread are to poll. */
> static char __initdata nocb_buf[NR_CPUS * 5];
> #endif /* #ifdef CONFIG_RCU_NOCB_CPU */
>
> +extern int rcu_num_nodes;

This should not be necessary given the existing declaration in
kernel/rcu/tree.c way before the #include of kernel/rcu/tree_plugin.h.

Or did you get a build failure without this? (And if you did get a build
failure, I would be really curious how that happened!)

So please send an updated patch or tell me how your build managed to fail.

> +
> /*
> * Check the RCU kernel configuration parameters and print informative
> * messages about anything out of the ordinary. If you like #ifdef, you
> @@ -885,7 +887,7 @@ void synchronize_rcu_expedited(void)
> /* Snapshot current state of ->blkd_tasks lists. */
> rcu_for_each_leaf_node(rsp, rnp)
> sync_rcu_preempt_exp_init(rsp, rnp);
> - if (NUM_RCU_NODES > 1)
> + if (rcu_num_nodes > 1)
> sync_rcu_preempt_exp_init(rsp, rcu_get_root(rsp));
>
> put_online_cpus();
> @@ -1475,7 +1477,7 @@ static void __init rcu_spawn_boost_kthreads(void)
> BUG_ON(smpboot_register_percpu_thread(&rcu_cpu_thread_spec));
> rnp = rcu_get_root(rcu_state_p);
> (void)rcu_spawn_one_boost_kthread(rcu_state_p, rnp);
> - if (NUM_RCU_NODES > 1) {
> + if (rcu_num_nodes > 1) {
> rcu_for_each_leaf_node(rcu_state_p, rnp)
> (void)rcu_spawn_one_boost_kthread(rcu_state_p, rnp);
> }

For whatever it is worth, the reason that this works is that it is a
perforamnce optimzation and NUM_RCU_NODES is always greater than or
equal to num_rcu_nodes. Still, your change is a good one.

Thanx, Paul

2014-07-16 12:47:35

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH 2/3] rcu: Remove stale comment in tree.c

On Tue, Jul 15, 2014 at 06:57:59PM -0400, Pranith Kumar wrote:
>
> On 07/15/2014 06:53 PM, [email protected] wrote:
> > On Tue, Jul 15, 2014 at 06:31:48PM -0400, Pranith Kumar wrote:
> >> This commit removes a stale comment in rcu/tree.c.
> >> FYI, an updated comment exists a few lines below this.
> >>
> >> Signed-off-by: Pranith Kumar <[email protected]>
> > In general, when removing a stale comment, I'd suggest explaining why
> > the comment is stale. Was code removed without removing the
> > corresponding comment, or was code changed such that the comment no
> > longer applies, or...?
>
> I guess it was left out when code was moved around previously. And I did mention that an updated comment is there a few lines below.
>
> For reference this is the new comment which is below the old comment, they mean the same :)
>
> /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */

Indeed that is the case.

Please update the commit log with this explanation and resend.

Thanx, Paul

2014-07-16 13:25:43

by Pranith Kumar

[permalink] [raw]
Subject: Re: [PATCH 3/3] rcu: Use rcu_num_nodes instead of NUM_RCU_NODES

On 07/16/2014 08:45 AM, Paul E. McKenney wrote:
> On Tue, Jul 15, 2014 at 06:31:49PM -0400, Pranith Kumar wrote:
>> NUM_RCU_NODES is set at build time and is usually a huge number. We calculate the
>> actual number of rcu nodes necessary at boot time based on nr_cpu_ids in
>> rcu_init_geometry() and store it in rcu_num_nodes. We should use this variable
>> instead of NUM_RCU_NODES.
>>
>> This commit changes all such uses of NUM_RCU_NODES to rcu_num_nodes.
>>
>> Signed-off-by: Pranith Kumar <[email protected]>
>> ---
>> kernel/rcu/tree_plugin.h | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
>> index cedb020..17ccb62 100644
>> --- a/kernel/rcu/tree_plugin.h
>> +++ b/kernel/rcu/tree_plugin.h
>> @@ -46,6 +46,8 @@ static bool __read_mostly rcu_nocb_poll; /* Offload kthread are to poll. */
>> static char __initdata nocb_buf[NR_CPUS * 5];
>> #endif /* #ifdef CONFIG_RCU_NOCB_CPU */
>>
>> +extern int rcu_num_nodes;
>
> This should not be necessary given the existing declaration in
> kernel/rcu/tree.c way before the #include of kernel/rcu/tree_plugin.h.
>
> Or did you get a build failure without this? (And if you did get a build
> failure, I would be really curious how that happened!)
>
> So please send an updated patch or tell me how your build managed to fail.
>

Indeed. The extern was unnecessary. Please find an updated patch below.

--
Pranith

From: Pranith Kumar <[email protected]>
Date: Wed, 16 Jul 2014 09:21:49 -0400
Subject: [PATCH 1/1] rcu: Use rcu_num_nodes instead of NUM_RCU_NODES

NUM_RCU_NODES is set at build time and is usually a huge number. We calculate the
actual number of rcu nodes necessary at boot time based on nr_cpu_ids in
rcu_init_geometry() and store it in rcu_num_nodes. We should use this variable
instead of NUM_RCU_NODES.

This commit changes all such uses of NUM_RCU_NODES to rcu_num_nodes.

Signed-off-by: Pranith Kumar <[email protected]>
---
kernel/rcu/tree_plugin.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index cedb020..b99055a 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -885,7 +885,7 @@ void synchronize_rcu_expedited(void)
/* Snapshot current state of ->blkd_tasks lists. */
rcu_for_each_leaf_node(rsp, rnp)
sync_rcu_preempt_exp_init(rsp, rnp);
- if (NUM_RCU_NODES > 1)
+ if (rcu_num_nodes > 1)
sync_rcu_preempt_exp_init(rsp, rcu_get_root(rsp));

put_online_cpus();
@@ -1475,7 +1475,7 @@ static void __init rcu_spawn_boost_kthreads(void)
BUG_ON(smpboot_register_percpu_thread(&rcu_cpu_thread_spec));
rnp = rcu_get_root(rcu_state_p);
(void)rcu_spawn_one_boost_kthread(rcu_state_p, rnp);
- if (NUM_RCU_NODES > 1) {
+ if (rcu_num_nodes > 1) {
rcu_for_each_leaf_node(rcu_state_p, rnp)
(void)rcu_spawn_one_boost_kthread(rcu_state_p, rnp);
}
--
1.9.1

2014-07-16 13:28:58

by Pranith Kumar

[permalink] [raw]
Subject: Re: [PATCH 2/3] rcu: Remove stale comment in tree.c

On 07/16/2014 08:47 AM, Paul E. McKenney wrote:
> On Tue, Jul 15, 2014 at 06:57:59PM -0400, Pranith Kumar wrote:
>>
>> On 07/15/2014 06:53 PM, [email protected] wrote:
>>> On Tue, Jul 15, 2014 at 06:31:48PM -0400, Pranith Kumar wrote:
>>>> This commit removes a stale comment in rcu/tree.c.
>>>> FYI, an updated comment exists a few lines below this.
>>>>
>>>> Signed-off-by: Pranith Kumar <[email protected]>
>>> In general, when removing a stale comment, I'd suggest explaining why
>>> the comment is stale. Was code removed without removing the
>>> corresponding comment, or was code changed such that the comment no
>>> longer applies, or...?
>>
>> I guess it was left out when code was moved around previously. And I did mention that an updated comment is there a few lines below.
>>
>> For reference this is the new comment which is below the old comment, they mean the same :)
>>
>> /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */
>
> Indeed that is the case.
>
> Please update the commit log with this explanation and resend.
>
> Thanx, Paul
>

Please find the updated patch below.

--
Pranith

From: Pranith Kumar <[email protected]>
Date: Mon, 14 Jul 2014 16:01:05 -0400
Subject: [PATCH 2/3] rcu: Remove stale comment in tree.c

This commit removes a stale comment in rcu/tree.c which was left out when some
code was moved around previously.

For reference, the following updated comment exists a few lines below this which
means the same.

/* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */

Signed-off-by: Pranith Kumar <[email protected]>
---
kernel/rcu/tree.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index a1abaa8..e67246e 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -2211,8 +2211,6 @@ static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp)
/* Adjust any no-longer-needed kthreads. */
rcu_boost_kthread_setaffinity(rnp, -1);

- /* Remove the dead CPU from the bitmasks in the rcu_node hierarchy. */
-
/* Exclude any attempts to start a new grace period. */
mutex_lock(&rsp->onoff_mutex);
raw_spin_lock_irqsave(&rsp->orphan_lock, flags);
--
1.9.1

2014-07-16 23:32:36

by Josh Triplett

[permalink] [raw]
Subject: Re: [PATCH 2/3] rcu: Remove stale comment in tree.c

On Wed, Jul 16, 2014 at 09:29:18AM -0400, Pranith Kumar wrote:
> On 07/16/2014 08:47 AM, Paul E. McKenney wrote:
> > On Tue, Jul 15, 2014 at 06:57:59PM -0400, Pranith Kumar wrote:
> >>
> >> On 07/15/2014 06:53 PM, [email protected] wrote:
> >>> On Tue, Jul 15, 2014 at 06:31:48PM -0400, Pranith Kumar wrote:
> >>>> This commit removes a stale comment in rcu/tree.c.
> >>>> FYI, an updated comment exists a few lines below this.
> >>>>
> >>>> Signed-off-by: Pranith Kumar <[email protected]>
> >>> In general, when removing a stale comment, I'd suggest explaining why
> >>> the comment is stale. Was code removed without removing the
> >>> corresponding comment, or was code changed such that the comment no
> >>> longer applies, or...?
> >>
> >> I guess it was left out when code was moved around previously. And I did mention that an updated comment is there a few lines below.
> >>
> >> For reference this is the new comment which is below the old comment, they mean the same :)
> >>
> >> /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */
> >
> > Indeed that is the case.
> >
> > Please update the commit log with this explanation and resend.
> >
> > Thanx, Paul
> >
>
> Please find the updated patch below.
>
> --
> Pranith
>
> From: Pranith Kumar <[email protected]>
> Date: Mon, 14 Jul 2014 16:01:05 -0400
> Subject: [PATCH 2/3] rcu: Remove stale comment in tree.c
>
> This commit removes a stale comment in rcu/tree.c which was left out when some
> code was moved around previously.
>
> For reference, the following updated comment exists a few lines below this which
> means the same.
>
> /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */
>
> Signed-off-by: Pranith Kumar <[email protected]>

Reviewed-by: Josh Triplett <[email protected]>

> kernel/rcu/tree.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index a1abaa8..e67246e 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -2211,8 +2211,6 @@ static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp)
> /* Adjust any no-longer-needed kthreads. */
> rcu_boost_kthread_setaffinity(rnp, -1);
>
> - /* Remove the dead CPU from the bitmasks in the rcu_node hierarchy. */
> -
> /* Exclude any attempts to start a new grace period. */
> mutex_lock(&rsp->onoff_mutex);
> raw_spin_lock_irqsave(&rsp->orphan_lock, flags);
> --
> 1.9.1
>

2014-07-17 00:54:10

by Lai Jiangshan

[permalink] [raw]
Subject: Re: [PATCH 2/3] rcu: Remove stale comment in tree.c

On 07/16/2014 09:29 PM, Pranith Kumar wrote:
> On 07/16/2014 08:47 AM, Paul E. McKenney wrote:
>> On Tue, Jul 15, 2014 at 06:57:59PM -0400, Pranith Kumar wrote:
>>>
>>> On 07/15/2014 06:53 PM, [email protected] wrote:
>>>> On Tue, Jul 15, 2014 at 06:31:48PM -0400, Pranith Kumar wrote:
>>>>> This commit removes a stale comment in rcu/tree.c.
>>>>> FYI, an updated comment exists a few lines below this.
>>>>>
>>>>> Signed-off-by: Pranith Kumar <[email protected]>
>>>> In general, when removing a stale comment, I'd suggest explaining why
>>>> the comment is stale. Was code removed without removing the
>>>> corresponding comment, or was code changed such that the comment no
>>>> longer applies, or...?
>>>
>>> I guess it was left out when code was moved around previously. And I did mention that an updated comment is there a few lines below.
>>>
>>> For reference this is the new comment which is below the old comment, they mean the same :)
>>>
>>> /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */
>>
>> Indeed that is the case.
>>
>> Please update the commit log with this explanation and resend.
>>
>> Thanx, Paul
>>
>
> Please find the updated patch below.
>
> --
> Pranith
>
> From: Pranith Kumar <[email protected]>
> Date: Mon, 14 Jul 2014 16:01:05 -0400
> Subject: [PATCH 2/3] rcu: Remove stale comment in tree.c
>
> This commit removes a stale comment in rcu/tree.c which was left out when some
> code was moved around previously.

Which commit caused this leftover comment? Could you mention that commit in
your changlog?

12BitsCmmtID ("commit title...")

>
> For reference, the following updated comment exists a few lines below this which
> means the same.
>
> /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */
>
> Signed-off-by: Pranith Kumar <[email protected]>
> ---
> kernel/rcu/tree.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index a1abaa8..e67246e 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -2211,8 +2211,6 @@ static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp)
> /* Adjust any no-longer-needed kthreads. */
> rcu_boost_kthread_setaffinity(rnp, -1);
>
> - /* Remove the dead CPU from the bitmasks in the rcu_node hierarchy. */
> -
> /* Exclude any attempts to start a new grace period. */
> mutex_lock(&rsp->onoff_mutex);
> raw_spin_lock_irqsave(&rsp->orphan_lock, flags);

2014-07-17 01:01:31

by Pranith Kumar

[permalink] [raw]
Subject: Re: [PATCH 2/3] rcu: Remove stale comment in tree.c

On 07/16/2014 08:55 PM, Lai Jiangshan wrote:
> On 07/16/2014 09:29 PM, Pranith Kumar wrote:
>> On 07/16/2014 08:47 AM, Paul E. McKenney wrote:
>>> On Tue, Jul 15, 2014 at 06:57:59PM -0400, Pranith Kumar wrote:
>>>>
>>>> On 07/15/2014 06:53 PM, [email protected] wrote:
>>>>> On Tue, Jul 15, 2014 at 06:31:48PM -0400, Pranith Kumar wrote:
>>>>>> This commit removes a stale comment in rcu/tree.c.
>>>>>> FYI, an updated comment exists a few lines below this.
>>>>>>
>>>>>> Signed-off-by: Pranith Kumar <[email protected]>
>>>>> In general, when removing a stale comment, I'd suggest explaining why
>>>>> the comment is stale. Was code removed without removing the
>>>>> corresponding comment, or was code changed such that the comment no
>>>>> longer applies, or...?
>>>>
>>>> I guess it was left out when code was moved around previously. And I did mention that an updated comment is there a few lines below.
>>>>
>>>> For reference this is the new comment which is below the old comment, they mean the same :)
>>>>
>>>> /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */
>>>
>>> Indeed that is the case.
>>>
>>> Please update the commit log with this explanation and resend.
>>>
>>> Thanx, Paul
>>>
>>
>> Please find the updated patch below.
>>
>> --
>> Pranith
>>
>> From: Pranith Kumar <[email protected]>
>> Date: Mon, 14 Jul 2014 16:01:05 -0400
>> Subject: [PATCH 2/3] rcu: Remove stale comment in tree.c
>>
>> This commit removes a stale comment in rcu/tree.c which was left out when some
>> code was moved around previously.
>
> Which commit caused this leftover comment? Could you mention that commit in
> your changlog?
>
> 12BitsCmmtID ("commit title...")
>

Sure, please find an updated patch with Josh Triplett's sign-off added:

From: Pranith Kumar <[email protected]>
Date: Mon, 14 Jul 2014 16:01:05 -0400
Subject: [PATCH 2/3] rcu: Remove stale comment in tree.c


This commit removes a stale comment in rcu/tree.c which was left out in
commit 2036d94a7b61ca5032ce (rcu: Rework detection of use of RCU by offline CPUs)

For reference, the following updated comment exists a few lines below this which
means the same.

/* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */

Signed-off-by: Pranith Kumar <[email protected]>
Reviewed-by: Joe Tripplett <[email protected]>
---
kernel/rcu/tree.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index a1abaa8..e67246e 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -2211,8 +2211,6 @@ static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp)
/* Adjust any no-longer-needed kthreads. */
rcu_boost_kthread_setaffinity(rnp, -1);

- /* Remove the dead CPU from the bitmasks in the rcu_node hierarchy. */
-
/* Exclude any attempts to start a new grace period. */
mutex_lock(&rsp->onoff_mutex);
raw_spin_lock_irqsave(&rsp->orphan_lock, flags);
--
1.9.1

2014-07-17 01:24:16

by Lai Jiangshan

[permalink] [raw]
Subject: Re: [PATCH 2/3] rcu: Remove stale comment in tree.c

On 07/17/2014 09:01 AM, Pranith Kumar wrote:
> On 07/16/2014 08:55 PM, Lai Jiangshan wrote:
>> On 07/16/2014 09:29 PM, Pranith Kumar wrote:
>>> On 07/16/2014 08:47 AM, Paul E. McKenney wrote:
>>>> On Tue, Jul 15, 2014 at 06:57:59PM -0400, Pranith Kumar wrote:
>>>>>
>>>>> On 07/15/2014 06:53 PM, [email protected] wrote:
>>>>>> On Tue, Jul 15, 2014 at 06:31:48PM -0400, Pranith Kumar wrote:
>>>>>>> This commit removes a stale comment in rcu/tree.c.
>>>>>>> FYI, an updated comment exists a few lines below this.
>>>>>>>
>>>>>>> Signed-off-by: Pranith Kumar <[email protected]>
>>>>>> In general, when removing a stale comment, I'd suggest explaining why
>>>>>> the comment is stale. Was code removed without removing the
>>>>>> corresponding comment, or was code changed such that the comment no
>>>>>> longer applies, or...?
>>>>>
>>>>> I guess it was left out when code was moved around previously. And I did mention that an updated comment is there a few lines below.
>>>>>
>>>>> For reference this is the new comment which is below the old comment, they mean the same :)
>>>>>
>>>>> /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */
>>>>
>>>> Indeed that is the case.
>>>>
>>>> Please update the commit log with this explanation and resend.
>>>>
>>>> Thanx, Paul
>>>>
>>>
>>> Please find the updated patch below.
>>>
>>> --
>>> Pranith
>>>
>>> From: Pranith Kumar <[email protected]>
>>> Date: Mon, 14 Jul 2014 16:01:05 -0400
>>> Subject: [PATCH 2/3] rcu: Remove stale comment in tree.c
>>>
>>> This commit removes a stale comment in rcu/tree.c which was left out when some
>>> code was moved around previously.
>>
>> Which commit caused this leftover comment? Could you mention that commit in
>> your changlog?
>>
>> 12BitsCmmtID ("commit title...")
>>
>
> Sure, please find an updated patch with Josh Triplett's sign-off added:
>
> From: Pranith Kumar <[email protected]>
> Date: Mon, 14 Jul 2014 16:01:05 -0400
> Subject: [PATCH 2/3] rcu: Remove stale comment in tree.c
>
>
> This commit removes a stale comment in rcu/tree.c which was left out in
> commit 2036d94a7b61ca5032ce (rcu: Rework detection of use of RCU by offline CPUs)

I suggest you use the following syntax in future.

2036d94a7b61 ("rcu: Rework detection of use of RCU by offline CPUs")

>
> For reference, the following updated comment exists a few lines below this which
> means the same.
>
> /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */
>
> Signed-off-by: Pranith Kumar <[email protected]>
> Reviewed-by: Joe Tripplett <[email protected]>

Reviewed-by: Lai Jiangshan <[email protected]>

> ---
> kernel/rcu/tree.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index a1abaa8..e67246e 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -2211,8 +2211,6 @@ static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp)
> /* Adjust any no-longer-needed kthreads. */
> rcu_boost_kthread_setaffinity(rnp, -1);
>
> - /* Remove the dead CPU from the bitmasks in the rcu_node hierarchy. */
> -
> /* Exclude any attempts to start a new grace period. */
> mutex_lock(&rsp->onoff_mutex);
> raw_spin_lock_irqsave(&rsp->orphan_lock, flags);

2014-07-17 01:26:18

by Pranith Kumar

[permalink] [raw]
Subject: Re: [PATCH 2/3] rcu: Remove stale comment in tree.c

On 07/16/2014 09:25 PM, Lai Jiangshan wrote:
> On 07/17/2014 09:01 AM, Pranith Kumar wrote:
>> On 07/16/2014 08:55 PM, Lai Jiangshan wrote:
>>> On 07/16/2014 09:29 PM, Pranith Kumar wrote:
>>>> On 07/16/2014 08:47 AM, Paul E. McKenney wrote:
>>>>> On Tue, Jul 15, 2014 at 06:57:59PM -0400, Pranith Kumar wrote:
>>>>>>
>>>>>> On 07/15/2014 06:53 PM, [email protected] wrote:
>>>>>>> On Tue, Jul 15, 2014 at 06:31:48PM -0400, Pranith Kumar wrote:
>>>>>>>> This commit removes a stale comment in rcu/tree.c.
>>>>>>>> FYI, an updated comment exists a few lines below this.
>>>>>>>>
>>>>>>>> Signed-off-by: Pranith Kumar <[email protected]>
>>>>>>> In general, when removing a stale comment, I'd suggest explaining why
>>>>>>> the comment is stale. Was code removed without removing the
>>>>>>> corresponding comment, or was code changed such that the comment no
>>>>>>> longer applies, or...?
>>>>>>
>>>>>> I guess it was left out when code was moved around previously. And I did mention that an updated comment is there a few lines below.
>>>>>>
>>>>>> For reference this is the new comment which is below the old comment, they mean the same :)
>>>>>>
>>>>>> /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */
>>>>>
>>>>> Indeed that is the case.
>>>>>
>>>>> Please update the commit log with this explanation and resend.
>>>>>
>>>>> Thanx, Paul
>>>>>
>>>>
>>>> Please find the updated patch below.
>>>>
>>>> --
>>>> Pranith
>>>>
>>>> From: Pranith Kumar <[email protected]>
>>>> Date: Mon, 14 Jul 2014 16:01:05 -0400
>>>> Subject: [PATCH 2/3] rcu: Remove stale comment in tree.c
>>>>
>>>> This commit removes a stale comment in rcu/tree.c which was left out when some
>>>> code was moved around previously.
>>>
>>> Which commit caused this leftover comment? Could you mention that commit in
>>> your changlog?
>>>
>>> 12BitsCmmtID ("commit title...")
>>>
>>
>> Sure, please find an updated patch with Josh Triplett's sign-off added:
>>
>> From: Pranith Kumar <[email protected]>
>> Date: Mon, 14 Jul 2014 16:01:05 -0400
>> Subject: [PATCH 2/3] rcu: Remove stale comment in tree.c
>>
>>
>> This commit removes a stale comment in rcu/tree.c which was left out in
>> commit 2036d94a7b61ca5032ce (rcu: Rework detection of use of RCU by offline CPUs)
>
> I suggest you use the following syntax in future.
>
> 2036d94a7b61 ("rcu: Rework detection of use of RCU by offline CPUs")
>

OK. I will do that from now on. Thanks! :)

--
Pranith

>>
>> For reference, the following updated comment exists a few lines below this which
>> means the same.
>>
>> /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */
>>
>> Signed-off-by: Pranith Kumar <[email protected]>
>> Reviewed-by: Joe Tripplett <[email protected]>
>
> Reviewed-by: Lai Jiangshan <[email protected]>
>
>> ---
>> kernel/rcu/tree.c | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
>> index a1abaa8..e67246e 100644
>> --- a/kernel/rcu/tree.c
>> +++ b/kernel/rcu/tree.c
>> @@ -2211,8 +2211,6 @@ static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp)
>> /* Adjust any no-longer-needed kthreads. */
>> rcu_boost_kthread_setaffinity(rnp, -1);
>>
>> - /* Remove the dead CPU from the bitmasks in the rcu_node hierarchy. */
>> -
>> /* Exclude any attempts to start a new grace period. */
>> mutex_lock(&rsp->onoff_mutex);
>> raw_spin_lock_irqsave(&rsp->orphan_lock, flags);
>

2014-07-17 02:14:17

by Josh Triplett

[permalink] [raw]
Subject: Re: [PATCH 2/3] rcu: Remove stale comment in tree.c

On Wed, Jul 16, 2014 at 09:01:52PM -0400, Pranith Kumar wrote:
> Sure, please find an updated patch with Josh Triplett's sign-off added:

It appears to have a reviewed-by from someone named "Joe Tripplett"
instead. ;)

> From: Pranith Kumar <[email protected]>
> Date: Mon, 14 Jul 2014 16:01:05 -0400
> Subject: [PATCH 2/3] rcu: Remove stale comment in tree.c
>
>
> This commit removes a stale comment in rcu/tree.c which was left out in
> commit 2036d94a7b61ca5032ce (rcu: Rework detection of use of RCU by offline CPUs)
>
> For reference, the following updated comment exists a few lines below this which
> means the same.
>
> /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */
>
> Signed-off-by: Pranith Kumar <[email protected]>
> Reviewed-by: Joe Tripplett <[email protected]>
> ---
> kernel/rcu/tree.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index a1abaa8..e67246e 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -2211,8 +2211,6 @@ static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp)
> /* Adjust any no-longer-needed kthreads. */
> rcu_boost_kthread_setaffinity(rnp, -1);
>
> - /* Remove the dead CPU from the bitmasks in the rcu_node hierarchy. */
> -
> /* Exclude any attempts to start a new grace period. */
> mutex_lock(&rsp->onoff_mutex);
> raw_spin_lock_irqsave(&rsp->orphan_lock, flags);
> --
> 1.9.1
>

2014-07-17 02:20:11

by Pranith Kumar

[permalink] [raw]
Subject: Re: [PATCH 2/3] rcu: Remove stale comment in tree.c

On 07/16/2014 10:14 PM, Josh Triplett wrote:
> On Wed, Jul 16, 2014 at 09:01:52PM -0400, Pranith Kumar wrote:
>> Sure, please find an updated patch with Josh Triplett's sign-off added:
>
> It appears to have a reviewed-by from someone named "Joe Tripplett"
> instead. ;)
>

I apologize for fat-fingering this.
Since I've sent one too many emails in this thread already, I suppose on more can not do much harm :)

This time with Reviewed-by Lai Jiangshan added and Reviewed-by Josh Triplett corrected.

From: Pranith Kumar <[email protected]>
Date: Mon, 14 Jul 2014 16:01:05 -0400
Subject: [PATCH 2/3] rcu: Remove stale comment in tree.c

This commit removes a stale comment in rcu/tree.c which was left out when some
code was moved around previously in the commit

2036d94a7b61 ("rcu: Rework detection of use of RCU by offline CPUs")

For reference, the following updated comment exists a few lines below this which
means the same.

/* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */

Signed-off-by: Pranith Kumar <[email protected]>
Reviewed-by: Josh Triplett <[email protected]>
Reviewed-by: Lai Jiangshan <[email protected]>
---
kernel/rcu/tree.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index a1abaa8..e67246e 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -2211,8 +2211,6 @@ static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp)
/* Adjust any no-longer-needed kthreads. */
rcu_boost_kthread_setaffinity(rnp, -1);

- /* Remove the dead CPU from the bitmasks in the rcu_node hierarchy. */
-
/* Exclude any attempts to start a new grace period. */
mutex_lock(&rsp->onoff_mutex);
raw_spin_lock_irqsave(&rsp->orphan_lock, flags);
--
1.9.1

2014-07-17 23:34:03

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH 2/3] rcu: Remove stale comment in tree.c

On Wed, Jul 16, 2014 at 10:20:33PM -0400, Pranith Kumar wrote:
> On 07/16/2014 10:14 PM, Josh Triplett wrote:
> > On Wed, Jul 16, 2014 at 09:01:52PM -0400, Pranith Kumar wrote:
> >> Sure, please find an updated patch with Josh Triplett's sign-off added:
> >
> > It appears to have a reviewed-by from someone named "Joe Tripplett"
> > instead. ;)
> >
>
> I apologize for fat-fingering this.
> Since I've sent one too many emails in this thread already, I suppose on more can not do much harm :)
>
> This time with Reviewed-by Lai Jiangshan added and Reviewed-by Josh Triplett corrected.
>
> From: Pranith Kumar <[email protected]>
> Date: Mon, 14 Jul 2014 16:01:05 -0400
> Subject: [PATCH 2/3] rcu: Remove stale comment in tree.c
>
> This commit removes a stale comment in rcu/tree.c which was left out when some
> code was moved around previously in the commit
>
> 2036d94a7b61 ("rcu: Rework detection of use of RCU by offline CPUs")
>
> For reference, the following updated comment exists a few lines below this which
> means the same.
>
> /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */
>
> Signed-off-by: Pranith Kumar <[email protected]>
> Reviewed-by: Josh Triplett <[email protected]>
> Reviewed-by: Lai Jiangshan <[email protected]>

Queued for 3.18, thank you all!

Thanx, Paul

> ---
> kernel/rcu/tree.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index a1abaa8..e67246e 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -2211,8 +2211,6 @@ static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp)
> /* Adjust any no-longer-needed kthreads. */
> rcu_boost_kthread_setaffinity(rnp, -1);
>
> - /* Remove the dead CPU from the bitmasks in the rcu_node hierarchy. */
> -
> /* Exclude any attempts to start a new grace period. */
> mutex_lock(&rsp->onoff_mutex);
> raw_spin_lock_irqsave(&rsp->orphan_lock, flags);
> --
> 1.9.1
>
>