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 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.

Thanks,

--
Jiri Kosina
SUSE Labs

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