lkml.org 
[lkml]   [2015]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 1/3] x86, fpu: unlazy_fpu: don't reset thread.fpu_counter
    It is not clear why the "else" branch clears ->fpu_counter, this makes
    no sense.

    If use_eager_fpu() then this has no effect. Otherwise, if we actually
    wanted to prevent fpu preload after the context switch we would need to
    reset it unconditionally, even if __thread_has_fpu().

    Signed-off-by: Oleg Nesterov <oleg@redhat.com>
    ---
    arch/x86/kernel/i387.c | 3 +--
    1 files changed, 1 insertions(+), 2 deletions(-)

    diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
    index 4734865..c3b92c0 100644
    --- a/arch/x86/kernel/i387.c
    +++ b/arch/x86/kernel/i387.c
    @@ -122,8 +122,7 @@ void unlazy_fpu(struct task_struct *tsk)
    if (__thread_has_fpu(tsk)) {
    __save_init_fpu(tsk);
    __thread_fpu_end(tsk);
    - } else
    - tsk->thread.fpu_counter = 0;
    + }
    preempt_enable();
    }
    EXPORT_SYMBOL(unlazy_fpu);
    --
    1.5.5.1



    \
     
     \ /
      Last update: 2015-01-29 22:21    [W:4.087 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site