freezer: Document task_lock in thaw_process
Subsystems (3)
PATCH 1/1 freezer: Document task_lock in thaw_process
From: Rafael J. Wysocki <[email protected]>
The task_lock() in include/linux/freezer.h:thaw_process() looks as though it were protecting p->flags, which is not the case. Add a comment that explains why it's there.
Signed-off-by Rafael J. Wysocki <[email protected]>
--- include/linux/freezer.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/linux/freezer.h +6 -0
@@ -37,6 +37,12 @@ static inline void do_not_freeze(struct/* * Wake up a frozen process +* +* task_lock() is taken to prevent the race with refrigerator() which may +* occur if the freezing of tasks fails. Namely, without the lock, if the +* freezing of tasks failed, thaw_tasks() might have run before a task in +* refrigerator() could call frozen_process(), in which case the task would be +* frozen and no one would thaw it. */ static inline int thaw_process (struct task_struct *p) {
Quoted 7 lines · Rafael J. Wysocki
From: Rafael J. Wysocki <[email protected]>
The
task_lock()in include/linux/freezer.h:thaw_process() looks as though it were protectingp->flags, which is not the case. Add a comment that explains why it's there.Signed-off-by Rafael J. Wysocki <[email protected]>
ACK.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html