Messages in this thread | | | From | Linus Torvalds <> | Date | Sun, 15 Apr 2012 16:46:48 -0700 | Subject | Re: ptrace && fpu_lazy_restore |
| |
On Sun, Apr 15, 2012 at 4:42 PM, Linus Torvalds <torvalds@linux-foundation.org> 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
| |