linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* complete_all and "forever" completions
@ 2016-10-25 22:30 Dmitry Torokhov
  2016-10-26  8:45 ` Peter Zijlstra
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Torokhov @ 2016-10-25 22:30 UTC (permalink / raw)
  To: LKML; +Cc: Peter Zijlstra, Tejun Heo, computersforpeace

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-10-27 14:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-25 22:30 complete_all and "forever" completions Dmitry Torokhov
2016-10-26  8:45 ` Peter Zijlstra
2016-10-26  9:15   ` Nicholas Mc Guire
2016-10-27  9:51     ` Daniel Wagner
2016-10-26 12:10   ` Dmitry Torokhov
2016-10-26 15:42     ` Peter Zijlstra
2016-10-26 15:46       ` Peter Zijlstra
2016-10-26 17:12       ` Nicholas Mc Guire
2016-10-26 17:20         ` Dmitry Torokhov
2016-10-26 18:23       ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).