From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Nigel Cunningham <nigel@suspend2.net>
Cc: Pavel Machek <pavel@suse.cz>, linux-kernel@vger.kernel.org
Subject: Re: [ 06/23] [Suspend2] Disable usermode helper invocations when the freezer is on.
Date: Wed, 1 Feb 2006 01:33:08 +0100 [thread overview]
Message-ID: <200602010133.08720.rjw@sisk.pl> (raw)
In-Reply-To: <200602010921.09750.nigel@suspend2.net>
Hi,
On Wednesday 01 February 2006 00:21, Nigel Cunningham wrote:
> On Tuesday 31 January 2006 20:58, Rafael J. Wysocki wrote:
> > Hi,
> > > > >
> > > > > + if (freezer_is_on())
> > > > > + return 0;
> > > > > +
> > > > > if (path[0] == '\0')
> > > > > return 0;
> > > >
> > > > Disabling the usermode helper while freeze_processes() is executed
> > > > seems to be a good idea to me, but I think it should be done with a
> > > > mutex or something like that.
> > >
> > > With the refrigerator code you guys are using at the moment, ouldn't that
> > > result in deadlocks when we later try to freeze the process in
> > > preparation for the atomic restore? (Or perhaps you don't freeze
> > > processes at that point?)
> >
> > I'm not sure what you mean. I said "mutex" because you seem to have a race
> > here (the freezer may be started right after the freezer_is_on() check).
> > IMO the freezer should disable the invocations of new usermode helpers and
> > wait util all of the already running helpers are finished. For this
> > purpose two variables would be needed and a lock.
>
> Sorry. Being a bit thick.
>
> I wasn't worried about already-running usermode helpers (or about-to-run
> helpers either) because the spawned processes would either complete or be
> caught be the usual freezing code. My concern was more that new invocations
> of this path don't leave us with unfrozen processes hanging around. That
> said, I think you have a valid point about letting existing helpers run to
> completion. It does make me concerned though about the possibility of a
> long-lived helper (not that I know that there really are such things at the
> moment). Do you think that needs to be taken as a genuine concern? If so, I
> guess we then need to make freezing a four stage process:
>
> 1. Stop new usermodehelpers from starting & let existing ones run to
> completion.
> 2. Freeze userspace.
> 3. Freezer bdevs.
> 4. Freezer kernel space.
Well, I know a little about bdevs, but generally I think that's reasonable.
Greetings,
Rafael
next prev parent reply other threads:[~2006-02-01 0:32 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-26 3:45 [ 00/23] [Suspend2] Freezer Upgrade Patches Nigel Cunningham
2006-01-26 3:45 ` [ 01/23] [Suspend2] Make workqueues freezeable Nigel Cunningham
2006-01-26 23:17 ` Rafael J. Wysocki
2006-01-27 4:01 ` Nigel Cunningham
2006-01-26 3:45 ` [ 02/23] [Suspend2] Add new include/linux/freezer.h header Nigel Cunningham
2006-01-26 3:45 ` [ 03/23] [Suspend2] Allow a notifier to remove itself from the notifier list Nigel Cunningham
2006-01-26 3:45 ` [ 04/23] [Suspend2] Todo notifier for processes Nigel Cunningham
2006-01-26 3:45 ` [ 05/23] [Suspend2] Make the freezer use todo lists Nigel Cunningham
2006-01-26 3:45 ` [ 06/23] [Suspend2] Disable usermode helper invocations when the freezer is on Nigel Cunningham
2006-01-30 22:05 ` Rafael J. Wysocki
2006-01-31 3:24 ` Nigel Cunningham
2006-01-31 10:58 ` Rafael J. Wysocki
2006-01-31 23:21 ` Nigel Cunningham
2006-02-01 0:33 ` Rafael J. Wysocki [this message]
2006-01-26 3:45 ` [ 07/23] [Suspend2] Add which-to-thaw parameter to thaw_processes() calls Nigel Cunningham
2006-01-26 3:45 ` [ 08/23] [Suspend2] New freezer explanation for kernel/power/process.c Nigel Cunningham
2006-01-26 3:45 ` [ 09/23] [Suspend2] Quieten the freezer for normal operation Nigel Cunningham
2006-01-26 3:45 ` [ 10/23] [Suspend2] Add support for freezing filesystem bdevs Nigel Cunningham
2006-01-26 3:45 ` [ 11/23] [Suspend2] Modify freezeable for freezing kernel threads separately Nigel Cunningham
2006-01-26 3:45 ` [ 12/23] [Suspend2] Split freezing of threads according to whether user/kernelspace Nigel Cunningham
2006-01-26 3:45 ` [ 13/23] [Suspend2] Add support for thawing just kernel threads or all threads Nigel Cunningham
2006-01-26 3:45 ` [ 14/23] [Suspend2] Helper for counting freezeable threads of a type Nigel Cunningham
2006-01-26 3:45 ` [ 15/23] [Suspend2] Helper for counting uninterruptible " Nigel Cunningham
2006-01-30 22:18 ` Rafael J. Wysocki
2006-01-30 22:25 ` Pavel Machek
2006-01-31 0:02 ` Rafael J. Wysocki
2006-01-31 9:27 ` [RFC/RFT] finally solve "swsusp fails with mysqld" problem Pavel Machek
2006-01-31 16:17 ` Rafael J. Wysocki
2006-01-31 21:29 ` Pavel Machek
2006-01-31 22:30 ` Rafael J. Wysocki
2006-01-31 5:42 ` [ 15/23] [Suspend2] Helper for counting uninterruptible threads of a type Nigel Cunningham
2006-01-26 3:45 ` [ 16/23] [Suspend2] Helper to signal all " Nigel Cunningham
2006-01-26 3:46 ` [ 17/23] [Suspend2] Helper to prod processes that should have frozen but haven't Nigel Cunningham
2006-01-26 3:46 ` [ 18/23] [Suspend2] Helper: Did we fail to freeze all threads of a type? Nigel Cunningham
2006-01-26 3:46 ` [ 19/23] [Suspend2] Freeze all threads of a type Nigel Cunningham
2006-01-26 3:46 ` [ 20/23] [Suspend2] Modify process.c includes and export freezer state Nigel Cunningham
2006-01-26 3:46 ` [ 21/23] [Suspend2] Remove unused DEBUG undef Nigel Cunningham
2006-01-26 3:46 ` [ 22/23] [Suspend2] Modify swsusp to thaw kernel threads while eating memory Nigel Cunningham
2006-01-26 3:46 ` [ 23/23] [Suspend2] Don't scan LRU while freezer is on Nigel Cunningham
2006-01-26 11:55 ` [ 00/23] [Suspend2] Freezer Upgrade Patches Pavel Machek
2006-01-26 21:49 ` Nigel Cunningham
2006-01-26 23:10 ` Rafael J. Wysocki
2006-01-27 4:04 ` Nigel Cunningham
2006-01-27 12:18 ` Rafael J. Wysocki
2006-01-27 19:20 ` Nigel Cunningham
2006-01-27 23:22 ` Pavel Machek
2006-01-30 5:54 ` Nigel Cunningham
2006-01-30 11:50 ` Pavel Machek
2006-01-30 7:53 ` Stefan Seyfried
2006-01-30 11:53 ` 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=200602010133.08720.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=nigel@suspend2.net \
--cc=pavel@suse.cz \
/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