From: Dmitry Torokhov <dtor_core-yWtbtysYrB+LZ21kGMrzwg@public.gmane.org>
To: Pavel Machek <pavel-AlSwsSmVLrQ@public.gmane.org>
Cc: Vojtech Pavlik <vojtech-AlSwsSmVLrQ@public.gmane.org>,
Andy Isaacson <adi-3HqRAUrWAWyGglJvpFV4uA@public.gmane.org>,
Linux-pm mailing list
<linux-pm-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>,
Nigel Cunningham
<ncunningham-3EexvZdKGZRWk0Htik3J/w@public.gmane.org>,
Stefan Seyfried <seife-l3A5Bk7waGM@public.gmane.org>,
Linux Kernel Mailing List
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: Re: swsusp 'disk' fails in bk-current - intel_agp at fault?
Date: Thu, 31 Mar 2005 02:26:02 -0500 [thread overview]
Message-ID: <200503310226.03495.dtor_core@ameritech.net> (raw)
In-Reply-To: <20050329223519.GI8125-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
On Tuesday 29 March 2005 17:35, Pavel Machek wrote:
> Hi!
>
> > > We currently freeze processes for suspend-to-ram, too. I guess that
> > > disable_usermodehelper is probably better and that in_suspend() should
> > > only be used for sanity checks... go with disable_usermodehelper and
> > > sorry for the noise.
> >
> > Here's another possibility: Freeze the workqueue that
> > call_usermodehelper uses (remember that code I didn't push hard enough
> > to Andrew?), and let invocations of call_usermodehelper block in
> > TASK_UNINTERRUPTIBLE. In refrigerating processes, don't choke on
>
> There may be many devices in the system, and you are going to need
> quite a lot of RAM for all that... That's why they do not queue it
> during boot, IIRC. Disabling usermode helper seems right.
Ok, what do you think about this one?
===================================================================
swsusp: disable usermodehelper after generating memory snapshot and
before resuming devices, so when device fails to resume we
won't try to call hotplug - userspace stopped anyway.
Signed-off-by: Dmitry Torokhov <dtor-JGs/UdohzUI@public.gmane.org>
include/linux/kmod.h | 3 +++
kernel/kmod.c | 14 +++++++++++++-
kernel/power/disk.c | 2 ++
kernel/power/swsusp.c | 1 -
4 files changed, 18 insertions(+), 2 deletions(-)
Index: dtor/kernel/power/disk.c
===================================================================
--- dtor.orig/kernel/power/disk.c
+++ dtor/kernel/power/disk.c
@@ -205,6 +205,8 @@ int pm_suspend_disk(void)
if (in_suspend) {
pr_debug("PM: writing image.\n");
+ usermodehelper_disable();
+ device_resume();
error = swsusp_write();
if (!error)
power_down(pm_disk_mode);
Index: dtor/kernel/power/swsusp.c
===================================================================
--- dtor.orig/kernel/power/swsusp.c
+++ dtor/kernel/power/swsusp.c
@@ -853,7 +853,6 @@ static int suspend_prepare_image(void)
int swsusp_write(void)
{
int error;
- device_resume();
lock_swapdevices();
error = write_suspend_image();
/* This will unlock ignored swap devices since writing is finished */
Index: dtor/kernel/kmod.c
===================================================================
--- dtor.orig/kernel/kmod.c
+++ dtor/kernel/kmod.c
@@ -124,6 +124,8 @@ struct subprocess_info {
int retval;
};
+static int usermodehelper_disabled;
+
/*
* This is the task which runs the usermode application
*/
@@ -240,7 +242,7 @@ int call_usermodehelper(char *path, char
if (!khelper_wq)
return -EBUSY;
- if (path[0] == '\0')
+ if (usermodehelper_disabled || path[0] == '\0')
return 0;
queue_work(khelper_wq, &work);
@@ -249,6 +251,16 @@ int call_usermodehelper(char *path, char
}
EXPORT_SYMBOL(call_usermodehelper);
+void usermodehelper_enable(void)
+{
+ usermodehelper_disabled = 0;
+}
+
+void usermodehelper_disable(void)
+{
+ usermodehelper_disabled = 1;
+}
+
void __init usermodehelper_init(void)
{
khelper_wq = create_singlethread_workqueue("khelper");
Index: dtor/include/linux/kmod.h
===================================================================
--- dtor.orig/include/linux/kmod.h
+++ dtor/include/linux/kmod.h
@@ -34,7 +34,10 @@ static inline int request_module(const c
#endif
#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
+
extern int call_usermodehelper(char *path, char *argv[], char *envp[], int wait);
extern void usermodehelper_init(void);
+extern void usermodehelper_enable(void);
+extern void usermodehelper_disable(void);
#endif /* __LINUX_KMOD_H__ */
WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Pavel Machek <pavel@suse.cz>
Cc: Nigel Cunningham <ncunningham@cyclades.com>,
Linux-pm mailing list <linux-pm@lists.osdl.org>,
Vojtech Pavlik <vojtech@suse.cz>, Stefan Seyfried <seife@suse.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andy Isaacson <adi@hexapodia.org>
Subject: Re: [linux-pm] Re: swsusp 'disk' fails in bk-current - intel_agp at fault?
Date: Thu, 31 Mar 2005 02:26:02 -0500 [thread overview]
Message-ID: <200503310226.03495.dtor_core@ameritech.net> (raw)
In-Reply-To: <20050329223519.GI8125@elf.ucw.cz>
On Tuesday 29 March 2005 17:35, Pavel Machek wrote:
> Hi!
>
> > > We currently freeze processes for suspend-to-ram, too. I guess that
> > > disable_usermodehelper is probably better and that in_suspend() should
> > > only be used for sanity checks... go with disable_usermodehelper and
> > > sorry for the noise.
> >
> > Here's another possibility: Freeze the workqueue that
> > call_usermodehelper uses (remember that code I didn't push hard enough
> > to Andrew?), and let invocations of call_usermodehelper block in
> > TASK_UNINTERRUPTIBLE. In refrigerating processes, don't choke on
>
> There may be many devices in the system, and you are going to need
> quite a lot of RAM for all that... That's why they do not queue it
> during boot, IIRC. Disabling usermode helper seems right.
Ok, what do you think about this one?
===================================================================
swsusp: disable usermodehelper after generating memory snapshot and
before resuming devices, so when device fails to resume we
won't try to call hotplug - userspace stopped anyway.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
include/linux/kmod.h | 3 +++
kernel/kmod.c | 14 +++++++++++++-
kernel/power/disk.c | 2 ++
kernel/power/swsusp.c | 1 -
4 files changed, 18 insertions(+), 2 deletions(-)
Index: dtor/kernel/power/disk.c
===================================================================
--- dtor.orig/kernel/power/disk.c
+++ dtor/kernel/power/disk.c
@@ -205,6 +205,8 @@ int pm_suspend_disk(void)
if (in_suspend) {
pr_debug("PM: writing image.\n");
+ usermodehelper_disable();
+ device_resume();
error = swsusp_write();
if (!error)
power_down(pm_disk_mode);
Index: dtor/kernel/power/swsusp.c
===================================================================
--- dtor.orig/kernel/power/swsusp.c
+++ dtor/kernel/power/swsusp.c
@@ -853,7 +853,6 @@ static int suspend_prepare_image(void)
int swsusp_write(void)
{
int error;
- device_resume();
lock_swapdevices();
error = write_suspend_image();
/* This will unlock ignored swap devices since writing is finished */
Index: dtor/kernel/kmod.c
===================================================================
--- dtor.orig/kernel/kmod.c
+++ dtor/kernel/kmod.c
@@ -124,6 +124,8 @@ struct subprocess_info {
int retval;
};
+static int usermodehelper_disabled;
+
/*
* This is the task which runs the usermode application
*/
@@ -240,7 +242,7 @@ int call_usermodehelper(char *path, char
if (!khelper_wq)
return -EBUSY;
- if (path[0] == '\0')
+ if (usermodehelper_disabled || path[0] == '\0')
return 0;
queue_work(khelper_wq, &work);
@@ -249,6 +251,16 @@ int call_usermodehelper(char *path, char
}
EXPORT_SYMBOL(call_usermodehelper);
+void usermodehelper_enable(void)
+{
+ usermodehelper_disabled = 0;
+}
+
+void usermodehelper_disable(void)
+{
+ usermodehelper_disabled = 1;
+}
+
void __init usermodehelper_init(void)
{
khelper_wq = create_singlethread_workqueue("khelper");
Index: dtor/include/linux/kmod.h
===================================================================
--- dtor.orig/include/linux/kmod.h
+++ dtor/include/linux/kmod.h
@@ -34,7 +34,10 @@ static inline int request_module(const c
#endif
#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
+
extern int call_usermodehelper(char *path, char *argv[], char *envp[], int wait);
extern void usermodehelper_init(void);
+extern void usermodehelper_enable(void);
+extern void usermodehelper_disable(void);
#endif /* __LINUX_KMOD_H__ */
next prev parent reply other threads:[~2005-03-31 7:26 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-23 18:49 swsusp 'disk' fails in bk-current - intel_agp at fault? Andy Isaacson
2005-03-24 14:27 ` Stefan Seyfried
2005-03-24 18:10 ` Andy Isaacson
2005-03-24 19:18 ` Dmitry Torokhov
2005-03-24 20:20 ` Andy Isaacson
2005-03-24 21:10 ` Dmitry Torokhov
2005-03-24 23:54 ` Andy Isaacson
2005-03-25 9:22 ` Stefan Seyfried
2005-03-25 10:13 ` Pavel Machek
2005-03-25 14:19 ` Dmitry Torokhov
2005-03-25 14:24 ` Pavel Machek
2005-03-25 14:52 ` Dmitry Torokhov
2005-03-25 15:42 ` Pavel Machek
2005-03-25 16:04 ` Dmitry Torokhov
2005-03-28 23:00 ` Pavel Machek
2005-03-29 23:19 ` Rafael J. Wysocki
2005-03-29 21:49 ` Rafael J. Wysocki
2005-03-25 18:36 ` Andy Isaacson
2005-03-29 16:18 ` Dmitry Torokhov
2005-03-29 18:18 ` Pavel Machek
2005-03-29 19:11 ` Dmitry Torokhov
2005-03-29 19:23 ` Pavel Machek
2005-03-29 20:05 ` Dmitry Torokhov
[not found] ` <d120d50005032912051fee6e91-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-03-29 20:52 ` Pavel Machek
2005-03-29 20:52 ` Pavel Machek
[not found] ` <20050329205225.GF8125-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-29 21:07 ` Dmitry Torokhov
2005-03-29 21:07 ` Dmitry Torokhov
[not found] ` <d120d500050329130714e1daaf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-03-29 21:12 ` Pavel Machek
2005-03-29 21:12 ` Pavel Machek
[not found] ` <20050329211239.GG8125-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-29 21:33 ` Dmitry Torokhov
2005-03-29 21:33 ` Dmitry Torokhov
[not found] ` <d120d50005032913331be39802-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-03-29 21:44 ` Pavel Machek
2005-03-29 21:44 ` Pavel Machek
[not found] ` <20050329214408.GH8125-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-29 22:31 ` Nigel Cunningham
2005-03-29 22:31 ` [linux-pm] " Nigel Cunningham
[not found] ` <1112135477.29392.16.camel-r49W/1Cwd2ff0s6lnCXPX/uOuaPYTxhvJwvTLr3MMZM@public.gmane.org>
2005-03-29 22:35 ` Pavel Machek
2005-03-29 22:35 ` [linux-pm] " Pavel Machek
[not found] ` <20050329223519.GI8125-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-29 23:46 ` Nigel Cunningham
2005-03-29 23:46 ` [linux-pm] " Nigel Cunningham
2005-03-31 7:26 ` Dmitry Torokhov [this message]
2005-03-31 7:26 ` Dmitry Torokhov
[not found] ` <200503310226.03495.dtor_core-yWtbtysYrB+LZ21kGMrzwg@public.gmane.org>
2005-03-31 8:39 ` Pavel Machek
2005-03-31 8:39 ` [linux-pm] " Pavel Machek
[not found] ` <20050331083909.GA1387-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-31 15:02 ` Dmitry Torokhov
2005-03-31 15:02 ` [linux-pm] " Dmitry Torokhov
2005-03-31 16:02 ` Patrick Mochel
2005-03-31 16:02 ` [linux-pm] " Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503310801410.15519-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-31 16:32 ` Dmitry Torokhov
2005-03-31 16:32 ` [linux-pm] " Dmitry Torokhov
[not found] ` <d120d50005033108321c8f4ae7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-03-31 22:16 ` Nigel Cunningham
2005-03-31 22:16 ` [linux-pm] " Nigel Cunningham
2005-03-31 22:18 ` Pavel Machek
2005-03-31 22:18 ` [linux-pm] " Pavel Machek
[not found] ` <20050331221814.GC1802-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-31 22:28 ` Nigel Cunningham
2005-03-31 22:28 ` [linux-pm] " Nigel Cunningham
[not found] ` <1112308137.18871.7.camel-r49W/1Cwd2ff0s6lnCXPX/uOuaPYTxhvJwvTLr3MMZM@public.gmane.org>
2005-04-01 8:49 ` Rafael J. Wysocki
2005-04-01 8:49 ` [linux-pm] " Rafael J. Wysocki
[not found] ` <200504011049.01540.rjw-KKrjLPT3xs0@public.gmane.org>
2005-04-01 10:33 ` Stefan Seyfried
2005-04-01 10:33 ` [linux-pm] " Stefan Seyfried
2005-03-29 23:05 ` Rafael J. Wysocki
2005-03-29 23:05 ` Rafael J. Wysocki
2005-03-29 21:23 ` Patrick Mochel
2005-03-29 21:23 ` [linux-pm] " Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503291321490.29474-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-29 21:38 ` Dmitry Torokhov
2005-03-29 21:38 ` [linux-pm] " Dmitry Torokhov
2005-03-30 9:52 ` Greg KH
2005-03-30 9:52 ` [linux-pm] " Greg KH
2005-03-25 14:58 ` Dmitry Torokhov
2005-03-30 7:26 ` Andy Isaacson
2005-03-24 21:14 ` Dmitry Torokhov
2005-03-24 20:38 ` Stefan Seyfried
2005-03-29 18:42 ` Dmitry Torokhov
2005-03-30 7:24 ` Andy Isaacson
[not found] ` <20050525171825.51a06908.akpm@osdl.org>
2005-05-27 17:44 ` Andy Isaacson
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=200503310226.03495.dtor_core@ameritech.net \
--to=dtor_core-ywtbtysyrb+lz21kgmrzwg@public.gmane.org \
--cc=adi-3HqRAUrWAWyGglJvpFV4uA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pm-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=ncunningham-3EexvZdKGZRWk0Htik3J/w@public.gmane.org \
--cc=pavel-AlSwsSmVLrQ@public.gmane.org \
--cc=seife-l3A5Bk7waGM@public.gmane.org \
--cc=vojtech-AlSwsSmVLrQ@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.