Re: [patch 17/24] x86/speculation: Move IBPB control out of switch_mm()

From: Andi Kleen
Date: Wed Nov 21 2018 - 19:01:10 EST


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

-Andi