Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1527294 > unrolled thread

Re: [PATCH 2/2] rcu: Force resched_cpu when jiffies >= rcu_state.jiffies_resched

Started byByungchul Park <byungchul.park@lge.com>
First post2016-11-22 09:20 +0100
Last post2016-11-25 09:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 2/2] rcu: Force resched_cpu when jiffies >=  rcu_state.jiffies_resched Byungchul Park <byungchul.park@lge.com> - 2016-11-22 09:20 +0100
    Re: [PATCH 2/2] rcu: Force resched_cpu when jiffies >=  rcu_state.jiffies_resched "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-25 09:40 +0100

#1527294 — Re: [PATCH 2/2] rcu: Force resched_cpu when jiffies >= rcu_state.jiffies_resched

FromByungchul Park <byungchul.park@lge.com>
Date2016-11-22 09:20 +0100
SubjectRe: [PATCH 2/2] rcu: Force resched_cpu when jiffies >= rcu_state.jiffies_resched
Message-ID<sGet4-4Fo-17@gated-at.bofh.it>
On Wed, Nov 09, 2016 at 03:32:15PM +0900, Byungchul Park wrote:
> Currently rcu code forces CPU into scheduler when jiffies >=
> rcu_state.gp_start + jiffies_till_sched_qs, via resched_cpu().
> 
> It would be better to force CPU into scheduler when jiffies >=
> rcu_state.jiffies_resched, too.

Hello,

I think these two patches are necessary to call resched_cpu() even in
case of jiffies >= rcu_state.jiffies_resched, too. Am I wrong?

It would be appriciated if you let me know if I was wrong.

Thank you,
Byungchul

> 
> Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> ---
>  kernel/rcu/tree.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index d8e8859..287f468 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1217,11 +1217,10 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp,
>  				   READ_ONCE(*rcrmp) + rdp->rsp->flavor_mask);
>  		}
>  		rdp->rsp->jiffies_resched += 5; /* Re-enable beating. */
> -	}
>  
> -	/* And if it has been a really long time, kick the CPU as well. */
> -	if (ULONG_CMP_GE(jiffies, rdp->rsp->gp_start + jiffies_till_sched_qs))
> +		/* And if it has been a really long time, kick the CPU as well. */
>  		resched_cpu(rdp->cpu);  /* Force CPU into scheduler. */
> +	}
>  
>  	return 0;
>  }
> -- 
> 1.9.1

[toc] | [next] | [standalone]


#1529885

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2016-11-25 09:40 +0100
Message-ID<sHkd5-6Ft-47@gated-at.bofh.it>
In reply to#1527294
On Tue, Nov 22, 2016 at 05:12:20PM +0900, Byungchul Park wrote:
> On Wed, Nov 09, 2016 at 03:32:15PM +0900, Byungchul Park wrote:
> > Currently rcu code forces CPU into scheduler when jiffies >=
> > rcu_state.gp_start + jiffies_till_sched_qs, via resched_cpu().
> > 
> > It would be better to force CPU into scheduler when jiffies >=
> > rcu_state.jiffies_resched, too.
> 
> Hello,
> 
> I think these two patches are necessary to call resched_cpu() even in
> case of jiffies >= rcu_state.jiffies_resched, too. Am I wrong?
> 
> It would be appriciated if you let me know if I was wrong.

My current thought is that both the "if" statement and the call to
resched_cpu() should be removed, but I am still testing and working
through the timing.

Either way, I do very much appreciate your having called my attention
to this code!

							Thanx, Paul

> Thank you,
> Byungchul
> 
> > 
> > Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> > ---
> >  kernel/rcu/tree.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > index d8e8859..287f468 100644
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> > @@ -1217,11 +1217,10 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp,
> >  				   READ_ONCE(*rcrmp) + rdp->rsp->flavor_mask);
> >  		}
> >  		rdp->rsp->jiffies_resched += 5; /* Re-enable beating. */
> > -	}
> >  
> > -	/* And if it has been a really long time, kick the CPU as well. */
> > -	if (ULONG_CMP_GE(jiffies, rdp->rsp->gp_start + jiffies_till_sched_qs))
> > +		/* And if it has been a really long time, kick the CPU as well. */
> >  		resched_cpu(rdp->cpu);  /* Force CPU into scheduler. */
> > +	}
> >  
> >  	return 0;
> >  }
> > -- 
> > 1.9.1
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web