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 <[email protected]>
Attachment:
stopmachine_state_volatile_2.6.15_rc3.patch
Description: stopmachine_state_volatile_2.6.15_rc3.patch
- Follow-Ups:
- Re: [BUG] Variable stopmachine_state should be volatile
- From: Arjan van de Ven <[email protected]>
- Re: [BUG] Variable stopmachine_state should be volatile
- From: Pavel Machek <[email protected]>
- Re: [BUG] Variable stopmachine_state should be volatile
- Prev by Date: Re: [RFC][PATCH] Runtime switching of the idle function [take 2]
- Next by Date: Re: [PATCH] shrinks dentry struct
- Previous by thread: MPlayer problems with kernel 2.6.15-rc3
- Next by thread: Re: [BUG] Variable stopmachine_state should be volatile
- Index(es):