On Wed, Nov 09, 2011 at 09:06:57AM -0800, Tejun Heo wrote: > Ah, crap, still waking up. Sorry about that. So, yes, there's a race > condition above. You need to set TASK_INTERRUPTIBLE before testing > freezing and use schedule_timeout() instead of Yep that's the race I was thinking about. I see the wakeup in the no-signal case avoids the race in wait_even_freezable_timeout so that is ok but it'd race if I were just to add try_to_freeze before calling schedule_timeout_interruptible. > schedule_timeout_interruptible(). Was getting confused with > prepare_to_wait(). That said, why not use prepare_to_wait() instead? Because I don't need to wait on a waitqueue there. A THP failure occurred, that caused some CPU overload and it's usually happening at time of heavy VM stress, so I don't want to retry and cause more CPU load from khugepaged until after some time even if more wakeups come by. khugepaged is a very low cost background op, so it shouldn't cause unnecessary CPU usage at times of VM pressure, waiting a better time later is better. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>