public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.de>
To: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.name>,
	pm list <linux-pm@lists.osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: question on resume()
Date: Wed, 31 Jan 2007 10:04:08 +0100 (MET)	[thread overview]
Message-ID: <200701311004.19477.oneukum@suse.de> (raw)
In-Reply-To: <200701310949.04110.rjw@sisk.pl>

Am Mittwoch, 31. Januar 2007 09:49 schrieb Rafael J. Wysocki:
> On Wednesday, 31 January 2007 09:40, Oliver Neukum wrote:
> > Am Mittwoch, 31. Januar 2007 09:33 schrieb Rafael J. Wysocki:
> > > On Tuesday, 30 January 2007 23:32, Rafael J. Wysocki wrote:
> > 
> > > > Generally, you are safe if your driver only calls wake_up() from a process
> > > > context, but not from .resume() or .suspend() routines (or from an
> > > > unfreezeable kernel thread).
> > > 
> > > Ah, sorry, I've just realized I was wrong.  Processes in TASK_UNINTERRUPTIBLE
> > > cannot be frozen!  So, the above only applies to wake_up_interruptible().
> > 
> > So the kernel will wait for tasks in TASK_UNINTERRUPTIBLE to finish IO
> > before it calls suspend()? I am confused.
> 
> Yes, it will.  The process freezer can only return success if there are no more
> TASK_UNINTERRUPTIBLE tasks.  Otherwise it fails (after a timeout).

So, this means, on suspend():

1. Don't worry about TASK_UNINTERRUPTIBLE
2. Do worry about TASK_INTERRUPTIBLE
We have to cease IO and must not call wake_up_interruptible()

Isn't that a race until suspend() is called?

On resume():

1. Don't worry about TASK_UNINTERRUPTIBLE
2. Do not restart IO that may call wake_up_interruptible()

When do we restart such IO?

	Regards
		Oliver

  reply	other threads:[~2007-01-31  9:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200701291206.39637.oneukum@suse.de>
     [not found] ` <200701301732.56444.rjw@sisk.pl>
     [not found]   ` <200701301750.48196.oliver@neukum.name>
2007-01-30 22:32     ` question on resume() Rafael J. Wysocki
2007-01-31  8:33       ` Rafael J. Wysocki
2007-01-31  8:40         ` Oliver Neukum
2007-01-31  8:49           ` Rafael J. Wysocki
2007-01-31  9:04             ` Oliver Neukum [this message]
2007-01-31  9:36               ` Pavel Machek
2007-01-31 10:14                 ` Oliver Neukum
2007-01-31 10:30                   ` [linux-pm] " Pavel Machek
2007-01-31 15:54                 ` Alan Stern
2007-01-31 16:12                   ` Oliver Neukum
2007-01-31 16:27                     ` Alan Stern
2007-01-31 18:04                   ` Woodruff, Richard
2007-01-31 15:48         ` Alan Stern
2007-01-31 18:52           ` [linux-pm] " Rafael J. Wysocki

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=200701311004.19477.oneukum@suse.de \
    --to=oneukum@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.osdl.org \
    --cc=oliver@neukum.name \
    --cc=rjw@sisk.pl \
    --cc=stern@rowland.harvard.edu \
    /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