linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Dan Williams <dan.j.williams@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	rjw@sisk.pl, linux-next@vger.kernel.org,
	linux-kernel@vger.kernel.org, Vinod Koul <vinod.koul@intel.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>
Subject: Re: [PATCH] dmatest: don't use set_freezable_with_signal()
Date: Mon, 21 Nov 2011 10:49:39 -0800	[thread overview]
Message-ID: <20111121184939.GA25776@google.com> (raw)
In-Reply-To: <20111121184316.GH15314@google.com>

On Mon, Nov 21, 2011 at 10:43:16AM -0800, Tejun Heo wrote:
> Commit 981ed70d8e (dmatest: make dmatest threads freezable) made
> dmatest kthread use set_freezable_with_signal(); however, the
> interface is scheduled to be removed in the next merge window.
> 
> The problem is that unlike userland tasks there's no default place
> which handles signal pending state and it isn't clear who owns and/or
> is responsible for clearing TIF_SIGPENDING.  For example, in the
> current code, try_to_freeze() clears TIF_SIGPENDING but it isn't sure
> whether it actually owns the TIF_SIGPENDING nor is it race-free -
> ie. the task may continue to run with TIF_SIGPENDING set after the
> freezable section.
> 
> Unfortunately, we don't have wait_for_completion_freezable_timeout().
> This patch open codes it and uses wait_event_freezable_timeout()
> instead and removes timeout reloading - wait_event_freezable_timeout()
> won't return across freezing events (currently racy but fix scheduled)
> and timer doesn't decrement while the task is in freezer.  Although
> this does lose timer-reset-over-freezing, given that timeout is
> supposed to be long enough and failure to finish inside is considered
> irrecoverable, I don't think this is worth the complexity.
> 
> While at it, move completion to outer scope and explain that we're
> ignoring dangling pointer problem after timeout.  This should give
> slightly better chance at avoiding oops after timeout.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> Guennadi, Dan, how does this look?  If it's okay, do you guys mind
> routing this through pm tree?  I have some patches stacked on top
> removal of freezable_with_signal and it would be much easier to route
> these together.

Ooh, forgot to mention that it's only compile tested.

Thanks.

-- 
tejun

  reply	other threads:[~2011-11-21 18:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-21 18:43 [PATCH] dmatest: don't use set_freezable_with_signal() Tejun Heo
2011-11-21 18:49 ` Tejun Heo [this message]
2011-11-21 19:20 ` [PATCH UPDATED] " Tejun Heo
2011-11-23  7:48 ` [PATCH] " Williams, Dan J
2011-11-23 17:39   ` Tejun Heo

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=20111121184939.GA25776@google.com \
    --to=tj@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=rjw@sisk.pl \
    --cc=sfr@canb.auug.org.au \
    --cc=vinod.koul@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).