Re: [PATCH] sched: introduce configurable delay before entering idle

From: Marcelo Tosatti
Date: Tue May 07 2019 - 19:46:04 EST


On Wed, May 08, 2019 at 12:15:19AM +0200, Peter Zijlstra wrote:
> On Tue, May 07, 2019 at 03:56:49PM -0300, Marcelo Tosatti wrote:
> >
> > Certain workloads perform poorly on KVM compared to baremetal
> > due to baremetal's ability to perform mwait on NEED_RESCHED
> > bit of task flags (therefore skipping the IPI).
> >
> > This patch introduces a configurable busy-wait delay before entering the
> > architecture delay routine, allowing wakeup IPIs to be skipped
> > (if the IPI happens in that window).
> >
> > The real-life workload which this patch improves performance
> > is SAP HANA (by 5-10%) (for which case setting idle_spin to 30
> > is sufficient).
> >
> > This patch improves the attached server.py and client.py example
> > as follows:
> >
> > Host: 31.814230202231556
> > Guest: 38.17718765199993 (83 %)
> > Guest, idle_spin=50us: 33.317709898000004 (95 %)
> > Guest, idle_spin=220us: 32.27826551499999 (98 %)
> >
> > Signed-off-by: Marcelo Tosatti <mtosatti@xxxxxxxxxx>
>
> Thanks for the CC..
>
> NAK, this is something that should live in a virt idle governor or
> something along those lines.

Ok, makes sense, will rework the patch!