lkml.org 
[lkml]   [2018]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 17/24] x86/speculation: Move IBPB control out of switch_mm()
On Thu, 22 Nov 2018, Jiri Kosina wrote:
> On Wed, 21 Nov 2018, Andi Kleen wrote:
>
> > > + * This could be optimized by keeping track of the last
> > > + * user task per cpu and avoiding the barrier when the task
> > > + * is immediately scheduled back and the thread inbetween
> > > + * was a kernel thread. It's dubious whether that'd be
> > > + * worth the extra load/store and conditional operations.
> > > + * Keep it optimized for the common case where the TIF bit
> > > + * is not set.
> > > + */
> >
> > The optimization was there before and you removed it?
> >
> > It's quite important for switching to idle and back. With your variant short IOs
> > that do short idle waits will be badly impacted.
>
> The question is what scenario to optimize for.
>
> Either you penalize everybody in the default prctl+seccomp setup
> (irrespective of it's TIF flag value), as you have the extra overhead on
> each and every switch_to() (to check exactly for this back-to-back
> scheduling), or you penalize only those tasks that are penalized anyway by
> the IBPB flush.
>
> I think the latter (which is what this patch implements) makes more sense.

That was my rationale. The back to back thing makes sense for unconditional
mode, but not so much for the prctl/seccomp case which is default.

In unconditional mode we could add the extra overhead, but then performance
is down the drain already with STIBP.

Thanks,

tglx



\
 
 \ /
  Last update: 2018-11-22 10:18    [W:0.397 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site