Re: [PATCH 1/7] x86/fpu: Simplify the fpu->last_cpu logic and rename it to fpu->fpregs_cached

From: Rik van Riel
Date: Thu Jan 26 2017 - 09:24:04 EST


On Thu, 2017-01-26 at 12:26 +0100, Ingo Molnar wrote:
>
> @@ -322,6 +308,16 @@ struct fpu {
> Â unsigned char fpregs_active;
> Â
> Â /*
> + Â* @fpregs_cached:
> + Â*
> + Â* This flag tells us whether this context is loaded into a
> CPU
> + Â* right now.

Not quite. You are still checking against fpu_fpregs_owner_ctx.

How about something like

* This flag tells us whether this context was loaded into
* its current CPU; fpu_fpregs_owner_ctx will tell us whether
* this context is actually in the registers.

> + Â*
> + Â* This is set to 0 if a task is migrated to another CPU.
> + Â*/
> + unsigned char fpregs_cached;
> +
> + /*
> Â Â* @state:
> Â Â*
> Â Â* In-memory copy of all FPU registers that we save/restore