complete_all and "forever" completions
From: Dmitry Torokhov
Date: Tue Oct 25 2016 - 18:31:02 EST
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