public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Li, Aubrey" <aubrey.li@linux.intel.com>
To: paulmck@linux.vnet.ibm.com
Cc: Peter Zijlstra <peterz@infradead.org>,
	Andi Kleen <ak@linux.intel.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Christoph Lameter <cl@linux.com>, Aubrey Li <aubrey.li@intel.com>,
	tglx@linutronix.de, len.brown@intel.com, rjw@rjwysocki.net,
	tim.c.chen@linux.intel.com, arjan@linux.intel.com,
	yang.zhang.wz@gmail.com, x86@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods
Date: Mon, 17 Jul 2017 21:24:51 +0800	[thread overview]
Message-ID: <f598b9df-b7ba-6abc-622b-089f1d00a3ce@linux.intel.com> (raw)
In-Reply-To: <20170714040553.GR2393@linux.vnet.ibm.com>

On 2017/7/14 12:05, Paul E. McKenney wrote:
>
> More specifically: rcu_needs_cpu(), rcu_prepare_for_idle(),
> rcu_cleanup_after_idle(), rcu_eqs_enter(), rcu_eqs_enter_common(),
> rcu_dynticks_eqs_enter(), do_nocb_deferred_wakeup(),
> rcu_dynticks_task_enter(), rcu_eqs_exit(), rcu_eqs_exit_common(),
> rcu_dynticks_task_exit(), rcu_dynticks_eqs_exit().
>
> The first three (rcu_needs_cpu(), rcu_prepare_for_idle(), and
> rcu_cleanup_after_idle()) should not be significant unless you have
> CONFIG_RCU_FAST_NO_HZ=y.  If you do, it would be interesting to learn
> how often invoke_rcu_core() is invoked from rcu_prepare_for_idle()
> and rcu_cleanup_after_idle(), as this can raise softirq.  Also
> rcu_accelerate_cbs() and rcu_try_advance_all_cbs().
>
> Knowing which of these is causing the most trouble might help me
> reduce the overhead in the current idle path.

I measured two cases, nothing notable found.

The one is CONFIG_NO_HZ_IDLE=y, so the following function is just empty.

rcu_prepare_for_idle():         NULL
rcu_cleanup_after_idle():       NULL
do_nocb_deferred_wakeup():      NULL
rcu_dynticks_task_enter():      NULL
rcu_dynticks_task_exit():       NULL

And the following functions are traced separately, for each function I
traced 3 times by intel_PT, for each time the sampling period is 1-second.
num means the times the function is invoked in 1-second. (min, max, avg) is
the function duration, the unit is nano-second. 

rcu_needs_cpu():
1) num: 6110    min: 3  max: 564        avg: 17.0
2) num: 16535   min: 3  max: 683        avg: 18.0
3) num: 8815    min: 3  max: 394        avg: 20.0

rcu_eqs_enter():
1) num: 7956    min: 17 max: 656        avg: 32.0
2) num: 9170    min: 17 max: 1075       avg: 35.0
3) num: 8604    min: 17 max: 859        avg: 29.0

rcu_eqs_enter_common():
1) num: 14676   min: 15 max: 620        avg: 28.0
2) num: 11180   min: 15 max: 795        avg: 30.0
3) num: 11484   min: 15 max: 725        avg: 29.0

rcu_dynticks_eqs_enter():
1) num: 11035   min: 10 max: 580        avg: 17.0
2) num: 15518   min: 10 max: 456        avg: 16.0
3) num: 15320   min: 10 max: 454        avg: 19.0

rcu_eqs_exit():
1) num: 11080   min: 14 max: 893        avg: 23.0
2) num: 13526   min: 14 max: 640        avg: 23.0
3) num: 12534   min: 14 max: 630        avg: 22.0

rcu_eqs_exit_common():
1) num: 18002   min: 12 max: 553        avg: 17.0
2) num: 10570   min: 11 max: 485        avg: 17.0
3) num: 13628   min: 11 max: 567        avg: 16.0

