On Wed, 27 May 2015, yoma sophian wrote: > After reading the kernel power document, freezing-of-tasks.txt , can I > get the below conclusion: > if I put my thread in freezable, it will get frozen automatically > whenever the system goes in to suspend or hibernate. It's not entirely automatic. Your thread has to call try_to_freeze() at appropriate spots. Of course, if your thread is a work queue then the workqueue core will do that for you. > And automatically be waked up when all other thread finish their job? No, when the system wakes up. > in my case, since I didn't put my own sd_check_events thread into > freezable case. > once the system resume, it will cause the race condition as I > mentioned previously, right? Yes. > if my conclusion is correct, would you mind to let me know where the > kernel sequencially wake up normal then freezable threads? Threads get frozen and woken up in kernel/power/process.c. The routines are called from suspend_freeze_processes() and suspend_thaw_processes() in kernel/power/suspend.c. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html