Linux RCU subsystem development
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: Neeraj Upadhyay <neeraju@codeaurora.org>
Cc: josh@joshtriplett.org, rostedt@goodmis.org,
	mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com,
	rcu@vger.kernel.org
Subject: Re: [PATCH] rcu/tree: Default jiffies_to_sched_qs to jiffies_till_sched_qs
Date: Mon, 11 Mar 2019 08:19:47 -0700	[thread overview]
Message-ID: <20190311151947.GA8862@linux.ibm.com> (raw)
In-Reply-To: <20190311151854.GG13351@linux.ibm.com>

This time keeping the CC list...

							Thanx, Paul

On Mon, Mar 11, 2019 at 08:18:54AM -0700, Paul E. McKenney wrote:
> On Mon, Mar 11, 2019 at 03:16:11PM +0530, Neeraj Upadhyay wrote:
> > Current code does not call adjust_jiffies_till_sched_qs(),
> > if jiffies_till_sched_qs is specified. For the case, where
> > jiffies_till_first_fqs and jiffies_till_next_fqs are default,
> > jiffies_to_sched_qs won't be a correct adjustment of
> > jiffies_till_sched_qs.
> > 
> > Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
> 
> Good catch!  Queued and pushed.  Please see below for updated
> commit log.  On future patches, could you please first describe
> the problem and consequences, then what the fix is?  This approach
> makes it much easier for people later on who will be trying to
> figure out what is going on, and who might or might not have much
> understanding of RCU.  (For example, they might be doing a bisection
> or some such.)
> 
> Not a big deal, as I can touch this up, but a good habit to get into.
> 
> And no, rcutorture currently does not specify non-default values
> for jiffies_till_sched_qs.  Which should probably be fixed.  I could
> make rcu_implicit_dynticks_qs() complain if jiffies_to_sched_qs is
> zero, but that feels a bit hacky and specific.  :-/
> 
> 							Thanx, Paul
> 
> ------------------------------------------------------------------------
> 
> commit ee474b85fa0815be940ed89a91e0d84a110a0a92
> Author: Neeraj Upadhyay <neeraju@codeaurora.org>
> Date:   Mon Mar 11 15:16:11 2019 +0530
> 
>     rcu: Default jiffies_to_sched_qs to jiffies_till_sched_qs
>     
>     The current code only calls adjust_jiffies_till_sched_qs() if
>     jiffies_till_sched_qs is left at its default value, so when the
>     jiffies_till_sched_qs kernel-boot parameter actually is specified,
>     jiffies_to_sched_qs will be left with the value zero, which
>     will result in useless slowdowns of cond_resched().  This commit
>     therefore changes rcu_init_geometry() to unconditionally invoke
>     adjust_jiffies_till_sched_qs(), which ensures that jiffies_to_sched_qs
>     will be initialized in all cases, thus maintaining good cond_resched()
>     performance.
>     
>     Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
>     Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
> 
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index ddd5c74e386b..10aeb89395ea 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -3259,8 +3259,7 @@ static void __init rcu_init_geometry(void)
>  		jiffies_till_first_fqs = d;
>  	if (jiffies_till_next_fqs == ULONG_MAX)
>  		jiffies_till_next_fqs = d;
> -	if (jiffies_till_sched_qs == ULONG_MAX)
> -		adjust_jiffies_till_sched_qs();
> +	adjust_jiffies_till_sched_qs();
>  
>  	/* If the compile-time values are accurate, just leave. */
>  	if (rcu_fanout_leaf == RCU_FANOUT_LEAF &&


  parent reply	other threads:[~2019-03-11 15:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11  9:46 [PATCH] rcu/tree: Default jiffies_to_sched_qs to jiffies_till_sched_qs Neeraj Upadhyay
     [not found] ` <20190311151854.GG13351@linux.ibm.com>
2019-03-11 15:19   ` Paul E. McKenney [this message]
2019-03-11 17:35     ` Joel Fernandes
2019-03-11 22:47       ` Paul E. McKenney
2019-03-12 14:07         ` Joel Fernandes

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=20190311151947.GA8862@linux.ibm.com \
    --to=paulmck@linux.ibm.com \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=neeraju@codeaurora.org \
    --cc=rcu@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox