lkml.org 
[lkml]   [2019]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND PATCH v6 04/12] x86/fsgsbase/64: Enable FSGSBASE instructions in the helper functions
On Mon, 25 Mar 2019, Thomas Gleixner wrote:
> The whole point of FSGSBASE support is performance, right?
>
> So can please someone explain why having the following in the context
> switch path when it can be completely avoided is enhancing performance:
>
> - 4 x SWAPGS
> - 1 x RDMSR
> - 1 x WRMSR

Corrrecting myself. That should be:

RDGSBASE
WRGSBASE

obviously. Still the point remains.

> - 2 x local_irq_save()
> - 2 x local_irq_restore()
>
> Of course the local_irq_save/restore() pairs are utterly pointless because
> switch_to() runs with interrupts disabled already.
>
> SWAPGS instead needs:
>
> 1 x WRMSR
>
> and nothing else.
>
> So trading the single WRMSR against the above in the context switch path is
> gaining performance, right?
>
> The only thing which gains performance is user space switching GS. And this
> user space performance gain is achieved by:
>
> - Inconsistent and fragile code with a guarantee for subtle and hard to
> diagnose bugs
>
> - Pointless overhead in the context switch code
>
> Sorry, not going to happen ever.
>
> Get your act together and make this consistent. Either SWAPGS or FSGSBASE,
> but not a mix of it.
>
> Thanks,
>
> tglx
>

\
 
 \ /
  Last update: 2019-03-25 13:47    [W:0.099 / U:4.528 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site