Hi, I got stuck by btrfs/078 with 1 cpu(2 core) machine. And I notice
this patch maybe the
root cause of it.

commit cb65537ee1134d3cc55c1fa83952bc8eb1212833
Author: David Howells <dhowe...@redhat.com>
Date:   Fri May 10 19:50:26 2013 +0100

    Add wait_on_atomic_t() and wake_up_atomic_t()
<snip>
+/*
+ * To allow interruptible waiting and asynchronous (i.e. nonblocking) waiting,
+ * the actions of __wait_on_atomic_t() are permitted return codes.  Nonzero
+ * return codes halt waiting and return.
+ */
+static __sched
+int __wait_on_atomic_t(wait_queue_head_t *wq, struct wait_bit_queue *q,
+                      int (*action)(atomic_t *), unsigned mode)
+{
+       atomic_t *val;
+       int ret = 0;
+
+       do {
+               prepare_to_wait(wq, &q->wait, mode);
+               val = q->key.flags;
+               if (atomic_read(val) == 0)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^here,
is this judge ok? if the val not 0,

the most thing we want to do is schedule.
+                       ret = (*action)(val);
+       } while (!ret && atomic_read(val) != 0);
+       finish_wait(wq, &q->wait);
+       return ret;
+}

Thanks,
George
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to