Now that the TIF_FREEZE flag is available in all architectures,
extract the refrigerator() and freeze_task() from kernel/power/process.c
and make it available to all.
The refrigerator() can now be used in a control group subsystem
implementing a control group freezer.
Signed-off-by: Cedric Le Goater <[email protected]>
Signed-off-by: Matt Helsley <[email protected]>
Acked-by: Serge E. Hallyn <[email protected]>
Tested-by: Matt Helsley <[email protected]>
---
include/linux/freezer.h | 24 +++++----
kernel/Makefile | 2 +-
kernel/freezer.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++
kernel/power/process.c | 116 --------------------------------------------
4 files changed, 136 insertions(+), 128 deletions(-)
create mode 100644 kernel/freezer.c
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index deddeed..4081768 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -6,7 +6,6 @@
#include <linux/sched.h>
#include <linux/wait.h>
-#ifdef CONFIG_PM_SLEEP
/*
* Check if a process has been frozen
*/
@@ -39,6 +38,11 @@ static inline void clear_freeze_flag(struct task_struct *p)
clear_tsk_thread_flag(p, TIF_FREEZE);
}
+static inline bool should_send_signal(struct task_struct *p)
+{
+ return !(p->flags & PF_FREEZER_NOSIG);
+}
+
/*
* Wake up a frozen process
*
@@ -63,8 +67,6 @@ static inline int thaw_process(struct task_struct *p)
}
extern void refrigerator(void);
-extern int freeze_processes(void);
-extern void thaw_processes(void);
static inline int try_to_freeze(void)
{
@@ -75,6 +77,14 @@ static inline int try_to_freeze(void)
return 0;
}
+extern bool freeze_task(struct task_struct *p, bool sig_only);
+extern void cancel_freezing(struct task_struct *p);
+
+#ifdef CONFIG_PM_SLEEP
+
+extern int freeze_processes(void);
+extern void thaw_processes(void);
+
/*
* The PF_FREEZER_SKIP flag should be set by a vfork parent right before it
* calls wait_for_completion(&vfork) and reset right after it returns from this
@@ -167,18 +177,10 @@ static inline void set_freezable_with_signal(void)
__retval; \
})
#else /* !CONFIG_PM_SLEEP */
-static inline int frozen(struct task_struct *p) { return 0; }
-static inline int freezing(struct task_struct *p) { return 0; }
-static inline void set_freeze_flag(struct task_struct *p) {}
-static inline void clear_freeze_flag(struct task_struct *p) {}
-static inline int thaw_process(struct task_struct *p) { return 1; }
-static inline void refrigerator(void) {}
static inline int freeze_processes(void) { BUG(); return 0; }
static inline void thaw_processes(void) {}
-static inline int try_to_freeze(void) { return 0; }
-
static inline void freezer_do_not_count(void) {}
static inline void freezer_count(void) {}
static inline int freezer_should_skip(struct task_struct *p) { return 0; }
diff --git a/kernel/Makefile b/kernel/Makefile
index 4e1d7df..9844f47 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -5,7 +5,7 @@
obj-y = sched.o fork.o exec_domain.o panic.o printk.o \
cpu.o exit.o itimer.o time.o softirq.o resource.o \
sysctl.o capability.o ptrace.o timer.o user.o \
- signal.o sys.o kmod.o workqueue.o pid.o \
+ signal.o sys.o kmod.o workqueue.o pid.o freezer.o \
rcupdate.o extable.o params.o posix-timers.o \
kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \
diff --git a/kernel/freezer.c b/kernel/freezer.c
new file mode 100644
index 0000000..cb0931f
--- /dev/null
+++ b/kernel/freezer.c
@@ -0,0 +1,122 @@
+/*
+ * kernel/freezer.c - Function to freeze a process
+ *
+ * Originally from kernel/power/process.c
+ */
+
+#include <linux/interrupt.h>
+#include <linux/suspend.h>
+#include <linux/module.h>
+#include <linux/syscalls.h>
+#include <linux/freezer.h>
+
+/*
+ * freezing is complete, mark current process as frozen
+ */
+static inline void frozen_process(void)
+{
+ if (!unlikely(current->flags & PF_NOFREEZE)) {
+ current->flags |= PF_FROZEN;
+ wmb();
+ }
+ clear_freeze_flag(current);
+}
+
+/* Refrigerator is place where frozen processes are stored :-). */
+void refrigerator(void)
+{
+ /* Hmm, should we be allowed to suspend when there are realtime
+ processes around? */
+ long save;
+
+ task_lock(current);
+ if (freezing(current)) {
+ frozen_process();
+ task_unlock(current);
+ } else {
+ task_unlock(current);
+ return;
+ }
+ save = current->state;
+ pr_debug("%s entered refrigerator\n", current->comm);
+
+ spin_lock_irq(¤t->sighand->siglock);
+ recalc_sigpending(); /* We sent fake signal, clean it up */
+ spin_unlock_irq(¤t->sighand->siglock);
+
+ for (;;) {
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ if (!frozen(current))
+ break;
+ schedule();
+ }
+ pr_debug("%s left refrigerator\n", current->comm);
+ __set_current_state(save);
+}
+EXPORT_SYMBOL(refrigerator);
+
+static void fake_signal_wake_up(struct task_struct *p)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&p->sighand->siglock, flags);
+ signal_wake_up(p, 0);
+ spin_unlock_irqrestore(&p->sighand->siglock, flags);
+}
+
+/**
+ * freeze_task - send a freeze request to given task
+ * @p: task to send the request to
+ * @sig_only: if set, the request will only be sent if the task has the
+ * PF_FREEZER_NOSIG flag unset
+ * Return value: 'false', if @sig_only is set and the task has
+ * PF_FREEZER_NOSIG set or the task is frozen, 'true', otherwise
+ *
+ * The freeze request is sent by setting the tasks's TIF_FREEZE flag and
+ * either sending a fake signal to it or waking it up, depending on whether
+ * or not it has PF_FREEZER_NOSIG set. If @sig_only is set and the task
+ * has PF_FREEZER_NOSIG set (ie. it is a typical kernel thread), its
+ * TIF_FREEZE flag will not be set.
+ */
+bool freeze_task(struct task_struct *p, bool sig_only)
+{
+ /*
+ * We first check if the task is freezing and next if it has already
+ * been frozen to avoid the race with frozen_process() which first marks
+ * the task as frozen and next clears its TIF_FREEZE.
+ */
+ if (!freezing(p)) {
+ rmb();
+ if (frozen(p))
+ return false;
+
+ if (!sig_only || should_send_signal(p))
+ set_freeze_flag(p);
+ else
+ return false;
+ }
+
+ if (should_send_signal(p)) {
+ if (!signal_pending(p))
+ fake_signal_wake_up(p);
+ } else if (sig_only) {
+ return false;
+ } else {
+ wake_up_state(p, TASK_INTERRUPTIBLE);
+ }
+
+ return true;
+}
+
+void cancel_freezing(struct task_struct *p)
+{
+ unsigned long flags;
+
+ if (freezing(p)) {
+ pr_debug(" clean up: %s\n", p->comm);
+ clear_freeze_flag(p);
+ spin_lock_irqsave(&p->sighand->siglock, flags);
+ recalc_sigpending_and_wake(p);
+ spin_unlock_irqrestore(&p->sighand->siglock, flags);
+ }
+}
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 278946a..444cea8 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -28,121 +28,6 @@ static inline int freezeable(struct task_struct * p)
return 1;
}
-/*
- * freezing is complete, mark current process as frozen
- */
-static inline void frozen_process(void)
-{
- if (!unlikely(current->flags & PF_NOFREEZE)) {
- current->flags |= PF_FROZEN;
- wmb();
- }
- clear_freeze_flag(current);
-}
-
-/* Refrigerator is place where frozen processes are stored :-). */
-void refrigerator(void)
-{
- /* Hmm, should we be allowed to suspend when there are realtime
- processes around? */
- long save;
-
- task_lock(current);
- if (freezing(current)) {
- frozen_process();
- task_unlock(current);
- } else {
- task_unlock(current);
- return;
- }
- save = current->state;
- pr_debug("%s entered refrigerator\n", current->comm);
-
- spin_lock_irq(¤t->sighand->siglock);
- recalc_sigpending(); /* We sent fake signal, clean it up */
- spin_unlock_irq(¤t->sighand->siglock);
-
- for (;;) {
- set_current_state(TASK_UNINTERRUPTIBLE);
- if (!frozen(current))
- break;
- schedule();
- }
- pr_debug("%s left refrigerator\n", current->comm);
- __set_current_state(save);
-}
-
-static void fake_signal_wake_up(struct task_struct *p)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&p->sighand->siglock, flags);
- signal_wake_up(p, 0);
- spin_unlock_irqrestore(&p->sighand->siglock, flags);
-}
-
-static inline bool should_send_signal(struct task_struct *p)
-{
- return !(p->flags & PF_FREEZER_NOSIG);
-}
-
-/**
- * freeze_task - send a freeze request to given task
- * @p: task to send the request to
- * @sig_only: if set, the request will only be sent if the task has the
- * PF_FREEZER_NOSIG flag unset
- * Return value: 'false', if @sig_only is set and the task has
- * PF_FREEZER_NOSIG set or the task is frozen, 'true', otherwise
- *
- * The freeze request is sent by setting the tasks's TIF_FREEZE flag and
- * either sending a fake signal to it or waking it up, depending on whether
- * or not it has PF_FREEZER_NOSIG set. If @sig_only is set and the task
- * has PF_FREEZER_NOSIG set (ie. it is a typical kernel thread), its
- * TIF_FREEZE flag will not be set.
- */
-static bool freeze_task(struct task_struct *p, bool sig_only)
-{
- /*
- * We first check if the task is freezing and next if it has already
- * been frozen to avoid the race with frozen_process() which first marks
- * the task as frozen and next clears its TIF_FREEZE.
- */
- if (!freezing(p)) {
- rmb();
- if (frozen(p))
- return false;
-
- if (!sig_only || should_send_signal(p))
- set_freeze_flag(p);
- else
- return false;
- }
-
- if (should_send_signal(p)) {
- if (!signal_pending(p))
- fake_signal_wake_up(p);
- } else if (sig_only) {
- return false;
- } else {
- wake_up_state(p, TASK_INTERRUPTIBLE);
- }
-
- return true;
-}
-
-static void cancel_freezing(struct task_struct *p)
-{
- unsigned long flags;
-
- if (freezing(p)) {
- pr_debug(" clean up: %s\n", p->comm);
- clear_freeze_flag(p);
- spin_lock_irqsave(&p->sighand->siglock, flags);
- recalc_sigpending_and_wake(p);
- spin_unlock_irqrestore(&p->sighand->siglock, flags);
- }
-}
-
static int try_to_freeze_tasks(bool sig_only)
{
struct task_struct *g, *p;
@@ -264,4 +149,3 @@ void thaw_processes(void)
printk("done.\n");
}
-EXPORT_SYMBOL(refrigerator);
--
1.5.3.7
--
Hi.
On Thu, 2008-07-31 at 22:07 -0700, Matt Helsley wrote:
> Now that the TIF_FREEZE flag is available in all architectures,
> extract the refrigerator() and freeze_task() from kernel/power/process.c
> and make it available to all.
>
> The refrigerator() can now be used in a control group subsystem
> implementing a control group freezer.
>
> Signed-off-by: Cedric Le Goater <[email protected]>
> Signed-off-by: Matt Helsley <[email protected]>
> Acked-by: Serge E. Hallyn <[email protected]>
> Tested-by: Matt Helsley <[email protected]>
Acked-by: Nigel Cunningham <[email protected]>
Hi,
Le Thu, 31 Jul 2008 22:07:01 -0700,
Matt Helsley <[email protected]> a écrit :
> --- a/kernel/Makefile
> +++ b/kernel/Makefile
> @@ -5,7 +5,7 @@
> obj-y = sched.o fork.o exec_domain.o panic.o printk.o \
> cpu.o exit.o itimer.o time.o softirq.o resource.o \
> sysctl.o capability.o ptrace.o timer.o user.o \
> - signal.o sys.o kmod.o workqueue.o pid.o \
> + signal.o sys.o kmod.o workqueue.o pid.o freezer.o \
I have the impression that the code in kernel/power/process.c was
compiled only if CONFIG_PM_SLEEP was set. Now that the code has been
moved to kernel/freezer.c, it is unconditionnaly compiled in every
kernel. Is that correct ?
If so, is it possible to put this new feature under some
CONFIG_SOMETHING option, for people who care about the kernel size ?
Thanks,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
On Fri, 2008-08-01 at 16:27 +-0200, Thomas Petazzoni wrote:
+AD4 Hi,
+AD4
+AD4 Le Thu, 31 Jul 2008 22:07:01 -0700,
+AD4 Matt Helsley +ADw-matthltc+AEA-us.ibm.com+AD4 a +AOk-crit :
+AD4
+AD4 +AD4 --- a/kernel/Makefile
+AD4 +AD4 +-+-+- b/kernel/Makefile
+AD4 +AD4 +AEAAQA -5,7 +-5,7 +AEAAQA
+AD4 +AD4 obj-y +AD0 sched.o fork.o exec+AF8-domain.o panic.o printk.o +AFw
+AD4 +AD4 cpu.o exit.o itimer.o time.o softirq.o resource.o +AFw
+AD4 +AD4 sysctl.o capability.o ptrace.o timer.o user.o +AFw
+AD4 +AD4 - signal.o sys.o kmod.o workqueue.o pid.o +AFw
+AD4 +AD4 +- signal.o sys.o kmod.o workqueue.o pid.o freezer.o +AFw
+AD4
+AD4 I have the impression that the code in kernel/power/process.c was
+AD4 compiled only if CONFIG+AF8-PM+AF8-SLEEP was set. Now that the code has been
+AD4 moved to kernel/freezer.c, it is unconditionnaly compiled in every
+AD4 kernel. Is that correct ?
+AD4
+AD4 If so, is it possible to put this new feature under some
+AD4 CONFIG+AF8-SOMETHING option, for people who care about the kernel size ?
How about making it depend on a combination of CONFIG variables?
Here's an RFC PATCH. Completely untested.
Signed-off-by: Matt Helsley +ADw-matthltc+AEA-us.ibm.com+AD4
---
kernel/Makefile +AHw 3 +-+--
kernel/power/Kconfig +AHw 3 +-+-+-
2 files changed, 5 insertions(+-), 1 deletion(-)
Index: linux-2.6.27-rc1-mm1/kernel/Makefile
+AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0
--- linux-2.6.27-rc1-mm1.orig/kernel/Makefile
+-+-+- linux-2.6.27-rc1-mm1/kernel/Makefile
+AEAAQA -5,7 +-5,7 +AEAAQA
obj-y +AD0 sched.o fork.o exec+AF8-domain.o panic.o printk.o +AFw
cpu.o exit.o itimer.o time.o softirq.o resource.o +AFw
sysctl.o capability.o ptrace.o timer.o user.o +AFw
- signal.o sys.o kmod.o workqueue.o pid.o freezer.o +AFw
+- signal.o sys.o kmod.o workqueue.o pid.o +AFw
rcupdate.o extable.o params.o posix-timers.o +AFw
kthread.o wait.o kfifo.o sys+AF8-ni.o posix-cpu-timers.o mutex.o +AFw
hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o +AFw
+AEAAQA -24,6 +-24,7 +AEAAQA CFLAGS+AF8-REMOVE+AF8-sched+AF8-clock.o +AD0 -pg
CFLAGS+AF8-REMOVE+AF8-sched.o +AD0 -mno-spe -pg
endif
+-obj-+ACQ(CONFIG+AF8-FREEZER) +-+AD0 freezer.o
obj-+ACQ(CONFIG+AF8-PROFILING) +-+AD0 profile.o
obj-+ACQ(CONFIG+AF8-SYSCTL+AF8-SYSCALL+AF8-CHECK) +-+AD0 sysctl+AF8-check.o
obj-+ACQ(CONFIG+AF8-STACKTRACE) +-+AD0 stacktrace.o
Index: linux-2.6.27-rc1-mm1/kernel/power/Kconfig
+AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0APQA9AD0
--- linux-2.6.27-rc1-mm1.orig/kernel/power/Kconfig
+-+-+- linux-2.6.27-rc1-mm1/kernel/power/Kconfig
+AEAAQA -85,6 +-85,9 +AEAAQA config PM+AF8-SLEEP
depends on SUSPEND +AHwAfA HIBERNATION +AHwAfA XEN+AF8-SAVE+AF8-RESTORE
default y
+-config FREEZER
+- def+AF8-bool PM+AF8-SLEEP +AHwAfA CGROUP+AF8-FREEZER
+-
config SUSPEND
bool +ACI-Suspend to RAM and standby+ACI
depends on PM +ACYAJg ARCH+AF8-SUSPEND+AF8-POSSIBLE
On Friday, 1 of August 2008, Matt Helsley wrote:> > On Fri, 2008-08-01 at 16:27 +-0200, Thomas Petazzoni wrote:> > Hi,> > > > Le Thu, 31 Jul 2008 22:07:01 -0700,> > Matt Helsley <[email protected]> a +AOk-crit :> > > > > --- a/kernel/Makefile> > > +-+-+- b/kernel/Makefile> > > @@ -5,7 +-5,7 @@> > > obj-y = sched.o fork.o exec_domain.o panic.o printk.o +AFw> > > cpu.o exit.o itimer.o time.o softirq.o resource.o +AFw> > > sysctl.o capability.o ptrace.o timer.o user.o +AFw> > > - signal.o sys.o kmod.o workqueue.o pid.o +AFw> > > +- signal.o sys.o kmod.o workqueue.o pid.o freezer.o +AFw> > > > I have the impression that the code in kernel/power/process.c was> > compiled only if CONFIG_PM_SLEEP was set. Now that the code has been> > moved to kernel/freezer.c, it is unconditionnaly compiled in every> > kernel. Is that correct ?> >> > If so, is it possible to put this new feature under some> > CONFIG_SOMETHING option, for people who care about the kernel size ?> > How about making it depend on a combination of CONFIG variables?> Here's an RFC PATCH. Completely untested.> > Signed-off-by: Matt Helsley <[email protected]>
Can you please also make the contents of include/linux/freezer.h depend onCONFIG_FREEZER instead of CONFIG_PM_SLEEP?
Also, I'm not really sure if kernel/power/Kconfig is the right place to defineCONFIG_FREEZER.
Perhaps we should even move freezer.c from kernel/power to kerneland define CONFIG_FREEZER in Kconfig in there. Andrew, what do you think?
> ---> kernel/Makefile | 3 +-+--> kernel/power/Kconfig | 3 +-+-+-> 2 files changed, 5 insertions(+-), 1 deletion(-)> > Index: linux-2.6.27-rc1-mm1/kernel/Makefile> ===================================================================> --- linux-2.6.27-rc1-mm1.orig/kernel/Makefile> +-+-+- linux-2.6.27-rc1-mm1/kernel/Makefile> @@ -5,7 +-5,7 @@> obj-y = sched.o fork.o exec_domain.o panic.o printk.o +AFw> cpu.o exit.o itimer.o time.o softirq.o resource.o +AFw> sysctl.o capability.o ptrace.o timer.o user.o +AFw> - signal.o sys.o kmod.o workqueue.o pid.o freezer.o +AFw> +- signal.o sys.o kmod.o workqueue.o pid.o +AFw> rcupdate.o extable.o params.o posix-timers.o +AFw> kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o +AFw> hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o +AFw> @@ -24,6 +-24,7 @@ CFLAGS_REMOVE_sched_clock.o = -pg> CFLAGS_REMOVE_sched.o = -mno-spe -pg> endif> > +-obj-$(CONFIG_FREEZER) +-= freezer.o> obj-$(CONFIG_PROFILING) +-= profile.o> obj-$(CONFIG_SYSCTL_SYSCALL_CHECK) +-= sysctl_check.o> obj-$(CONFIG_STACKTRACE) +-= stacktrace.o> Index: linux-2.6.27-rc1-mm1/kernel/power/Kconfig> ===================================================================> --- linux-2.6.27-rc1-mm1.orig/kernel/power/Kconfig> +-+-+- linux-2.6.27-rc1-mm1/kernel/power/Kconfig> @@ -85,6 +-85,9 @@ config PM_SLEEP> depends on SUSPEND || HIBERNATION || XEN_SAVE_RESTORE> default y> > +-config FREEZER> +- def_bool PM_SLEEP || CGROUP_FREEZER> +-> config SUSPEND> bool "Suspend to RAM and standby"> depends on PM && ARCH_SUSPEND_POSSIBLE> > > > >
?????? ??? ??? ??? ??? `?? #: #' # #??? ??? ??? ??? ??? ??? ???X????????????????????????????????????????????????????????????????????????????ͼ??n}?? F??0???8???@???E???????@???1????????? ??? ??? ??? ??? ??? Z?? #A #/ # #??? ??? ??? ??? ??? ???????????????????????????????????????????????????????????????????????????????????????%r?? -o? K??7???=???D???????4???!?????? ??? ??? ??? ??? ??? ?? W?? #D #2 # #??? ??? ??? ??? ??? ???v????????????????????????????????????????????????????????????????????????????????p}??!q?? 6s? 9~? \??:???????????%?????? ??? ??? ??? ??? ??? ??? z?? S?? #D #3 # #??? ??? ??? ??? ????????????????????????????????????????????????????????????????????????????????????vx?m??s?? 7v? Fv? G?? g??;???{????????? ??? ??? ??? ??? ??? {?? r?? P?? #D #3 # #??? ??? ??? ??? ????????????????????????????????????????????????????????????????????????????????????or??m??u??a??? Dx? Z?? P?? k??s?????? ??? ??? ??? ??? ??? }?? t?? l?? M?? #D #3 # #??? ??? ??? ???.?????????????????????????????????????????????????????????????????????????????????vx?i??o??w?????r??? U?? f?? T?? t?? p?? l?? h?? d?? `?? Z?? V?? R?? M?? ??? #D #3 # #??? ??? ??? ????????????????????????????????????????????????????????????????????????????????????mo??j??p??z??????????? a?? m?? ??? ??? ??? ??? ??? ??? ???m??Lz?w #J #H #> #. # #??? ??? ???S????????????????????????????????????????????ν???????????????????????????????????ux?h??j??r?????????? ??????? k?? ~?? ?? ??? ??? ??? ??? ??? i??m??Oz?t #? #3 #$ # #??? ?????????????????????????????????????????????????????????????????????????????????????jn??f??k?? u??
????????? ???+??????? x?? z?? ??? ??? ??? ??? ??? ??? z??j??W??l #& # # #??? ????????????????????????????????????????????????????????????????????????????????????tx?h??h??n??x???????????!???/???8??????????????????????????????????????x???h??? #' # # #??? ???*???ѵ??????????????????????????????????ì??˷??????????????????????????????????g]|? i?? h?? q?? {???????????$???4???@???????P???????-????????? ??? ??? ??? ??? `?? #0 # # #??? #q\S؝????????????????????????????????????????????????????????????????????????uv?1?? i?? j?? r?? }?? ??? Q?????$???2???F???????@???1????????? ??? ??? ??? ??? ??? Z?? #< #* # #??? #Q;0dq\S?Ӽ???????????????????????????????????????????????????????????????????im? 0?? k?? m?? t?? }?? ??? 4?? Q??!???4???G???????4???!?????? ??? ??? ??? ??? ??? ?? W?? #C #1 # #??? V@5ȣ????????????????????????????????????????????????????????????????tu?+$&V 2?? m?? p?? x?? |?? ??? ;?? 5?? Z??8???P???????%?????? ??? ??? ??? ??? ??? ??? z?? S?? #D #3 # #??? ??? w_Y?Կ???????????????????????????????????????????????????????????lo?"J 3?? p?? q?? w?? }?? ??? ;?? =?? =?? e??T???{????????? ??? ??? ??? ??? ??? {?? r?? P?? #D #3 # #??? ??? T?5??????????????????????????????????????????????????????????rr?,%'V"E 5?? q?? r?? w?? z?? ~??Q??? =?? L?? V?? l?? x?? s?? o?? k?? f?? b?? [?? Z?? V?? R?? @?? #D #3 # #??? ??? ???
s[U?ҿ??????????????????????;???????????????????????????km?OB 3?? t?? u?? w?? z?? ~?? ???f??? L?? Y?? a?? z?? r?? t?? }?? ??? ??? p??'??? #K #I #G #> #. # #??? ??? ???
R=4?????????????????????????˼??????????????????ʻ???po?!kW1;Sa
4??c?? u?? u?? u?? |?? ??????r??? [?? b?? i?? p?? v?? }?? ??? ??? o??l?? #I #C #; #0 #" # #??? ??? ??? ???
pZR?κ??????????????????ȹ???????????????????????hi?j]K-9S[6??^?? s?? w?? |?? ??????-???~??? b?? l?? r?? x?? {?? ??? ??? ??? ???q??Q??? #- # # # #??? ??? ??? ???
M:1???~?ʻ??????????????Ŷ??????????????Ĵ???nm?vi[I?%/CV7??Z?? w?? }????????6???M??????? m?? r?? w?? ~?? ??? ??? ??? ??? ???q?? #* # # # #??? ??? ??? ??? ???
jLD?ɶ???ÿ??????????????Ŀ??¾??????????ef?mc
T C:<"1U9??W?? }?? ??????:???[???v??????????????????????????????????????x???h??? #! # # #??? ??? ??? ??? ??? P71g?b]?ó??̼??????????????̽???????lj?vi\
J<56=!O<??V?? ??????@???b???????????P???????-????????? ??? ??? ??? ??? `?? #0 # # #??? ??? ??? ??? ??? ???
fHA?®??ȸ??????????ȸ??ȹ????~??ce?md
T C83 36="N@??Y?????H???l???????????@???1????????? ??? ??? ??? ??? ??? Z?? #< #) # #??? ??? ??? ??? ??? ??? 8-':pQJ?????????????ô??????{WS?wi\
J<4 2 1 125;#H??^??C???l???????????4???!?????? ??? ??? ??? ??? ??? ?? W?? #B #0 # #??? ??? ??? ??? ??? ??? ??? _D=??????????????????yw?{XU?md
U C82 / + &!
%*R??c??a???????????%?????? ??? ??? ??? ??? ??? ??? z?? S?? #D #3 # #??? ??? ??? ??? ??? ??? ???
lNF?????????????yUQ?!{i]J;/ ( #
".X??b??????{????????? ??? ??? ??? ??? ??? {?? r?? P?? #D #3 # #??? ??? ??? ??? ??? ??? ??? ???
W>7~?vu?????wXU?{XU?mcR <+ # # # #1]??a??p?????? ??? ??? ??? ??? ??? }?? t?? l?? M?? #D #3 # #??? ??? ??? ??? ??? ??? ??? ??? ???
hJCݤ???wTO?#xeU>' # # # # # # #<j?? t?? p?? l?? h?? d?? `?? Z?? V?? R?? M?? H?? #D #3 # #??? ??? ??? ??? ??? ??? ??? ??? ???
I4/W~]X??ll?]T>% # # # # # # # # # # # #) #7 #@ #D #D #D #D #D #D #D #D #= #. # #??? ??? ??? ??? ??? ??? ??? ??? ??? ???
lUO?7-.PE;% ??? # # # # # # # # # # # # # #$ #. #2 #3 #3 #3 #3 #3 #3 #3 #. #" # #??? ??? ??? ??? ??? ??? ??? ??? ??? ??? #"#$ +!&! # #??? ??? # # # # # # # # # # # # # # # # # # # # # # # # # # #??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? #! # # # #??? ??? ??? # # # # # # # # # # # # # # # # # # # # # # # # # # #??? ??? ??? ??? ??? ??? ??? ??? ??????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m????????????I?
On Sat, 2008-08-02 at 00:53 +-0200, Rafael J. Wysocki wrote:
+AD4 On Friday, 1 of August 2008, Matt Helsley wrote:
+AD4 +AD4
+AD4 +AD4 On Fri, 2008-08-01 at 16:27 +-0200, Thomas Petazzoni wrote:
+AD4 +AD4 +AD4 Hi,
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 Le Thu, 31 Jul 2008 22:07:01 -0700,
+AD4 +AD4 +AD4 Matt Helsley +ADw-matthltc+AEA-us.ibm.com+AD4 a +AOk-crit :
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 +AD4 --- a/kernel/Makefile
+AD4 +AD4 +AD4 +AD4 +-+-+- b/kernel/Makefile
+AD4 +AD4 +AD4 +AD4 +AEAAQA -5,7 +-5,7 +AEAAQA
+AD4 +AD4 +AD4 +AD4 obj-y +AD0 sched.o fork.o exec+AF8-domain.o panic.o printk.o +AFw
+AD4 +AD4 +AD4 +AD4 cpu.o exit.o itimer.o time.o softirq.o resource.o +AFw
+AD4 +AD4 +AD4 +AD4 sysctl.o capability.o ptrace.o timer.o user.o +AFw
+AD4 +AD4 +AD4 +AD4 - signal.o sys.o kmod.o workqueue.o pid.o +AFw
+AD4 +AD4 +AD4 +AD4 +- signal.o sys.o kmod.o workqueue.o pid.o freezer.o +AFw
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 I have the impression that the code in kernel/power/process.c was
+AD4 +AD4 +AD4 compiled only if CONFIG+AF8-PM+AF8-SLEEP was set. Now that the code has been
+AD4 +AD4 +AD4 moved to kernel/freezer.c, it is unconditionnaly compiled in every
+AD4 +AD4 +AD4 kernel. Is that correct ?
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 If so, is it possible to put this new feature under some
+AD4 +AD4 +AD4 CONFIG+AF8-SOMETHING option, for people who care about the kernel size ?
+AD4 +AD4
+AD4 +AD4 How about making it depend on a combination of CONFIG variables?
+AD4 +AD4 Here's an RFC PATCH. Completely untested.
+AD4 +AD4
+AD4 +AD4 Signed-off-by: Matt Helsley +ADw-matthltc+AEA-us.ibm.com+AD4
+AD4
+AD4 Can you please also make the contents of include/linux/freezer.h depend on
+AD4 CONFIG+AF8-FREEZER instead of CONFIG+AF8-PM+AF8-SLEEP?
Good point -- I'll add that to this patch and repost.
+AD4 Also, I'm not really sure if kernel/power/Kconfig is the right place to define
+AD4 CONFIG+AF8-FREEZER.
There's no nice place to put it since we're dealing with CONFIG+AF8
variables in two different Kconfig files. I put it in
kernel/power/Kconfig because I wasn't certain Kbuild would do the right
thing if I referenced PM+AF8-SLEEP from init/Kconfig.
+AD4 Perhaps we should even move freezer.c from kernel/power to kernel
It's already there. Perhaps you meant something else
(kernel/power/process.c?)?
+AD4 and define CONFIG+AF8-FREEZER in Kconfig in there. Andrew, what do you think?
The Kconfig files in kernel/ are Kconfig.hz and Kconfig.preemt which
don't seem appropriate. I suppose we could add another (perhaps
Kconfig.cgroup).
Thanks for the review+ACE
Cheers,
-Matt
Le Fri, 01 Aug 2008 12:08:09 -0700,
Matt Helsley <[email protected]> a écrit :
> How about making it depend on a combination of CONFIG
> variables? Here's an RFC PATCH. Completely untested.
It solves my kernel size increase problem, so it's perfectly fine for
me.
Thanks!
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
On Saturday, 2 of August 2008, Matt Helsley wrote:> > On Sat, 2008-08-02 at 00:53 +-0200, Rafael J. Wysocki wrote:> > On Friday, 1 of August 2008, Matt Helsley wrote:> > > > > > On Fri, 2008-08-01 at 16:27 +-0200, Thomas Petazzoni wrote:> > > > Hi,> > > > > > > > Le Thu, 31 Jul 2008 22:07:01 -0700,> > > > Matt Helsley <[email protected]> a +AOk-crit :> > > > > > > > > --- a/kernel/Makefile> > > > > +-+-+- b/kernel/Makefile> > > > > @@ -5,7 +-5,7 @@> > > > > obj-y = sched.o fork.o exec_domain.o panic.o printk.o +AFw> > > > > cpu.o exit.o itimer.o time.o softirq.o resource.o +AFw> > > > > sysctl.o capability.o ptrace.o timer.o user.o +AFw> > > > > - signal.o sys.o kmod.o workqueue.o pid.o +AFw> > > > > +- signal.o sys.o kmod.o workqueue.o pid.o freezer.o +AFw> > > > > > > > I have the impression that the code in kernel/power/process.c was> > > > compiled only if CONFIG_PM_SLEEP was set. Now that the code has been> > > > moved to kernel/freezer.c, it is unconditionnaly compiled in every> > > > kernel. Is that correct ?> > > >> > > > If so, is it possible to put this new feature under some> > > > CONFIG_SOMETHING option, for people who care about the kernel size ?> > > > > > How about making it depend on a combination of CONFIG variables?> > > Here's an RFC PATCH. Completely untested.> > > > > > Signed-off-by: Matt Helsley <[email protected]>> > > > Can you please also make the contents of include/linux/freezer.h depend on> > CONFIG_FREEZER instead of CONFIG_PM_SLEEP?> > Good point -- I'll add that to this patch and repost.> > > Also, I'm not really sure if kernel/power/Kconfig is the right place to define> > CONFIG_FREEZER.> > There's no nice place to put it since we're dealing with CONFIG_> variables in two different Kconfig files. I put it in> kernel/power/Kconfig because I wasn't certain Kbuild would do the right> thing if I referenced PM_SLEEP from init/Kconfig.> > > Perhaps we should even move freezer.c from kernel/power to kernel> > It's already there.
Yes, sorry.
> Perhaps you meant something else (kernel/power/process.c?)?
Well, I'll have to actually apply the patches and look at the modified code.
> > and define CONFIG_FREEZER in Kconfig in there. Andrew, what do you think?> > The Kconfig files in kernel/ are Kconfig.hz and Kconfig.preemt which> don't seem appropriate. I suppose we could add another (perhaps> Kconfig.cgroup).
Either that, or Kconfig.freezer maybe? After all, it will also be used forPM_SLEEP, at least for some time.
> Thanks for the review!
You're welcome.
Thanks,Rafael 7mN? ??n ?7mN? p4o 0?g A p?? ???M? ?7mN? 5o ?7mN? ??n ?7mN? `5o ?5o ? p?? ???M? ?7mN? ?5o ?7mN? ??n ?7mN? P6o p6o a p?? ???M? ?7mN? ?6o ?7mN? ??n ?7mN? @7o `7o ? p?? ???M? ?7mN? ?7o ?7mN? ??n ?7mN? 08o P8o ? p?? ???M? ?7mN? p8o ?7mN? ??n ?7mN? 9o @9o p?? ???M? ?7mN? `9o ?7mN? ??n ?7mN? :o 0:o ? p?? ???M? ?7mN? P:o ?7mN? ??n ?7mN? ;o ;o 1 p?? ???M? ?7mN? @;o ?7mN? ??n ?7mN? ?;o <o ? p?? ???M? ?7mN? 0<o ?7mN? ??n ?7mN? ?<o =o Q p?? ???M? ?7mN? =o ?7mN? ??n ?7mN? ?=o ?=o ? p?? ???M? ?7mN? >o ?7mN? ??n ?7mN? ?>o ?>o q p?? ???M? ?7mN? ?o ?7mN? ??n ?7mN? ??o ??o p?? ???M? ?7mN? ??o ?7mN? ??n ?7mN? ?@o ?@o ? p?? ???M? ?7mN? ?@o ?7mN? ??n ?7mN? ?Ao ?Ao ! p?? ???M? ?7mN? ?Ao ?7mN? ??n ?7mN? ?Bo ?Bo ? p?? ???M? ?7mN? ?Bo ?7mN? ??n ?7mN? pCo ?Co A p?? ???M? ?7mN? ?Co ?7mN? ??n ?7mN? `Do ?Do ?
p?? ???M? ?7mN? ?Do ?7mN? ??n ?7mN? PEo pEo a
p?? ???M? ?7mN? ?Eo ?7mN? ??n ?7mN? @Fo `Fo ? p?? ???M? ?7mN? ?Fo ?7mN? ??n ?7mN? 0Go PGo ? p?? ???M? ?7mN? pGo ?7mN? ??n ?7mN? Ho @Ho p?? ???M? ?7mN? `Ho ?7mN? ??n ?7mN? Io 0Io ? p?? ???M? ?7mN? ?4o ?7mN? ??n ?7mN? ?Io ??g 1 p?? ???M? ?7mN? Jo ?7mN? ??n ?7mN? ?Jo ?Jo ? p?? ???M? ?7mN? ?o ?7mN? ??n ?7mN? ?Ko ?Ko Q p?? ???M? ?7mN? Lo ?7mN? ??n ?7mN? ?Lo ?Lo ? p?? ???M? ?7mN? ?Lo ?7mN? ??n ?7mN? ?Mo ?Mo q p?? ???M? ?7mN? pNo ?7mN? @!o ?7mN? ?Mo p?? ???M? ?7mN? @Oo ?7mN? @!o ?7mN? ?Oo ?Oo ? p?? ???M? ?7mN? ?Oo ?7mN? @!o ?7mN? pPo ?Po ! p?? ???M? ?7mN? ?Po ?7mN? @!o ?7mN? `Qo ?Qo ? p?? ???M? ?7mN? ?Qo ?7mN? @!o ?7mN? PRo pRo A p?? ???M? ?7mN? ?Ro ?7mN? @!o ?7mN? @So `So ? p?? ???M? ?7mN? ?So ?7mN? @!o ?7mN? 0To PTo a p?? ???M? ?7mN? pTo ?7mN? @!o ?7mN? Uo @Uo ? p?? ???M? ?7mN? `Uo ?7mN? @!o ?7mN? Vo 0Vo ? p?? ???M? ?7mN? PVo ?7mN? @!o ?7mN? Wo Wo p?? ???M? ?7mN? @Wo ?7mN? @!o ?7mN? ?Wo Xo ? p?? ???M? ?7mN? 0Xo ?7mN? @!o ?7mN? ?Xo Yo 1 p?? ???M? ?7mN? Yo ?7mN? @!o ?7mN? ?Yo ?Yo ? p?? ???M? ?? ?7mN? ?No ?7mN? @!o ?7mN? ?Zo [o Q p?? ???M? `? ?7mN? ?Zo ?7mN? @!o ?7mN? ?[o ?[o ? p?? ???M? ?? ?7mN? \o ?7mN? @!o ?7mN? ?\o ?\o q p?? ???M? ? ?7mN? ?\o ?7mN? @!o ?7mN? ?]o ?]o p?? ???M? @? ?7mN? ?]o ?7mN? @!o ?7mN? ?^o ?^o ? p?? ???M? `? ?7mN? ?^o ?7mN? @!o ?7mN? ?_o ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m????????????I?
On Sat, 2008-08-02 at 00:53 +-0200, Rafael J. Wysocki wrote:
+AD4 On Friday, 1 of August 2008, Matt Helsley wrote:
+AD4 +AD4
+AD4 +AD4 On Fri, 2008-08-01 at 16:27 +-0200, Thomas Petazzoni wrote:
+AD4 +AD4 +AD4 Hi,
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 Le Thu, 31 Jul 2008 22:07:01 -0700,
+AD4 +AD4 +AD4 Matt Helsley +ADw-matthltc+AEA-us.ibm.com+AD4 a +AOk-crit :
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 +AD4 --- a/kernel/Makefile
+AD4 +AD4 +AD4 +AD4 +-+-+- b/kernel/Makefile
+AD4 +AD4 +AD4 +AD4 +AEAAQA -5,7 +-5,7 +AEAAQA
+AD4 +AD4 +AD4 +AD4 obj-y +AD0 sched.o fork.o exec+AF8-domain.o panic.o printk.o +AFw
+AD4 +AD4 +AD4 +AD4 cpu.o exit.o itimer.o time.o softirq.o resource.o +AFw
+AD4 +AD4 +AD4 +AD4 sysctl.o capability.o ptrace.o timer.o user.o +AFw
+AD4 +AD4 +AD4 +AD4 - signal.o sys.o kmod.o workqueue.o pid.o +AFw
+AD4 +AD4 +AD4 +AD4 +- signal.o sys.o kmod.o workqueue.o pid.o freezer.o +AFw
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 I have the impression that the code in kernel/power/process.c was
+AD4 +AD4 +AD4 compiled only if CONFIG+AF8-PM+AF8-SLEEP was set. Now that the code has been
+AD4 +AD4 +AD4 moved to kernel/freezer.c, it is unconditionnaly compiled in every
+AD4 +AD4 +AD4 kernel. Is that correct ?
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 If so, is it possible to put this new feature under some
+AD4 +AD4 +AD4 CONFIG+AF8-SOMETHING option, for people who care about the kernel size ?
+AD4 +AD4
+AD4 +AD4 How about making it depend on a combination of CONFIG variables?
+AD4 +AD4 Here's an RFC PATCH. Completely untested.
+AD4 +AD4
+AD4 +AD4 Signed-off-by: Matt Helsley +ADw-matthltc+AEA-us.ibm.com+AD4
+AD4
+AD4 Can you please also make the contents of include/linux/freezer.h depend on
+AD4 CONFIG+AF8-FREEZER instead of CONFIG+AF8-PM+AF8-SLEEP?
Done.
+AD4 Also, I'm not really sure if kernel/power/Kconfig is the right place to define
+AD4 CONFIG+AF8-FREEZER.
+AD4
+AD4 Perhaps we should even move freezer.c from kernel/power to kernel
+AD4 and define CONFIG+AF8-FREEZER in Kconfig in there. Andrew, what do you think?
I'll check this weekend for replies and repost the RFC PATCH on Monday
if I don't hear anything. In the meantime I'll be doing some config
build testing with the above changes to make sure it's correct.
Cheers,
-Matt