From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: fli24 <fei.li@intel.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org, chuansheng.liu@intel.com
Subject: Re: [PATCH] suspend: enable freeze timeout configuration through sysctl
Date: Tue, 29 Jan 2013 12:42:16 +0100 [thread overview]
Message-ID: <2146878.OLeVueUb0g@vostro.rjw.lan> (raw)
In-Reply-To: <1359428300.3211.3.camel@fli24-HP-Compaq-8100-Elite-CMT-PC>
On Tuesday, January 29, 2013 10:58:20 AM fli24 wrote:
>
> At present, the timeout value for freezing tasks is fixed as 20s,
> which is too long for handheld device usage, especially for mobile
> phone.
>
> In order to improve user experience, we enable freeze timeout
> configuration through sysctl, so that we can tune the value easily
> for concrete usage, such as smaller value for handheld device such
> as mobile phone.
Well, I'd argue that you shouldn't see freeze problems on such systems.
If you're seeing them, it's better to fix them than to try to hide them
from users (they are problems after all).
Do you have a specific example in which that new knob will be useful?
Why do you want to do that through sysctl and not sysfs?
Rafael
> Signed-off-by: Liu Chuansheng <chuansheng.liu@intel.com>
> Signed-off-by: Li Fei <fei.li@intel.com>
> ---
> include/linux/freezer.h | 5 +++++
> kernel/power/process.c | 4 ++--
> kernel/sysctl.c | 12 ++++++++++++
> 3 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/freezer.h b/include/linux/freezer.h
> index e4238ce..f37b3be 100644
> --- a/include/linux/freezer.h
> +++ b/include/linux/freezer.h
> @@ -13,6 +13,11 @@ extern bool pm_freezing; /* PM freezing in effect */
> extern bool pm_nosig_freezing; /* PM nosig freezing in effect */
>
> /*
> + * Timeout for stopping processes
> + */
> +extern unsigned int sysctl_freeze_process_timeout_secs;
> +
> +/*
> * Check if a process has been frozen
> */
> static inline bool frozen(struct task_struct *p)
> diff --git a/kernel/power/process.c b/kernel/power/process.c
> index d5a258b..f7eb7c9 100644
> --- a/kernel/power/process.c
> +++ b/kernel/power/process.c
> @@ -21,7 +21,7 @@
> /*
> * Timeout for stopping processes
> */
> -#define TIMEOUT (20 * HZ)
> +unsigned int __read_mostly sysctl_freeze_process_timeout_secs = 20;
>
> static int try_to_freeze_tasks(bool user_only)
> {
> @@ -36,7 +36,7 @@ static int try_to_freeze_tasks(bool user_only)
>
> do_gettimeofday(&start);
>
> - end_time = jiffies + TIMEOUT;
> + end_time = jiffies + sysctl_freeze_process_timeout_secs * HZ;
>
> if (!user_only)
> freeze_workqueues_begin();
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index c88878d..f88bcb9 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -90,6 +90,9 @@
> #include <linux/nmi.h>
> #endif
>
> +#ifdef CONFIG_FREEZER
> +#include <linux/freezer.h>
> +#endif
>
> #if defined(CONFIG_SYSCTL)
>
> @@ -1047,6 +1050,15 @@ static struct ctl_table kern_table[] = {
> .proc_handler = proc_dointvec,
> },
> #endif
> +#ifdef CONFIG_FREEZER
> + {
> + .procname = "freeze_process_timeout_secs",
> + .data = &sysctl_freeze_process_timeout_secs,
> + .maxlen = sizeof(unsigned int),
> + .mode = 0644,
> + .proc_handler = proc_dointvec,
> + },
> +#endif
> { }
> };
>
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2013-01-29 11:36 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-29 2:58 [PATCH] suspend: enable freeze timeout configuration through sysctl fli24
2013-01-29 11:42 ` Rafael J. Wysocki [this message]
2013-01-30 6:22 ` Li, Fei
2013-01-30 0:36 ` Andrew Morton
2013-01-30 6:23 ` Li, Fei
2013-01-30 6:23 ` [PATCH V2] suspend: enable freeze timeout configuration through sys fli24
2013-01-30 13:09 ` Rafael J. Wysocki
2013-01-31 5:00 ` Li, Fei
2013-01-31 4:55 ` [PATCH V3] " fli24
2013-01-31 7:29 ` Yasuaki Ishimatsu
2013-01-31 9:13 ` Li, Fei
2013-01-31 9:52 ` anish singh
2013-01-31 22:29 ` Rafael J. Wysocki
2013-02-01 1:33 ` Li, Fei
2013-02-01 1:56 ` Yasuaki Ishimatsu
2013-02-01 2:02 ` Liu, Chuansheng
2013-02-01 8:56 ` [PATCH V4] " fli24
2013-02-03 13:41 ` Rafael J. Wysocki
2013-02-04 3:08 ` Li, Fei
2013-02-04 3:15 ` Alan Stern
2013-02-04 4:32 ` Liu, Chuansheng
2013-02-04 12:22 ` 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=2146878.OLeVueUb0g@vostro.rjw.lan \
--to=rjw@sisk.pl \
--cc=akpm@linux-foundation.org \
--cc=chuansheng.liu@intel.com \
--cc=fei.li@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox