From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wjsJs5hNGzDqFH for ; Thu, 8 Jun 2017 14:05:17 +1000 (AEST) In-Reply-To: <1496439810-11240-1-git-send-email-leitao@debian.org> To: Breno Leitao , linuxppc-dev@lists.ozlabs.org From: Michael Ellerman Cc: Breno Leitao , Gustavo Romero Subject: Re: powerpc/kernel: improve FP and vector registers restoration Message-Id: <3wjsJs4LQLz9sCX@ozlabs.org> Date: Thu, 8 Jun 2017 14:05:17 +1000 (AEST) List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, 2017-06-02 at 21:43:30 UTC, Breno Leitao wrote: > 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 > Signed-off-by: Gustavo Romero > Acked-by: Anton Blanchard Applied to powerpc fixes, thanks. https://git.kernel.org/powerpc/c/1195892c091a15cc862f4e202482a3 cheers