[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANRm+CxUpwZ9KwOcQp=Ok64giyjjcJOGb2=zU6vayQzLqYvpXQ@mail.gmail.com>
Date: Wed, 23 Oct 2019 16:16:55 +0800
From: Wanpeng Li <kernellwp@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, kvm <kvm@...r.kernel.org>,
Frederic Weisbecker <frederic@...nel.org>
Subject: Re: [PATCH v2] sched/nohz: Optimize get_nohz_timer_target()
On Fri, 28 Jun 2019 at 09:10, Frederic Weisbecker <frederic@...nel.org> wrote:
>
> On Fri, Jun 28, 2019 at 08:43:12AM +0800, Wanpeng Li wrote:
> > From: Wanpeng Li <wanpengli@...cent.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@...hat.com>
> > Cc: Peter Zijlstra <peterz@...radead.org>
> > Cc: Frederic Weisbecker <frederic@...nel.org>
> > Cc: Thomas Gleixner <tglx@...utronix.de>
> > Signed-off-by: Wanpeng Li <wanpengli@...cent.com>
>
> Reviewed-by: Frederic Weisbecker <frederic@...nel.org>
Hi Thomas,
I didn't see your refactor to get_nohz_timer_target() which you
mentioned in IRC after four months, I can observe cyclictest drop from
4~5us to 8us in kvm guest(we offload the lapic timer emulation to
housekeeping cpu to avoid timer fire external interrupt on the pCPU
which vCPU resident incur a vCPU vmexit) w/o this patch in the case of
there is no busy housekeeping cpu. The score can be recovered after I
give stress to create a busy housekeeping cpu.
Could you consider applying this patch for temporary since I'm not
sure when the refactor can be ready.
Wanpeng
Powered by blists - more mailing lists