Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-12-06 Thread Matthew Wilcox
On Wed, Dec 05, 2007 at 01:56:22PM +0100, Ingo Molnar wrote: > 1) please change 'is' and 'task' around so that it reads nicer: > >if (task_is_stopped(t)) > > instead of the tongue-twister: > >if (is_task_stopped(t)) Sure, no problem. I vacillated on this order myself. > 2) please

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-12-06 Thread Matthew Wilcox
On Wed, Dec 05, 2007 at 01:56:22PM +0100, Ingo Molnar wrote: 1) please change 'is' and 'task' around so that it reads nicer: if (task_is_stopped(t)) instead of the tongue-twister: if (is_task_stopped(t)) Sure, no problem. I vacillated on this order myself. 2) please change

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-12-05 Thread Ingo Molnar
* Matthew Wilcox <[EMAIL PROTECTED]> wrote: > +#define is_task_stopped(task)((task->state & TASK_STOPPED) != 0) > +#define is_task_stopped_or_traced(task) \ > + ((task->state & (TASK_STOPPED | TASK_TRACED)) != 0) > +#define is_task_loadavg(task)

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-12-05 Thread Ingo Molnar
* Matthew Wilcox [EMAIL PROTECTED] wrote: +#define is_task_stopped(task)((task-state TASK_STOPPED) != 0) +#define is_task_stopped_or_traced(task) \ + ((task-state (TASK_STOPPED | TASK_TRACED)) != 0) +#define is_task_loadavg(task)((task-state

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-10-26 Thread Matthew Wilcox
On Sat, Oct 27, 2007 at 12:39:41AM +0400, Alexey Dobriyan wrote: > > > - if ((task->state != TASK_STOPPED) && (task->state != > > > TASK_TRACED)) { > > > + if (!is_task_stopped_or_traced(task)) { > ^^ > > I think this is horrible. Are

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-10-26 Thread Alexey Dobriyan
On Fri, Oct 26, 2007 at 11:45:15AM -0700, Andrew Morton wrote: > On Wed, 24 Oct 2007 08:24:55 -0400 > Matthew Wilcox <[EMAIL PROTECTED]> wrote: > > > Abstracting away direct uses of TASK_ flags allows us to change the > > definitions of the task flags more easily. > > ---

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-10-26 Thread Andrew Morton
On Wed, 24 Oct 2007 08:24:55 -0400 Matthew Wilcox <[EMAIL PROTECTED]> wrote: > Abstracting away direct uses of TASK_ flags allows us to change the > definitions of the task flags more easily. > > Also restructure do_wait() a little > > ... > > diff --git a/arch/ia64/kernel/perfmon.c

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-10-26 Thread Andrew Morton
On Wed, 24 Oct 2007 08:24:55 -0400 Matthew Wilcox [EMAIL PROTECTED] wrote: Abstracting away direct uses of TASK_ flags allows us to change the definitions of the task flags more easily. Also restructure do_wait() a little ... diff --git a/arch/ia64/kernel/perfmon.c

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-10-26 Thread Alexey Dobriyan
On Fri, Oct 26, 2007 at 11:45:15AM -0700, Andrew Morton wrote: On Wed, 24 Oct 2007 08:24:55 -0400 Matthew Wilcox [EMAIL PROTECTED] wrote: Abstracting away direct uses of TASK_ flags allows us to change the definitions of the task flags more easily. --- a/arch/ia64/kernel/perfmon.c +++

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-10-26 Thread Matthew Wilcox
On Sat, Oct 27, 2007 at 12:39:41AM +0400, Alexey Dobriyan wrote: - if ((task-state != TASK_STOPPED) (task-state != TASK_TRACED)) { + if (!is_task_stopped_or_traced(task)) { ^^ I think this is horrible. Are you going to add

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-10-24 Thread Nick Piggin
On Friday 19 October 2007 08:25, Matthew Wilcox wrote: > Abstracting away direct uses of TASK_ flags allows us to change the > definitions of the task flags more easily. > > Also restructure do_wait() a little > > Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]> > --- >

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-10-24 Thread Andrew Morton
On Wed, 24 Oct 2007 08:24:55 -0400 Matthew Wilcox <[EMAIL PROTECTED]> wrote: > Abstracting away direct uses of TASK_ flags allows us to change the > definitions of the task flags more easily. > > Also restructure do_wait() a little umm, spose so. There's an excellent chance that a millionth of

[PATCH 2/5] Use macros instead of TASK_ flags

2007-10-24 Thread Matthew Wilcox
Abstracting away direct uses of TASK_ flags allows us to change the definitions of the task flags more easily. Also restructure do_wait() a little Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]> --- arch/ia64/kernel/perfmon.c |4 +- fs/proc/array.c|7 +--- fs/proc/base.c

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-10-24 Thread Andrew Morton
On Wed, 24 Oct 2007 08:24:55 -0400 Matthew Wilcox [EMAIL PROTECTED] wrote: Abstracting away direct uses of TASK_ flags allows us to change the definitions of the task flags more easily. Also restructure do_wait() a little umm, spose so. There's an excellent chance that a millionth of our

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-10-24 Thread Nick Piggin
On Friday 19 October 2007 08:25, Matthew Wilcox wrote: Abstracting away direct uses of TASK_ flags allows us to change the definitions of the task flags more easily. Also restructure do_wait() a little Signed-off-by: Matthew Wilcox [EMAIL PROTECTED] --- arch/ia64/kernel/perfmon.c |4

[PATCH 2/5] Use macros instead of TASK_ flags

2007-10-24 Thread Matthew Wilcox
Abstracting away direct uses of TASK_ flags allows us to change the definitions of the task flags more easily. Also restructure do_wait() a little Signed-off-by: Matthew Wilcox [EMAIL PROTECTED] --- arch/ia64/kernel/perfmon.c |4 +- fs/proc/array.c|7 +--- fs/proc/base.c

[PATCH 2/5] Use macros instead of TASK_ flags

2007-10-18 Thread Matthew Wilcox
Abstracting away direct uses of TASK_ flags allows us to change the definitions of the task flags more easily. Also restructure do_wait() a little Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]> --- arch/ia64/kernel/perfmon.c |4 +- fs/proc/array.c|9 +--- fs/proc/base.c

[PATCH 2/5] Use macros instead of TASK_ flags

2007-10-18 Thread Matthew Wilcox
Abstracting away direct uses of TASK_ flags allows us to change the definitions of the task flags more easily. Also restructure do_wait() a little Signed-off-by: Matthew Wilcox [EMAIL PROTECTED] --- arch/ia64/kernel/perfmon.c |4 +- fs/proc/array.c|9 +--- fs/proc/base.c

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-09-03 Thread Matthew Wilcox
On Sat, Sep 01, 2007 at 10:46:51PM -0400, Matthew Wilcox wrote: > Abstracting away direct uses of TASK_ flags allows us to change the > definitions of the task flags more easily. > > Also restructure do_wait() a little > > Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]> > --- >

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-09-03 Thread Matthew Wilcox
On Sat, Sep 01, 2007 at 10:46:51PM -0400, Matthew Wilcox wrote: Abstracting away direct uses of TASK_ flags allows us to change the definitions of the task flags more easily. Also restructure do_wait() a little Signed-off-by: Matthew Wilcox [EMAIL PROTECTED] ---

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-09-01 Thread Matthew Wilcox
On Sat, Sep 01, 2007 at 08:35:06PM -0700, Daniel Walker wrote: > Does it take task->state or task ? task. Clearly I didn't test on ia64. (There was an iteration where it took task->state, and I guess I missed one). Thanks for pointing out this oops, I'll fix it for round three. -- Intel are

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-09-01 Thread Daniel Walker
On Sat, 2007-09-01 at 22:46 -0400, Matthew Wilcox wrote: > */ > if (task == current) return 0; > > - if ((task->state != TASK_STOPPED) && (task->state != > TASK_TRACED)) { > + if (!is_task_stopped_or_traced(task->state)) { > DPRINT(("cannot attach to

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-09-01 Thread Matthew Wilcox
On Sat, Sep 01, 2007 at 10:46:51PM -0400, Matthew Wilcox wrote: > Abstracting away direct uses of TASK_ flags allows us to change the > definitions of the task flags more easily. > --- a/kernel/exit.c > +++ b/kernel/exit.c > @@ -259,7 +259,7 @@ static int has_stopped_jobs(struct pid *pgrp) >

[PATCH 2/5] Use macros instead of TASK_ flags

2007-09-01 Thread Matthew Wilcox
Abstracting away direct uses of TASK_ flags allows us to change the definitions of the task flags more easily. Also restructure do_wait() a little Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]> --- arch/ia64/kernel/perfmon.c |4 +- fs/proc/array.c|9 +--- fs/proc/base.c

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-09-01 Thread Matthew Wilcox
On Sat, Sep 01, 2007 at 10:46:51PM -0400, Matthew Wilcox wrote: Abstracting away direct uses of TASK_ flags allows us to change the definitions of the task flags more easily. --- a/kernel/exit.c +++ b/kernel/exit.c @@ -259,7 +259,7 @@ static int has_stopped_jobs(struct pid *pgrp)

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-09-01 Thread Daniel Walker
On Sat, 2007-09-01 at 22:46 -0400, Matthew Wilcox wrote: */ if (task == current) return 0; - if ((task-state != TASK_STOPPED) (task-state != TASK_TRACED)) { + if (!is_task_stopped_or_traced(task-state)) { DPRINT((cannot attach to non-stopped

Re: [PATCH 2/5] Use macros instead of TASK_ flags

2007-09-01 Thread Matthew Wilcox
On Sat, Sep 01, 2007 at 08:35:06PM -0700, Daniel Walker wrote: Does it take task-state or task ? task. Clearly I didn't test on ia64. (There was an iteration where it took task-state, and I guess I missed one). Thanks for pointing out this oops, I'll fix it for round three. -- Intel are