Re: ptrace && fpu_lazy_restore

From: Linus Torvalds
Date: Sun Apr 15 2012 - 19:47:08 EST


On Sun, Apr 15, 2012 at 4:42 PM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> That one is done by design. That fpu_counter=0 in copy_thread() is
> there explicitly to avoid the problem. Although it's possible that we
> should reset last_cpu instead. However, that line was actually added
> before the lazy thing - see commit cea20ca3f318.

Put another way: I do think it would be a good idea to do the "reset
last_cpu" in copy_thread() too. It doesn't really cost us anything,
and it's cleaner to always just make sure that last_cpu is "valid"
(even if the fpu_owner_task is *also* used to invalidate it, and even
if we never use the lazy restore if fpu_counter is zero and thus
fpu.preload isn't set).

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