rcu_dynticks_eqs_exit():
1) num: 11195   min: 11 max: 436        avg: 16.0
2) num: 11808   min: 10 max: 506        avg: 16.0
3) num: 8132    min: 10 max: 546        avg: 15.0

==============================================================================

The other case is CONFIG_NO_HZ_FULL, I also enabled the required config to make
all the functions not empty.

rcu_needs_cpu():
1) num: 8530    min: 5  max: 770        avg: 13.0
2) num: 9965    min: 5  max: 518        avg: 12.0
3) num: 12503   min: 5  max: 755        avg: 16.0

rcu_prepare_for_idle():
1) num: 11662   min: 5  max: 684        avg: 9.0
2) num: 15294   min: 5  max: 676        avg: 9.0
3) num: 14332   min: 5  max: 524        avg: 9.0

rcu_cleanup_after_idle():
1) num: 13584   min: 4  max: 657        avg: 6.0
2) num: 9102    min: 4  max: 529        avg: 5.0
3) num: 10648   min: 4  max: 471        avg: 6.0

rcu_eqs_enter():
1) num: 14222   min: 26 max: 745        avg: 54.0
2) num: 12502   min: 26 max: 650        avg: 53.0
3) num: 11834   min: 26 max: 863        avg: 52.0

rcu_eqs_enter_common():
1) num: 16792   min: 24 max: 973        avg: 43.0
2) num: 19755   min: 24 max: 898        avg: 45.0
3) num: 8167    min: 24 max: 722        avg: 42.0

rcu_dynticks_eqs_enter():
1) num: 11605   min: 10 max: 532        avg: 14.0
2) num: 10438   min: 9  max: 554        avg: 14.0
3) num: 19816   min: 9  max: 701        avg: 14.0

do_nocb_deferred_wakeup():
1) num: 15348   min: 1  max: 459        avg: 3.0
2) num: 12822   min: 1  max: 564        avg: 4.0
3) num: 8272    min: 0  max: 458        avg: 3.0

rcu_dynticks_task_enter():
1) num: 6358    min: 1  max: 268        avg: 1.0
2) num: 11128   min: 1  max: 360        avg: 1.0
3) num: 20516   min: 1  max: 214        avg: 1.0

rcu_eqs_exit():
1) num: 16117   min: 20 max: 782        avg: 43.0
2) num: 11042   min: 20 max: 775        avg: 47.0
3) num: 16499   min: 20 max: 752        avg: 46.0

rcu_eqs_exit_common():
1) num: 12584   min: 17 max: 703        avg: 28.0
2) num: 17412   min: 17 max: 759        avg: 28.0
3) num: 16733   min: 17 max: 798        avg: 29.0

rcu_dynticks_task_exit():
1) num: 11730   min: 1  max: 528        avg: 4.0
2) num: 18840   min: 1  max: 581        avg: 5.0
3) num: 9815    min: 1  max: 381        avg: 4.0

rcu_dynticks_eqs_exit():
1) num: 10902   min: 9  max: 557        avg: 13.0
2) num: 19474   min: 9  max: 563        avg: 13.0
3) num: 11865   min: 9  max: 672        avg: 12.0

Please let me know if there is some data not reasonable, I can revisit again.

Thanks,
-Aubrey

  reply	other threads:[~2017-07-17 13:24 UTC|newest]

