[BUG] Variable stopmachine_state should be volatile

From: Zhang, Yanmin (yanmin.zhang_at_intel.com)
Date: 11/30/05

  • Next message: Paul Jackson: "Re: [PATCH] shrinks dentry struct"
    Date:	Wed, 30 Nov 2005 10:04:20 +0800
    To: <linux-kernel@vger.kernel.org>
    
    
    

    The model to access variable stopmachine_state is that a main thread
    writes it and other threads read it. Its declaration has no sign
    volatile. In the while loop in function stopmachine, this variable is
    read, and compiler might optimize it by reading it once before the loop
    and not reading it again in the loop, so the thread might enter dead
    loop.

    Here is the patch to fix it.

    Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com>

    
    

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



  • Next message: Paul Jackson: "Re: [PATCH] shrinks dentry struct"

    Relevant Pages