Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-24 Thread Rafael J. Wysocki
On Tuesday, 24 April 2007 01:19, Oleg Nesterov wrote: > On 04/24, Rafael J. Wysocki wrote: > > > > On Tuesday, 24 April 2007 00:55, Oleg Nesterov wrote: > > > On 04/24, Rafael J. Wysocki wrote: > > > > > > > > Should I clear it in dup_task_struct() or is there a better place? > > > > > > I

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-24 Thread Rafael J. Wysocki
On Tuesday, 24 April 2007 01:19, Oleg Nesterov wrote: On 04/24, Rafael J. Wysocki wrote: On Tuesday, 24 April 2007 00:55, Oleg Nesterov wrote: On 04/24, Rafael J. Wysocki wrote: Should I clear it in dup_task_struct() or is there a better place? I personally think we should

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Oleg Nesterov
On 04/24, Rafael J. Wysocki wrote: > > On Tuesday, 24 April 2007 00:55, Oleg Nesterov wrote: > > On 04/24, Rafael J. Wysocki wrote: > > > > > > Should I clear it in dup_task_struct() or is there a better place? > > > > I personally think we should do this in dup_task_struct(). In fact, I > >

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Rafael J. Wysocki
On Tuesday, 24 April 2007 00:55, Oleg Nesterov wrote: > On 04/24, Rafael J. Wysocki wrote: > > > > Should I clear it in dup_task_struct() or is there a better place? > > I personally think we should do this in dup_task_struct(). In fact, I believe > it is better to replace the > > *tsk =

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Rafael J. Wysocki
On Tuesday, 24 April 2007 00:41, Gautham R Shenoy wrote: > On Tue, Apr 24, 2007 at 12:40:17AM +0200, Rafael J. Wysocki wrote: > > On Tuesday, 24 April 2007 00:23, Oleg Nesterov wrote: > > > On 04/22, Rafael J. Wysocki wrote: > > > > > > > > Move all of the freezer-related flags to a separate

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Oleg Nesterov
On 04/24, Rafael J. Wysocki wrote: > > Should I clear it in dup_task_struct() or is there a better place? I personally think we should do this in dup_task_struct(). In fact, I believe it is better to replace the *tsk = *orig; with some helper (like setup_thread_stack() below), and that

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Gautham R Shenoy
On Tue, Apr 24, 2007 at 12:40:17AM +0200, Rafael J. Wysocki wrote: > On Tuesday, 24 April 2007 00:23, Oleg Nesterov wrote: > > On 04/22, Rafael J. Wysocki wrote: > > > > > > Move all of the freezer-related flags to a separate field in task_struct > > > and > > > introduce functions to operate

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Rafael J. Wysocki
On Tuesday, 24 April 2007 00:23, Oleg Nesterov wrote: > On 04/22, Rafael J. Wysocki wrote: > > > > Move all of the freezer-related flags to a separate field in task_struct and > > introduce functions to operate them using set_bit() etc. > > > > [...snip...] > > > > ---

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Oleg Nesterov
On 04/22, Rafael J. Wysocki wrote: > > Move all of the freezer-related flags to a separate field in task_struct and > introduce functions to operate them using set_bit() etc. > > [...snip...] > > --- linux-2.6.21-rc6-mm1.orig/kernel/fork.c 2007-04-22 19:37:42.0 > +0200 > +++

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Rafael J. Wysocki
On Monday, 23 April 2007 15:17, Gautham R Shenoy wrote: > On Sun, Apr 22, 2007 at 09:39:26PM +0200, Rafael J. Wysocki wrote: > > @@ -63,9 +100,9 @@ static inline int thaw_process(struct ta > > */ > > static inline void frozen_process(struct task_struct *p) > > { > > - p->flags |= PF_FROZEN;

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Rafael J. Wysocki
On Monday, 23 April 2007 16:19, Gautham R Shenoy wrote: > Hi Satyam, > On Mon, Apr 23, 2007 at 09:39:30AM +0530, Satyam Sharma wrote: > > Hi Rafael, > > > > >+/* > > >+ * Per task flags used by the freezer > > >+ * > > >+ * They should not be referred to directly outside of this file. >

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Rafael J. Wysocki
Hi, On Monday, 23 April 2007 06:09, Satyam Sharma wrote: > Hi Rafael, > [--snip--] > > Also, I do have several gripes against the naming of some of these functions: > > > static inline int freezing(struct task_struct *p) > > This could be called task_should_freeze(). > > > /* > > - *

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Gautham R Shenoy
Hi Satyam, On Mon, Apr 23, 2007 at 09:39:30AM +0530, Satyam Sharma wrote: > Hi Rafael, > > >+/* > >+ * Per task flags used by the freezer > >+ * > >+ * They should not be referred to directly outside of this file. > >+ */ > >+#define TFF_NOFREEZE 0 /* task should not be frozen */

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Gautham R Shenoy
On Sun, Apr 22, 2007 at 09:39:26PM +0200, Rafael J. Wysocki wrote: > @@ -63,9 +100,9 @@ static inline int thaw_process(struct ta > */ > static inline void frozen_process(struct task_struct *p) > { > - p->flags |= PF_FROZEN; > + set_frozen_flag(p); > wmb(); > -

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Pavel Machek
Hi! > From: Rafael J. Wysocki <[EMAIL PROTECTED]> > > Move all of the freezer-related flags to a separate field in task_struct and > introduce functions to operate them using set_bit() etc. Looks sane to me. > Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]> -- (english)

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Pavel Machek
Hi! From: Rafael J. Wysocki [EMAIL PROTECTED] Move all of the freezer-related flags to a separate field in task_struct and introduce functions to operate them using set_bit() etc. Looks sane to me. Signed-off-by: Rafael J. Wysocki [EMAIL PROTECTED] -- (english)

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Gautham R Shenoy
On Sun, Apr 22, 2007 at 09:39:26PM +0200, Rafael J. Wysocki wrote: @@ -63,9 +100,9 @@ static inline int thaw_process(struct ta */ static inline void frozen_process(struct task_struct *p) { - p-flags |= PF_FROZEN; + set_frozen_flag(p); wmb(); - clear_tsk_thread_flag(p,

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Gautham R Shenoy
Hi Satyam, On Mon, Apr 23, 2007 at 09:39:30AM +0530, Satyam Sharma wrote: Hi Rafael, +/* + * Per task flags used by the freezer + * + * They should not be referred to directly outside of this file. + */ +#define TFF_NOFREEZE 0 /* task should not be frozen */ +#define

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Rafael J. Wysocki
On Monday, 23 April 2007 16:19, Gautham R Shenoy wrote: Hi Satyam, On Mon, Apr 23, 2007 at 09:39:30AM +0530, Satyam Sharma wrote: Hi Rafael, +/* + * Per task flags used by the freezer + * + * They should not be referred to directly outside of this file. + */ +#define

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Rafael J. Wysocki
Hi, On Monday, 23 April 2007 06:09, Satyam Sharma wrote: Hi Rafael, [--snip--] Also, I do have several gripes against the naming of some of these functions: static inline int freezing(struct task_struct *p) This could be called task_should_freeze(). /* - * Sometimes we may

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Rafael J. Wysocki
On Monday, 23 April 2007 15:17, Gautham R Shenoy wrote: On Sun, Apr 22, 2007 at 09:39:26PM +0200, Rafael J. Wysocki wrote: @@ -63,9 +100,9 @@ static inline int thaw_process(struct ta */ static inline void frozen_process(struct task_struct *p) { - p-flags |= PF_FROZEN; +

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Oleg Nesterov
On 04/22, Rafael J. Wysocki wrote: Move all of the freezer-related flags to a separate field in task_struct and introduce functions to operate them using set_bit() etc. [...snip...] --- linux-2.6.21-rc6-mm1.orig/kernel/fork.c 2007-04-22 19:37:42.0 +0200 +++

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Rafael J. Wysocki
On Tuesday, 24 April 2007 00:23, Oleg Nesterov wrote: On 04/22, Rafael J. Wysocki wrote: Move all of the freezer-related flags to a separate field in task_struct and introduce functions to operate them using set_bit() etc. [...snip...] --- linux-2.6.21-rc6-mm1.orig/kernel/fork.c

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Gautham R Shenoy
On Tue, Apr 24, 2007 at 12:40:17AM +0200, Rafael J. Wysocki wrote: On Tuesday, 24 April 2007 00:23, Oleg Nesterov wrote: On 04/22, Rafael J. Wysocki wrote: Move all of the freezer-related flags to a separate field in task_struct and introduce functions to operate them using

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Rafael J. Wysocki
On Tuesday, 24 April 2007 00:41, Gautham R Shenoy wrote: On Tue, Apr 24, 2007 at 12:40:17AM +0200, Rafael J. Wysocki wrote: On Tuesday, 24 April 2007 00:23, Oleg Nesterov wrote: On 04/22, Rafael J. Wysocki wrote: Move all of the freezer-related flags to a separate field in

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Oleg Nesterov
On 04/24, Rafael J. Wysocki wrote: Should I clear it in dup_task_struct() or is there a better place? I personally think we should do this in dup_task_struct(). In fact, I believe it is better to replace the *tsk = *orig; with some helper (like setup_thread_stack() below), and that

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Rafael J. Wysocki
On Tuesday, 24 April 2007 00:55, Oleg Nesterov wrote: On 04/24, Rafael J. Wysocki wrote: Should I clear it in dup_task_struct() or is there a better place? I personally think we should do this in dup_task_struct(). In fact, I believe it is better to replace the *tsk = *orig;

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-23 Thread Oleg Nesterov
On 04/24, Rafael J. Wysocki wrote: On Tuesday, 24 April 2007 00:55, Oleg Nesterov wrote: On 04/24, Rafael J. Wysocki wrote: Should I clear it in dup_task_struct() or is there a better place? I personally think we should do this in dup_task_struct(). In fact, I believe it is

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-22 Thread Satyam Sharma
Hi Rafael, +/* + * Per task flags used by the freezer + * + * They should not be referred to directly outside of this file. + */ +#define TFF_NOFREEZE 0 /* task should not be frozen */ +#define TFF_FREEZE 8 /* task should go to the refrigerator ASAP */ +#define

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-22 Thread Satyam Sharma
On 4/23/07, Paul Jackson <[EMAIL PROTECTED]> wrote: One more question - why would I want to do this? Check out the FAQ in Documentation/power/swsusp.txt. Is this like something that would be useful on a laptop, to suspend activity and reduce battery drain, while preserving the current state

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-22 Thread Paul Jackson
Rafael wrote: > I'll try to explain how it works. Ok - thanks. Good explanation of how it works. One more question - why would I want to do this? Is this like something that would be useful on a laptop, to suspend activity and reduce battery drain, while preserving the current state of ones

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-22 Thread Rafael J. Wysocki
On Sunday, 22 April 2007 23:14, Paul Jackson wrote: > Rafael wrote: > > Move all of the freezer-related flags to a separate field in task_struct and > > introduce functions to operate them using set_bit() etc. > > It's getting time I learned what this freezer thing is. > > What would you suggest

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-22 Thread Paul Jackson
Rafael wrote: > Move all of the freezer-related flags to a separate field in task_struct and > introduce functions to operate them using set_bit() etc. It's getting time I learned what this freezer thing is. What would you suggest I read? I looked in include/linux/freezer.h and didn't see any

[RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-22 Thread Rafael J. Wysocki
From: Rafael J. Wysocki <[EMAIL PROTECTED]> Move all of the freezer-related flags to a separate field in task_struct and introduce functions to operate them using set_bit() etc. Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]> --- Documentation/power/kernel_threads.txt |2 -

[RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-22 Thread Rafael J. Wysocki
From: Rafael J. Wysocki [EMAIL PROTECTED] Move all of the freezer-related flags to a separate field in task_struct and introduce functions to operate them using set_bit() etc. Signed-off-by: Rafael J. Wysocki [EMAIL PROTECTED] --- Documentation/power/kernel_threads.txt |2 -

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-22 Thread Paul Jackson
Rafael wrote: Move all of the freezer-related flags to a separate field in task_struct and introduce functions to operate them using set_bit() etc. It's getting time I learned what this freezer thing is. What would you suggest I read? I looked in include/linux/freezer.h and didn't see any

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-22 Thread Rafael J. Wysocki
On Sunday, 22 April 2007 23:14, Paul Jackson wrote: Rafael wrote: Move all of the freezer-related flags to a separate field in task_struct and introduce functions to operate them using set_bit() etc. It's getting time I learned what this freezer thing is. What would you suggest I read?

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-22 Thread Paul Jackson
Rafael wrote: I'll try to explain how it works. Ok - thanks. Good explanation of how it works. One more question - why would I want to do this? Is this like something that would be useful on a laptop, to suspend activity and reduce battery drain, while preserving the current state of ones

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-22 Thread Satyam Sharma
On 4/23/07, Paul Jackson [EMAIL PROTECTED] wrote: One more question - why would I want to do this? Check out the FAQ in Documentation/power/swsusp.txt. Is this like something that would be useful on a laptop, to suspend activity and reduce battery drain, while preserving the current state of

Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags

2007-04-22 Thread Satyam Sharma
Hi Rafael, +/* + * Per task flags used by the freezer + * + * They should not be referred to directly outside of this file. + */ +#define TFF_NOFREEZE 0 /* task should not be frozen */ +#define TFF_FREEZE 8 /* task should go to the refrigerator ASAP */ +#define