Messages in this thread | | | Date | Tue, 25 Oct 2016 15:30:54 -0700 | From | Dmitry Torokhov <> | Subject | complete_all and "forever" completions |
| |
Hi,
Reading Documentation/scheduler/completion.txt, complete_all() is supposed to be usable with "forever" completions, i.e. when we have an action that happens once and stays "done" for the rest of lifetime of an object, no matter how many times we check for "doneness". However the implementation for complete_all() simply sets the counter to be greater or equal UINT_MAX/2 and do_wait_for_common() happily decreases it on every call.
Is it simply an artefact of [older] implementation where we do not expect to make that many calls to wait_for_completion*() so that completion that is signalled with ocmplete_all() is practically stays signalled forever? Or do we need something like this in do_wait_for_common():
if (x->done < UINT_MAX/2) x->done--;
Thanks.
-- Dmitry
| |