[PATCH] powerpc/kernel: improve FP and vector registers restoration
Michael Ellerman
mpe at ellerman.id.au
Mon Jun 5 15:59:28 AEST 2017
Breno Leitao <leitao at debian.org> writes:
> Currently tsk->thread->load_vec and load_fp are not initialized during a
> task creation, which set garbage to these variables (non-zero value).
>
> These variables will be checked later at restore_math() to validate if the
> FP and vectors are being utilized. Since these values might be non-zero,
> the restore_math() will continue to save the FP and vectors even if they
> were never utilized before the userspace application. load_fp and load_vec
> counters will then overflow and the FP and Altivec will be finally
> disabled, but before that condition is reached (counter overflow) several
> context switches restored FP and vector registers without need, causing a
> performance degradation.
>
> Signed-off-by: Breno Leitao <leitao at debian.org>
> Signed-off-by: Gustavo Romero <gusbromero at gmail.com>
Thanks, I tweaked the wording a little and added:
Fixes: 70fe3d980f5f ("powerpc: Restore FPU/VEC/VSX if previously used")
Cc: stable at vger.kernel.org # v4.6+
cheers
More information about the Linuxppc-dev
mailing list