From: Frederic Weisbecker <frederic@kernel.org>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v2] sched/nohz: Optimize get_nohz_timer_target()
Date: Fri, 28 Jun 2019 03:10:13 +0200 [thread overview]
Message-ID: <20190628011012.GA19488@lerouge> (raw)
In-Reply-To: <1561682593-12071-1-git-send-email-wanpengli@tencent.com>
On Fri, Jun 28, 2019 at 08:43:12AM +0800, Wanpeng Li wrote:
> From: Wanpeng Li <wanpengli@tencent.com>
>
> On a machine, cpu 0 is used for housekeeping, the other 39 cpus in the
> same socket are in nohz_full mode. We can observe huge time burn in the
> loop for seaching nearest busy housekeeper cpu by ftrace.
>
> 2) | get_nohz_timer_target() {
> 2) 0.240 us | housekeeping_test_cpu();
> 2) 0.458 us | housekeeping_test_cpu();
>
> ...
>
> 2) 0.292 us | housekeeping_test_cpu();
> 2) 0.240 us | housekeeping_test_cpu();
> 2) 0.227 us | housekeeping_any_cpu();
> 2) + 43.460 us | }
>
> This patch optimizes the searching logic by finding a nearest housekeeper
> cpu in the housekeeping cpumask, it can minimize the worst searching time
> from ~44us to < 10us in my testing. In addition, the last iterated busy
> housekeeper can become a random candidate while current CPU is a better
> fallback if it is a housekeeper.
>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Frederic Weisbecker <frederic@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Thanks!
next prev parent reply other threads:[~2019-06-28 1:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-28 0:43 [PATCH v2] sched/nohz: Optimize get_nohz_timer_target() Wanpeng Li
2019-06-28 0:43 ` [PATCH RESEND v3] sched/isolation: Prefer housekeeping cpu in local node Wanpeng Li
2019-06-28 1:18 ` Frederic Weisbecker
2019-06-28 6:58 ` Srikar Dronamraju
2019-06-28 7:19 ` Wanpeng Li
2019-06-28 8:44 ` Srikar Dronamraju
2019-06-28 1:10 ` Frederic Weisbecker [this message]
2019-10-23 8:16 ` [PATCH v2] sched/nohz: Optimize get_nohz_timer_target() Wanpeng Li
2019-10-23 8:29 ` Thomas Gleixner
2019-10-23 9:25 ` Wanpeng Li
2020-01-06 6:21 ` Wanpeng Li
2020-01-10 14:12 ` Thomas Gleixner
2020-01-13 1:32 ` Wanpeng Li
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=20190628011012.GA19488@lerouge \
--to=frederic@kernel.org \
--cc=kernellwp@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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 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.