Thread overview: 114+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10  1:38 [RFC PATCH v1 00/11] Create fast idle path for short idle periods Aubrey Li
2017-07-10  1:38 ` [RFC PATCH v1 01/11] sched/idle: create a fast " Aubrey Li
2017-07-10  1:38 ` [RFC PATCH v1 02/11] cpuidle: attach cpuidle governor statistics to the per-CPU device Aubrey Li
2017-07-10  1:38 ` [RFC PATCH v1 03/11] cpuidle: introduce cpuidle governor for idle prediction Aubrey Li
2017-07-12 12:16   ` Peter Zijlstra
2017-07-10  1:38 ` [RFC PATCH v1 04/11] sched/idle: make the fast idle path for short idle periods Aubrey Li
2017-07-11 12:58   ` Paul E. McKenney
2017-07-11 16:33     ` Frederic Weisbecker
2017-07-11 18:11       ` Paul E. McKenney
2017-07-12  3:19         ` Li, Aubrey
2017-07-12  5:03           ` Paul E. McKenney
2017-07-12  5:22             ` Li, Aubrey
2017-07-12 12:19       ` Peter Zijlstra
2017-07-10  1:38 ` [RFC PATCH v1 05/11] cpuidle: update idle statistics before cpuidle governor Aubrey Li
2017-07-10  1:38 ` [RFC PATCH v1 06/11] timers: keep sleep length updated as needed Aubrey Li
2017-07-10  1:38 ` [RFC PATCH v1 07/11] cpuidle: make idle residency update more generic Aubrey Li
2017-07-10  1:38 ` [RFC PATCH v1 08/11] cpuidle: menu: remove reduplicative implementation Aubrey Li
2017-07-10  1:38 ` [RFC PATCH v1 09/11] cpuidle: menu: feed cpuidle prediction to menu governor Aubrey Li
2017-07-10  1:38 ` [RFC PATCH v1 10/11] cpuidle: update cpuidle governor when needed Aubrey Li
2017-07-10  1:38 ` [RFC PATCH v1 11/11] sched/idle: Add a tuning knob to allow changing fast idle threshold Aubrey Li
2017-07-10  8:46 ` [RFC PATCH v1 00/11] Create fast idle path for short idle periods Peter Zijlstra
2017-07-10  9:29   ` Wanpeng Li
2017-07-10 13:59   ` Li, Aubrey
2017-07-10 14:46   ` Andi Kleen
2017-07-10 16:42     ` Peter Zijlstra
2017-07-10 17:27       ` Andi Kleen
2017-07-11  4:40         ` Li, Aubrey
2017-07-11  9:41           ` Peter Zijlstra
2017-07-11 16:09             ` Frederic Weisbecker
2017-07-11 16:34               ` Peter Zijlstra
2017-07-11 18:09                 ` Paul E. McKenney
2017-07-12 11:54                   ` Peter Zijlstra
2017-07-12 15:56                     ` Paul E. McKenney
2017-07-12 17:46                       ` Peter Zijlstra
2017-07-12 18:53                         ` Paul E. McKenney
2017-07-12 19:00                           ` Paul E. McKenney
2017-07-19 13:43                       ` Frederic Weisbecker
2017-07-19 14:51                         ` Paul E. McKenney
2017-07-12 12:22                   ` Peter Zijlstra
2017-07-12 15:54                     ` Paul E. McKenney
2017-07-12 17:17                       ` Peter Zijlstra
2017-07-12 17:57                         ` Peter Zijlstra
2017-07-12 18:50                           ` Paul E. McKenney
2017-07-12 18:46                         ` Paul E. McKenney
2017-07-13  8:34                           ` Peter Zijlstra
2017-07-12  4:15                 ` Li, Aubrey
2017-07-12  8:34                   ` Peter Zijlstra
2017-07-12 21:32                     ` Andi Kleen
2017-07-13  8:36                       ` Peter Zijlstra
2017-07-13 14:48                         ` Li, Aubrey
2017-07-13 14:53                           ` Peter Zijlstra
2017-07-13 15:13                             ` Li, Aubrey
2017-07-13 18:28                               ` Peter Zijlstra
2017-07-14  3:56                                 ` Li, Aubrey
2017-07-14 15:38                                   ` Peter Zijlstra
2017-07-14 15:52                                     ` Arjan van de Ven
2017-07-14 15:58                                       ` Peter Zijlstra
2017-07-14 16:03                                         ` Andi Kleen
2017-07-17  9:21                                           ` Peter Zijlstra
2017-07-17 13:41                                             ` Li, Aubrey
2017-07-14 15:53                                     ` Andi Kleen
2017-07-14 16:06                                       ` Peter Zijlstra
2017-07-14 16:26                                         ` Andi Kleen
2017-07-17 19:23                                           ` Peter Zijlstra
2017-07-17 19:27                                             ` Arjan van de Ven
2017-07-17 19:46                                               ` Thomas Gleixner
2017-07-17 19:51                                                 ` Arjan van de Ven
2017-07-17 19:59                                                   ` Thomas Gleixner
2017-07-17 19:48                                             ` Arjan van de Ven
2017-07-17 19:53                                               ` Thomas Gleixner
2017-07-17 19:55                                                 ` Arjan van de Ven
2017-07-18  3:23                                               ` Li, Aubrey
2017-07-18 18:55                                               ` Peter Zijlstra
2017-07-18  3:14                                             ` Li, Aubrey
2017-07-18  4:45                                               ` Andi Kleen
2017-07-18  6:43                                                 ` Thomas Gleixner
2017-07-18  6:56                                                   ` Li, Aubrey
2017-07-18 15:20                                                     ` Paul E. McKenney
2017-07-18 15:29                                                       ` Arjan van de Ven
2017-07-18 16:36                                                         ` Peter Zijlstra
2017-07-18 16:37                                                           ` Arjan van de Ven
2017-07-18 17:05                                                             ` Peter Zijlstra
2017-07-19  5:44                                                       ` Li, Aubrey
2017-07-19 14:48                                                         ` Paul E. McKenney
2017-07-19 15:03                                                           ` Christopher Lameter
2017-07-19 16:54                                                             ` Paul E. McKenney
2017-07-20  1:40                                                           ` Li, Aubrey
2017-07-20 12:50                                                             ` Paul E. McKenney
2017-07-20 13:45                                                               ` Arjan van de Ven
2017-07-20 14:19                                                               ` Peter Zijlstra
2017-07-20 16:02                                                                 ` Paul E. McKenney
2017-07-18 16:45                                                     ` Peter Zijlstra
2017-07-18  6:59                                                   ` Andi Kleen
2017-07-18  7:19                                                     ` Thomas Gleixner
2017-07-19  6:12                                                       ` Li, Aubrey
2017-07-19  7:55                                                         ` Thomas Gleixner
2017-07-20  1:56                                                           ` Li, Aubrey
2017-07-20  8:11                                                             ` Thomas Gleixner
2017-07-20 13:48                                                               ` Arjan van de Ven
2017-07-18  7:24                                                     ` Thomas Gleixner
2017-07-18 13:23                                               ` Peter Zijlstra
2017-07-19 13:43                                               ` Peter Zijlstra
2017-07-13 15:20                             ` Paul E. McKenney
2017-07-14  3:47                               ` Li, Aubrey
2017-07-14  4:05                                 ` Paul E. McKenney
2017-07-17 13:24                                   ` Li, Aubrey [this message]
2017-07-17 13:58                                     ` Peter Zijlstra
2017-07-17 14:02                                       ` Li, Aubrey
2017-07-12 12:14                   ` Peter Zijlstra
2017-07-11 17:58               ` Christoph Lameter
2017-07-12  2:07                 ` Li, Aubrey
2017-07-12  2:35               ` Li, Aubrey
2017-07-12 18:10               ` Peter Zijlstra
2017-07-11  9:02         ` Peter Zijlstra

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=f598b9df-b7ba-6abc-622b-089f1d00a3ce@linux.intel.com \
    --to=aubrey.li@linux.intel.com \
    --cc=ak@linux.intel.com \
    --cc=arjan@linux.intel.com \
    --cc=aubrey.li@intel.com \
    --cc=cl@linux.com \
    --cc=fweisbec@gmail.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=x86@kernel.org \
    --cc=yang.zhang.wz@gmail.com \
    /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