diff options
author | Andy Lutomirski <luto@kernel.org> | 2019-05-08 13:02:22 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2019-06-22 12:38:52 +0300 |
commit | 1ab5f3f7fe3d7548b4361b68c1fed140c6841af9 (patch) | |
tree | b7750b7eb78f164a5c9874fcf3cd21e5194af92d /tools/perf/scripts/python/export-to-sqlite.py | |
parent | a86b4625138d39e97b4cc254fc9c4bb9e1dc4542 (diff) | |
download | linux-1ab5f3f7fe3d7548b4361b68c1fed140c6841af9.tar.xz |
x86/process/64: Use FSBSBASE in switch_to() if available
With the new FSGSBASE instructions, FS and GSABSE can be efficiently read
and writen in __switch_to(). Use that capability to preserve the full
state.
This will enable user code to do whatever it wants with the new
instructions without any kernel-induced gotchas. (There can still be
architectural gotchas: movl %gs,%eax; movl %eax,%gs may change GSBASE if
WRGSBASE was used, but users are expected to read the CPU manual before
doing things like that.)
This is a considerable speedup. It seems to save about 100 cycles
per context switch compared to the baseline 4.6-rc1 behavior on a
Skylake laptop.
[ chang: 5~10% performance improvements were seen with a context switch
benchmark that ran threads with different FS/GSBASE values (to the
baseline 4.16). Minor edit on the changelog. ]
[ tglx: Masaage changelog ]
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: Ravi Shankar <ravi.v.shankar@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Link: https://lkml.kernel.org/r/1557309753-24073-8-git-send-email-chang.seok.bae@intel.com
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions