public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: peterz@infradead.org, hofrat@osadl.org,
	torvalds@linux-foundation.org, john.garry@huawei.com,
	tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:sched/core] sched/completions/Documentation: Clean up the document some more
Date: Fri, 12 Oct 2018 00:06:31 +0200	[thread overview]
Message-ID: <20181011220631.GB128397@gmail.com> (raw)
In-Reply-To: <tip-0c373344b5c1eaa9e186368a32a169a2802be3ca@git.kernel.org>


hi Nicholas,

I was wondering about this paragraph:

> Using on-stack completions for code that calls any of the _timeout or
> _interruptible/_killable variants is not advisable as they will require
> additional synchronization to prevent the on-stack completion object in
> the timeout/signal cases from going out of scope. Consider using dynamically
> allocated completions when intending to use the _interruptible/_killable
> or _timeout variants of wait_for_completion().

What exact race related to _timeout()/_interruptible() waits and on-stack
completions were you trying to highlight here?

Is it the fact that if a signal is already pending for the current task,
that the _interruptible() variant might return prematurely, while any
kthread that has the completion pointer passed to it might still be using
it?

In that case the kthread should indeed be waited for.

How would a dynamically allocated completion object help in this case - or do
you mean a refcounted dynamic object?

A specific example might be useful here, instead of this rather vague,
generic description.

Thanks,

	Ingo

  reply	other threads:[~2018-10-11 22:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 14:56 [PATCH] docs/completion.txt: Fix a couple of punctuation nits John Garry
2018-10-10 15:47 ` Randy Dunlap
2018-10-11  8:39 ` [tip:sched/core] sched/completions/Documentation: " tip-bot for John Garry
2018-10-11  8:40 ` [tip:sched/core] sched/completions/Documentation: Clean up the document some more tip-bot for Ingo Molnar
2018-10-11 22:06   ` Ingo Molnar [this message]
2018-10-11 15:29 ` [PATCH] docs/completion.txt: Fix a couple of punctuation nits Matthew Wilcox
2018-10-11 15:41   ` Peter Zijlstra
2018-10-11 18:46     ` Jani Nikula
2018-10-12  9:32       ` Peter Zijlstra
2018-10-12 17:27 ` Jonathan Corbet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181011220631.GB128397@gmail.com \
    --to=mingo@kernel.org \
    --cc=hofrat@osadl.org \
    --cc=hpa@zytor.com \
    --cc=john.garry@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox