Re: [RFC v2 8/8] x86, xsave: remove lazy allocation of xstate area

From: Brian Gerst
Date: Thu Mar 24 2011 - 07:39:18 EST


On Wed, Mar 23, 2011 at 11:27 AM, Hans Rosenfeld <hans.rosenfeld@xxxxxxx> wrote:
> This patch completely removes lazy allocation of the xstate area. All
> tasks will always have an xstate area preallocated, just like they
> already do when non-lazy features are present. The size of the xsave
> area ranges from 112 to 960 bytes, depending on the xstates present and
> enabled. Since it is common to use SSE etc. for optimization, the actual
> overhead is expected to negligible.
>
> This removes some of the special-case handling of non-lazy xstates. It
> also greatly simplifies init_fpu() by removing the allocation code, the
> check for presence of the xstate area or init_fpu() return value.
>
> Signed-off-by: Hans Rosenfeld <hans.rosenfeld@xxxxxxx>

I'm not sure I like this. I did a quick test on 64-bit, and found
that while most if not all user processes allocated the fpu save area
(probably because of glibc blindly initializing the fpu), kernel
threads did not. This patch would force kernel threads to allocate
memory they would never use.

--
Brian Gerst
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/