KVM Archive on lore.kernel.org
 help / color / Atom feed
* Re: [PATCH v2] sched/nohz: Optimize get_nohz_timer_target()
       [not found] ` <20190628011012.GA19488@lerouge>
@ 2019-10-23  8:16   ` Wanpeng Li
  2019-10-23  8:29     ` Thomas Gleixner
  0 siblings, 1 reply; 6+ messages in thread
From: Wanpeng Li @ 2019-10-23  8:16 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Ingo Molnar, Peter Zijlstra, Ingo Molnar, kvm, Frederic Weisbecker

On Fri, 28 Jun 2019 at 09:10, Frederic Weisbecker <frederic@kernel.org> wrote:
>
> 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>

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] sched/nohz: Optimize get_nohz_timer_target()
  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
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Gleixner @ 2019-10-23  8:29 UTC (permalink / raw)
  To: Wanpeng Li
  Cc: LKML, Ingo Molnar, Peter Zijlstra, Ingo Molnar, kvm, Frederic Weisbecker

On Wed, 23 Oct 2019, Wanpeng Li wrote:
> 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.

Yeah. It's delayed (again).... Will pick that up.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] sched/nohz: Optimize get_nohz_timer_target()
  2019-10-23  8:29     ` Thomas Gleixner
@ 2019-10-23  9:25       ` Wanpeng Li
  2020-01-06  6:21       ` Wanpeng Li
  1 sibling, 0 replies; 6+ messages in thread
From: Wanpeng Li @ 2019-10-23  9:25 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Ingo Molnar, Peter Zijlstra, Ingo Molnar, kvm, Frederic Weisbecker

On Wed, 23 Oct 2019 at 16:29, Thomas Gleixner <tglx@linutronix.de> wrote:
>
> On Wed, 23 Oct 2019, Wanpeng Li wrote:
> > 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.
>
> Yeah. It's delayed (again).... Will pick that up.

Sorry, you will pick up the patch or refactor? :)

    Wanpeng

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] sched/nohz: Optimize get_nohz_timer_target()
  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
  1 sibling, 1 reply; 6+ messages in thread
From: Wanpeng Li @ 2020-01-06  6:21 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Ingo Molnar, Peter Zijlstra, Ingo Molnar, kvm, Frederic Weisbecker

Hi Thomas,
On Wed, 23 Oct 2019 at 16:29, Thomas Gleixner <tglx@linutronix.de> wrote:
>
> On Wed, 23 Oct 2019, Wanpeng Li wrote:
> > 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.
>
> Yeah. It's delayed (again).... Will pick that up.

I didn't find WIP tag for this work after ~half year since v4 was
posted https://lkml.org/lkml/2019/6/28/231 Could you apply this patch
for temporary because the completion time of refactor is not
deterministic.

    Wanpeng

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] sched/nohz: Optimize get_nohz_timer_target()
  2020-01-06  6:21       ` Wanpeng Li
@ 2020-01-10 14:12         ` Thomas Gleixner
  2020-01-13  1:32           ` Wanpeng Li
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2020-01-10 14:12 UTC (permalink / raw)
  To: Wanpeng Li
  Cc: LKML, Ingo Molnar, Peter Zijlstra, Ingo Molnar, kvm, Frederic Weisbecker

Wanpeng,

Wanpeng Li <kernellwp@gmail.com> writes:

> Hi Thomas,
> On Wed, 23 Oct 2019 at 16:29, Thomas Gleixner <tglx@linutronix.de> wrote:
>>
>> On Wed, 23 Oct 2019, Wanpeng Li wrote:
>> > 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.
>>
>> Yeah. It's delayed (again).... Will pick that up.
>
> I didn't find WIP tag for this work after ~half year since v4 was
> posted https://lkml.org/lkml/2019/6/28/231 Could you apply this patch
> for temporary because the completion time of refactor is not
> deterministic.

Could you please repost it?

Thanks,

        tglx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] sched/nohz: Optimize get_nohz_timer_target()
  2020-01-10 14:12         ` Thomas Gleixner
@ 2020-01-13  1:32           ` Wanpeng Li
  0 siblings, 0 replies; 6+ messages in thread
From: Wanpeng Li @ 2020-01-13  1:32 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Ingo Molnar, Peter Zijlstra, Ingo Molnar, kvm, Frederic Weisbecker

On Fri, 10 Jan 2020 at 22:12, Thomas Gleixner <tglx@linutronix.de> wrote:
>
> Wanpeng,
>
> Wanpeng Li <kernellwp@gmail.com> writes:
>
> > Hi Thomas,
> > On Wed, 23 Oct 2019 at 16:29, Thomas Gleixner <tglx@linutronix.de> wrote:
> >>
> >> On Wed, 23 Oct 2019, Wanpeng Li wrote:
> >> > 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.
> >>
> >> Yeah. It's delayed (again).... Will pick that up.
> >
> > I didn't find WIP tag for this work after ~half year since v4 was
> > posted https://lkml.org/lkml/2019/6/28/231 Could you apply this patch
> > for temporary because the completion time of refactor is not
> > deterministic.
>
> Could you please repost it?

Just repost, thanks Thomas.

    Wanpeng

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1561682593-12071-1-git-send-email-wanpengli@tencent.com>
     [not found] ` <20190628011012.GA19488@lerouge>
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

KVM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kvm/0 kvm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kvm kvm/ https://lore.kernel.org/kvm \
		kvm@vger.kernel.org
	public-inbox-index kvm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.kvm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git