Re: [PATCH 1/2] coredump: flush the fpu exit state for propermulti-threaded core dump

From: Suresh Siddha
Date: Mon May 07 2012 - 16:05:32 EST


On Mon, 2012-05-07 at 12:15 -0700, Linus Torvalds wrote:
> On Mon, May 7, 2012 at 12:07 PM, Suresh Siddha
> <suresh.b.siddha@xxxxxxxxx> wrote:
> >
> > Fix this by explicitly flushing the fpu state in do_exit() by calling
> > prepare_to_copy()
>
> Ugh, I hate this one.
>
> We're making the exit path more expensive for almost no gain. The FPU
> state is dead in 99.9% of all cases.
>
> Why isn't this a core-dump-only case?
>

Today we do this unlazy_fpu() (which is what prepare_to_copy does)
already as part of the first schedule() in the exit path. I am just
making it explicit by calling prepare_to_copy() before exit_mm() which
synchronizes all the threads before the first thread goes with the core
dump.

I don't think I am adding any more cost to the existing path, unless I
am missing something.

thanks,
suresh

--
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/