public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Nigel Cunningham <ncunningham@cyclades.com>,
	linux-pm@lists.osdl.org, Pavel Machek <pavel@ucw.cz>
Subject: Re: Re: freeze_processes questions
Date: Thu, 7 Apr 2005 20:03:01 +0200	[thread overview]
Message-ID: <200504072003.02105.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0504071031440.989-100000@ida.rowland.org>

[-- Attachment #1: Type: text/plain, Size: 2373 bytes --]

Hi,

On Thursday, 7 of April 2005 16:36, Alan Stern wrote:
> On Thu, 7 Apr 2005, Rafael J. Wysocki wrote:
> 
> > I am confused now.  AFAICS, we don't check anywhere if a process we
> > are going to freeze holds any locks.
> 
> You're not supposed to check.  If the process is running in userspace then 
> it can't be holding any locks, by definition.  If it's running in the 
> kernel then it's supposed to do its own checking.  It won't call 
> refrigerator() unless it knows that no locks are held.

Oh, well.  The processes that are running in the kernel always enter the
refrigerator voluntarily ...

]--snip--[
> > > OTOH... we may want to move completely away from refrigerator. Its
> > > quite a hack, and it device support is okay, we'll not really need it.
> > 
> > Still, it won't happen soon, I guess. :-)  As of today, we have the
> > refrigerator and the processes in TASK_UNINTERRUPTIBLE are mishandled.
> > I think we should do something about it, at least for now, until we drop
> > the refrigerator altogether (if we are going to drop it).  That's why I
> > started the discussion and sent the patch.
> 
> It's very simple.  Processes in TASK_UNINTERRUPTIBLE can't be put in the
> refrigerator, so you have to wait until they can be put there.

It seems that if a process calls wait_for_completion() right before suspend,
the other task supposed to complete its completion may be accidentally frozen
before it's able to do this.  It looks like this happens to kseroid sometimes
on suspend-during-resume.

> If that means waiting more than 10 seconds or so, you should just give up.  
> Return an error and put a message in the log saying something like "Can't
> suspend because process XXX is busy".

OK, that's what we do now.  Except that IMO we should clear the PF_FREEZE flag
for this process and do recalc_sigpending() for it after we give up, because
otherwise it will enter the refrigerator sooner or later and it will stay there.
Alternatively, we can disable the "freezing loop" in refrigerator() as soon as
thaw_processes() is started.  Also, we can avoid setting PF_FREEZE for
processes in TASK_UNINTERRUPTIBLE, but count them as "freezable".  Etc.

Greets,
Rafael


-- 
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
		-- Lewis Carroll "Alice's Adventures in Wonderland"

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2005-04-07 18:03 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-05  9:20 freeze_processes questions Rafael J. Wysocki
2005-04-05  9:27 ` Pavel Machek
2005-04-05  9:53   ` Rafael J. Wysocki
2005-04-05 18:02     ` Rafael J. Wysocki
2005-04-05 18:17       ` Alan Stern
2005-04-05 18:33         ` Rafael J. Wysocki
2005-04-05 20:37       ` Pavel Machek
2005-04-05 22:46         ` Rafael J. Wysocki
2005-04-05 22:57           ` Pavel Machek
2005-04-05 23:10             ` Nigel Cunningham
2005-04-06  6:41               ` Rafael J. Wysocki
2005-04-06 19:06               ` Alan Stern
2005-04-06 20:52                 ` Rafael J. Wysocki
2005-04-06 21:03                   ` Alan Stern
2005-04-06 21:26                     ` David Brownell
2005-04-06 21:17                   ` Pavel Machek
2005-04-06 21:35                     ` Rafael J. Wysocki
2005-04-06 22:07                       ` Nigel Cunningham
2005-04-06 22:41                         ` Rafael J. Wysocki
2005-04-07 14:41                           ` Alan Stern
2005-04-07 17:17                             ` Rafael J. Wysocki
2005-04-07 14:43                         ` Alan Stern
2005-04-07 17:26                           ` Rafael J. Wysocki
2005-04-07  9:11                       ` Pavel Machek
2005-04-07 12:29                         ` Rafael J. Wysocki
2005-04-07 12:47                           ` Nigel Cunningham
2005-04-07 14:36                           ` Alan Stern
2005-04-07 18:03                             ` Rafael J. Wysocki [this message]
2005-04-07 20:00                               ` Alan Stern
2005-04-07 20:59                                 ` Rafael J. Wysocki
2005-04-07 22:09                                   ` Alan Stern
2005-04-08  6:20                                   ` Pavel Machek
2005-04-08  9:13                                     ` Rafael J. Wysocki
2005-04-07 21:03                                 ` Rafael J. Wysocki
2005-04-08  6:23                                   ` Pavel Machek
2005-04-08 11:23                                     ` Rafael J. Wysocki
2005-04-11 23:59                                       ` Pavel Machek
2005-04-27  9:30                                       ` Li Shaohua
2005-04-27  9:53                                         ` Nigel Cunningham
2005-04-28  4:48                                           ` Li Shaohua
2005-04-28  5:05                                             ` Nigel Cunningham
2005-04-28  5:21                                               ` Li Shaohua
2005-04-28  5:49                                                 ` Nigel Cunningham
2005-04-28  6:01                                                   ` Li Shaohua
2005-04-28  6:21                                                     ` Nigel Cunningham
2005-04-28  8:15                                                   ` Pavel Machek
2005-04-28  8:14                                             ` Pavel Machek
2005-04-28 15:19                                               ` Stefan Seyfried
2005-04-28 18:47                                                 ` Pavel Machek
2005-04-08  7:20                               ` Pavel Machek
2005-04-06 21:34               ` David Brownell
2005-04-06 22:03                 ` Nigel Cunningham
2005-04-06 22:20                   ` David Brownell
2005-04-07  9:09                 ` Pavel Machek
2005-04-08  6:23               ` Pavel Machek
2005-04-08  7:18                 ` Nigel Cunningham

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=200504072003.02105.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-pm@lists.osdl.org \
    --cc=ncunningham@cyclades.com \
    --cc=pavel@ucw.cz \
    --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