On Fri, 21 Jun 2013 17:54:04 -0400, "Robert P. J. Day" said:
* The core wakeup function. Non-exclusive wakeups (nr_exclusive == 0) just * wake everything up. If it's an exclusive wakeup (nr_exclusive == small +ve * number) then we wake all the non-exclusive tasks and one exclusive task.
Right. Clear as mud. ;)
list_for_each_entry_safe(curr, next, &q->task_list, task_list) { unsigned flags = curr->flags;
if (curr->func(curr, mode, wake_flags, key) && (flags & WQ_FLAG_EXCLUSIVE) && !--nr_exclusive) break; }
Oh, gotta love this tricky C. When do we actually hit the 'break;'? :)
first, the comment above that function seems wrong -- that routine will not simply wake "one exclusive task", it will wake "int nr_exclusive" exclusive tasks, will it not?
Hand-emulating with 'nr_exclusive == 3' indicates that in fact you're right. Does anybody actually call this with a value other than 1?