All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] srcu: Remove dead code in srcu_gp_end()
@ 2018-02-14  9:05 Byungchul Park
  2018-02-14 15:00 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Byungchul Park @ 2018-02-14  9:05 UTC (permalink / raw)
  To: jiangshanlai, paulmck, josh, rostedt, mathieu.desnoyers
  Cc: linux-kernel, kernel-team

Of course, compilers will optimize out a dead code. Anyway, remove
any dead code for better readibility.

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
---
 kernel/rcu/srcutree.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index 44bc0fa..829453b 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -531,7 +531,6 @@ static void srcu_gp_end(struct srcu_struct *sp)
 	unsigned long flags;
 	unsigned long gpseq;
 	int idx;
-	int idxnext;
 	unsigned long mask;
 	struct srcu_data *sdp;
 	struct srcu_node *snp;
@@ -555,7 +554,6 @@ static void srcu_gp_end(struct srcu_struct *sp)
 
 	/* Initiate callback invocation as needed. */
 	idx = rcu_seq_ctr(gpseq) % ARRAY_SIZE(snp->srcu_have_cbs);
-	idxnext = (idx + 1) % ARRAY_SIZE(snp->srcu_have_cbs);
 	rcu_for_each_node_breadth_first(sp, snp) {
 		spin_lock_irq_rcu_node(snp);
 		cbs = false;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] srcu: Remove dead code in srcu_gp_end()
  2018-02-14  9:05 [PATCH] srcu: Remove dead code in srcu_gp_end() Byungchul Park
@ 2018-02-14 15:00 ` Steven Rostedt
  2018-02-14 22:18   ` Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2018-02-14 15:00 UTC (permalink / raw)
  To: Byungchul Park
  Cc: jiangshanlai, paulmck, josh, mathieu.desnoyers, linux-kernel,
	kernel-team

On Wed, 14 Feb 2018 18:05:24 +0900
Byungchul Park <byungchul.park@lge.com> wrote:

> Of course, compilers will optimize out a dead code. Anyway, remove
> any dead code for better readibility.
> 
> Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> ---
>  kernel/rcu/srcutree.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
> index 44bc0fa..829453b 100644
> --- a/kernel/rcu/srcutree.c
> +++ b/kernel/rcu/srcutree.c
> @@ -531,7 +531,6 @@ static void srcu_gp_end(struct srcu_struct *sp)
>  	unsigned long flags;
>  	unsigned long gpseq;
>  	int idx;
> -	int idxnext;

Interesting. According to git history, idxnext was never actually used.

Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

>  	unsigned long mask;
>  	struct srcu_data *sdp;
>  	struct srcu_node *snp;
> @@ -555,7 +554,6 @@ static void srcu_gp_end(struct srcu_struct *sp)
>  
>  	/* Initiate callback invocation as needed. */
>  	idx = rcu_seq_ctr(gpseq) % ARRAY_SIZE(snp->srcu_have_cbs);
> -	idxnext = (idx + 1) % ARRAY_SIZE(snp->srcu_have_cbs);
>  	rcu_for_each_node_breadth_first(sp, snp) {
>  		spin_lock_irq_rcu_node(snp);
>  		cbs = false;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] srcu: Remove dead code in srcu_gp_end()
  2018-02-14 15:00 ` Steven Rostedt
@ 2018-02-14 22:18   ` Paul E. McKenney
  0 siblings, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2018-02-14 22:18 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Byungchul Park, jiangshanlai, josh, mathieu.desnoyers,
	linux-kernel, kernel-team

On Wed, Feb 14, 2018 at 10:00:54AM -0500, Steven Rostedt wrote:
> On Wed, 14 Feb 2018 18:05:24 +0900
> Byungchul Park <byungchul.park@lge.com> wrote:
> 
> > Of course, compilers will optimize out a dead code. Anyway, remove
> > any dead code for better readibility.
> > 
> > Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> > ---
> >  kernel/rcu/srcutree.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
> > index 44bc0fa..829453b 100644
> > --- a/kernel/rcu/srcutree.c
> > +++ b/kernel/rcu/srcutree.c
> > @@ -531,7 +531,6 @@ static void srcu_gp_end(struct srcu_struct *sp)
> >  	unsigned long flags;
> >  	unsigned long gpseq;
> >  	int idx;
> > -	int idxnext;
> 
> Interesting. According to git history, idxnext was never actually used.

Which raises the question of what I intended to do with it.  Reviewing
that function didn't activate any memories, though it did point out a
candidate simplification.

> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Applied, thank you both!

							Thanx, Paul

> -- Steve
> 
> >  	unsigned long mask;
> >  	struct srcu_data *sdp;
> >  	struct srcu_node *snp;
> > @@ -555,7 +554,6 @@ static void srcu_gp_end(struct srcu_struct *sp)
> >  
> >  	/* Initiate callback invocation as needed. */
> >  	idx = rcu_seq_ctr(gpseq) % ARRAY_SIZE(snp->srcu_have_cbs);
> > -	idxnext = (idx + 1) % ARRAY_SIZE(snp->srcu_have_cbs);
> >  	rcu_for_each_node_breadth_first(sp, snp) {
> >  		spin_lock_irq_rcu_node(snp);
> >  		cbs = false;
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-14 22:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-14  9:05 [PATCH] srcu: Remove dead code in srcu_gp_end() Byungchul Park
2018-02-14 15:00 ` Steven Rostedt
2018-02-14 22:18   ` Paul E. McKenney

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.