My attempt to make the comment more explicit.

Signed-off-by: Oleg Nesterov <o...@redhat.com>
---

 include/linux/tracehook.h |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- UTRACE-PTRACE/include/linux/tracehook.h~3_NOTIFY_RESUME_MB_COMMENT  
2009-12-12 16:32:39.000000000 +0100
+++ UTRACE-PTRACE/include/linux/tracehook.h     2009-12-12 17:28:03.000000000 
+0100
@@ -670,9 +670,10 @@ static inline void tracehook_notify_resu
 {
        struct task_struct *task = current;
        /*
-        * This pairs with the barrier implicit in set_notify_resume().
-        * It ensures that we read the nonzero utrace_flags set before
-        * set_notify_resume() was called by utrace setup.
+        * If we race with attach which sets nonzero ->utrace_flags,
+        * make sure we do not read ->utrace_flags before the caller
+        * clears TIF_NOTIFY_RESUME. This pairs with the implicit mb()
+        * before setting TIF_NOTIFY_RESUME in set_notify_resume().
         */
        smp_rmb();
        if (task_utrace_flags(task))

Reply via email to