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 task_is_loadavg() to something more sensible - i didnt 
> know what it meant when i first saw it in -mm's sched.c. 
> task_is_uninterruptible() would be the logical choice ...

It's not obvious to me that "can't be interrupted by a signal" is the
same thing as "contributes to loadavg".  Indeed, I think we would all
like to see a day where there's no such thing as an uninterruptible sleep,
but we'll still want at least some of those tasks contributing to loadavg.

You're right that task_is_loadavg() doesn't make much sense.
task_contributes_to_load() is a better name, but only marginally.

I've considered task_performing_io(), and name the corresponding bit
__TASK_PERFORMING_IO (or even just __TASK_DOING_IO or __TASK_IO), but
it's not just doing IO that makes a task contribute to loadavg.

I have no good suggestions here ;-(

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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 task_is_loadavg() to something more sensible - i didnt 
 know what it meant when i first saw it in -mm's sched.c. 
 task_is_uninterruptible() would be the logical choice ...

It's not obvious to me that can't be interrupted by a signal is the
same thing as contributes to loadavg.  Indeed, I think we would all
like to see a day where there's no such thing as an uninterruptible sleep,
but we'll still want at least some of those tasks contributing to loadavg.

You're right that task_is_loadavg() doesn't make much sense.
task_contributes_to_load() is a better name, but only marginally.

I've considered task_performing_io(), and name the corresponding bit
__TASK_PERFORMING_IO (or even just __TASK_DOING_IO or __TASK_IO), but
it's not just doing IO that makes a task contribute to loadavg.

I have no good suggestions here ;-(

-- 
Intel are signing my paycheques ... these opinions are still mine
Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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 & TASK_UNINTERRUPTIBLE) 
> != 0)

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))

2) please change task_is_loadavg() to something more sensible - i didnt 
know what it meant when i first saw it in -mm's sched.c. 
task_is_uninterruptible() would be the logical choice ...

Ingo

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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  TASK_UNINTERRUPTIBLE) 
 != 0)

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))

2) please change task_is_loadavg() to something more sensible - i didnt 
know what it meant when i first saw it in -mm's sched.c. 
task_is_uninterruptible() would be the logical choice ...

Ingo

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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 full blown static inline
> function for every combination of state tests?

No, because we don't need them.  Just stopped, traced, stopped_or_traced.

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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
> > +++ b/arch/ia64/kernel/perfmon.c
> > @@ -2631,7 +2631,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct 
> > task_struct *task)
> >  */
> > if (task == current) return 0;
> >  
> > -   if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) {
> > +   if (!is_task_stopped_or_traced(task)) {
> > DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", 
> > task_pid_nr(task), task->state));
> > return -EBUSY;
> > }
> > @@ -4792,7 +4792,7 @@ recheck:
> >  * the task must be stopped.
> >  */
> > if (PFM_CMD_STOPPED(cmd)) {
> > -   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 full blown static inline
function for every combination of state tests?

> I have dropped this hunk because the file which it is patching is removed
> by the (newly-added-to-mm) git-perfmon.patch.  I can't immediately find any
> corresponding code which was readded in a different place by git-perfmon so
> it looks like this code was simply zapped.
> 
> Of course, if git-perfmon doesn't merge in 2.6.25 then I'll end up merging
> your patch but accidentally leaving 2.6.25's arch/ia64/kernel/perfmon.c
> unpatched.  It looks like that'll be non-fatal.
> 
> This isn't going to go very well and I might end up having to drop this
> whole patch series and ask for a refactored one.  We'll see.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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 b/arch/ia64/kernel/perfmon.c
> index 59169bf..c2ca724 100644
> --- a/arch/ia64/kernel/perfmon.c
> +++ b/arch/ia64/kernel/perfmon.c
> @@ -2631,7 +2631,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct 
> task_struct *task)
>*/
>   if (task == current) return 0;
>  
> - if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) {
> + if (!is_task_stopped_or_traced(task)) {
>   DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", 
> task_pid_nr(task), task->state));
>   return -EBUSY;
>   }
> @@ -4792,7 +4792,7 @@ recheck:
>* the task must be stopped.
>*/
>   if (PFM_CMD_STOPPED(cmd)) {
> - if ((task->state != TASK_STOPPED) && (task->state != 
> TASK_TRACED)) {
> + if (!is_task_stopped_or_traced(task)) {
>   DPRINT(("[%d] task not in stopped state\n", 
> task_pid_nr(task)));
>   return -EBUSY;
>   }

I have dropped this hunk because the file which it is patching is removed
by the (newly-added-to-mm) git-perfmon.patch.  I can't immediately find any
corresponding code which was readded in a different place by git-perfmon so
it looks like this code was simply zapped.

Of course, if git-perfmon doesn't merge in 2.6.25 then I'll end up merging
your patch but accidentally leaving 2.6.25's arch/ia64/kernel/perfmon.c
unpatched.  It looks like that'll be non-fatal.

This isn't going to go very well and I might end up having to drop this
whole patch series and ask for a refactored one.  We'll see.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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 b/arch/ia64/kernel/perfmon.c
 index 59169bf..c2ca724 100644
 --- a/arch/ia64/kernel/perfmon.c
 +++ b/arch/ia64/kernel/perfmon.c
 @@ -2631,7 +2631,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct 
 task_struct *task)
*/
   if (task == current) return 0;
  
 - if ((task-state != TASK_STOPPED)  (task-state != TASK_TRACED)) {
 + if (!is_task_stopped_or_traced(task)) {
   DPRINT((cannot attach to non-stopped task [%d] state=%ld\n, 
 task_pid_nr(task), task-state));
   return -EBUSY;
   }
 @@ -4792,7 +4792,7 @@ recheck:
* the task must be stopped.
*/
   if (PFM_CMD_STOPPED(cmd)) {
 - if ((task-state != TASK_STOPPED)  (task-state != 
 TASK_TRACED)) {
 + if (!is_task_stopped_or_traced(task)) {
   DPRINT(([%d] task not in stopped state\n, 
 task_pid_nr(task)));
   return -EBUSY;
   }

I have dropped this hunk because the file which it is patching is removed
by the (newly-added-to-mm) git-perfmon.patch.  I can't immediately find any
corresponding code which was readded in a different place by git-perfmon so
it looks like this code was simply zapped.

Of course, if git-perfmon doesn't merge in 2.6.25 then I'll end up merging
your patch but accidentally leaving 2.6.25's arch/ia64/kernel/perfmon.c
unpatched.  It looks like that'll be non-fatal.

This isn't going to go very well and I might end up having to drop this
whole patch series and ask for a refactored one.  We'll see.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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
  +++ b/arch/ia64/kernel/perfmon.c
  @@ -2631,7 +2631,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct 
  task_struct *task)
   */
  if (task == current) return 0;
   
  -   if ((task-state != TASK_STOPPED)  (task-state != TASK_TRACED)) {
  +   if (!is_task_stopped_or_traced(task)) {
  DPRINT((cannot attach to non-stopped task [%d] state=%ld\n, 
  task_pid_nr(task), task-state));
  return -EBUSY;
  }
  @@ -4792,7 +4792,7 @@ recheck:
   * the task must be stopped.
   */
  if (PFM_CMD_STOPPED(cmd)) {
  -   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 full blown static inline
function for every combination of state tests?

 I have dropped this hunk because the file which it is patching is removed
 by the (newly-added-to-mm) git-perfmon.patch.  I can't immediately find any
 corresponding code which was readded in a different place by git-perfmon so
 it looks like this code was simply zapped.
 
 Of course, if git-perfmon doesn't merge in 2.6.25 then I'll end up merging
 your patch but accidentally leaving 2.6.25's arch/ia64/kernel/perfmon.c
 unpatched.  It looks like that'll be non-fatal.
 
 This isn't going to go very well and I might end up having to drop this
 whole patch series and ask for a refactored one.  We'll see.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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 full blown static inline
 function for every combination of state tests?

No, because we don't need them.  Just stopped, traced, stopped_or_traced.

-- 
Intel are signing my paycheques ... these opinions are still mine
Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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 +-
>  fs/proc/array.c|9 +---
>  fs/proc/base.c |2 +-
>  include/linux/sched.h  |   15 +++
>  include/linux/wait.h   |   11 +++--
>  kernel/exit.c  |   90
> +++ kernel/power/process.c |   
> 7 +--
>  kernel/ptrace.c|8 ++--
>  kernel/sched.c |   15 +++
>  kernel/signal.c|6 +-
>  kernel/wait.c  |2 +-
>  11 files changed, 83 insertions(+), 86 deletions(-)
>
> diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
> index f55fa07..6b0a6cf 100644
> --- a/arch/ia64/kernel/perfmon.c
> +++ b/arch/ia64/kernel/perfmon.c
> @@ -2630,7 +2630,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct
> task_struct *task) */
>   if (task == current) return 0;
>
> - if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) {
> + if (!is_task_stopped_or_traced(task)) {
>   DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", 
> task->pid,
> task->state)); return -EBUSY;
>   }
> @@ -4790,7 +4790,7 @@ recheck:
>* the task must be stopped.
>*/
>   if (PFM_CMD_STOPPED(cmd)) {
> - if ((task->state != TASK_STOPPED) && (task->state != 
> TASK_TRACED)) {
> + if (!is_task_stopped_or_traced(task)) {
>   DPRINT(("[%d] task not in stopped state\n", task->pid));
>   return -EBUSY;
>   }
> diff --git a/fs/proc/array.c b/fs/proc/array.c
> index 27b59f5..8939bf0 100644
> --- a/fs/proc/array.c
> +++ b/fs/proc/array.c
> @@ -140,13 +140,8 @@ static const char *task_state_array[] = {
>
>  static inline const char *get_task_state(struct task_struct *tsk)
>  {
> - unsigned int state = (tsk->state & (TASK_RUNNING |
> - TASK_INTERRUPTIBLE |
> - TASK_UNINTERRUPTIBLE |
> - TASK_STOPPED |
> - TASK_TRACED)) |
> - (tsk->exit_state & (EXIT_ZOMBIE |
> - EXIT_DEAD));
> + unsigned int state = (tsk->state & TASK_REPORT) |
> + (tsk->exit_state & (EXIT_ZOMBIE | EXIT_DEAD));
>   const char **p = _state_array[0];
>
>   while (state) {
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index 4fe74d1..e7e1815 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -196,7 +196,7 @@ static int proc_root_link(struct inode *inode, struct
> dentry **dentry, struct vf (task == current || \
>   (task->parent == current && \
>   (task->ptrace & PT_PTRACED) && \
> -  (task->state == TASK_STOPPED || task->state == TASK_TRACED) && \
> +  (is_task_stopped_or_traced(task)) && \
>security_ptrace(current,task) == 0))
>
>  static int proc_pid_cmdline(struct task_struct *task, char * buffer)
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index c204ab0..5ef5253 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -177,6 +177,21 @@ print_cfs_rq(struct seq_file *m, int cpu, struct
> cfs_rq *cfs_rq) /* in tsk->state again */
>  #define TASK_DEAD64
>
> +/* Convenience macros for the sake of wake_up */
> +#define TASK_NORMAL  (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
> +#define TASK_ALL (TASK_NORMAL | TASK_STOPPED | TASK_TRACED)
> +
> +/* get_task_state() */
> +#define TASK_REPORT  (TASK_RUNNING | TASK_INTERRUPTIBLE | \
> +  TASK_UNINTERRUPTIBLE | TASK_STOPPED | \
> +  TASK_TRACED)

I think it would be nicer if you made it explicit in the name that
these are not individual flags. Maybe it doesn't matter though...

Also, TASK_NORMAL / TASK_ALL aren't very good names. TASK_SLEEP_NORMAL
TASK_SLEEP_ALL might be a bit more helpful?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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 monkeys will come
along and wreck this diff during the next two months.  In which case
I might end up dropping bits of it, we'll see.

It would be much better if this patch was a series of patches: one to add
the new infrastructure and one-per-subsystem to introduce users of the
infrastructure.  That way I wouldn't have to go mucking around in the
internals of the patch and remembering to tell you when I tossed bits of it
out, and which bits those were.

This shouldn't come as news to an old-timer :(
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[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 |2 +-
 include/linux/sched.h  |   15 +++
 include/linux/wait.h   |   11 +++--
 kernel/exit.c  |   90 +++
 kernel/power/process.c |6 +-
 kernel/ptrace.c|8 ++--
 kernel/sched.c |   15 +++
 kernel/signal.c|6 +-
 kernel/wait.c  |2 +-
 11 files changed, 82 insertions(+), 84 deletions(-)

diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 59169bf..c2ca724 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2631,7 +2631,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct 
task_struct *task)
 */
if (task == current) return 0;
 
-   if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) {
+   if (!is_task_stopped_or_traced(task)) {
DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", 
task_pid_nr(task), task->state));
return -EBUSY;
}
@@ -4792,7 +4792,7 @@ recheck:
 * the task must be stopped.
 */
if (PFM_CMD_STOPPED(cmd)) {
-   if ((task->state != TASK_STOPPED) && (task->state != 
TASK_TRACED)) {
+   if (!is_task_stopped_or_traced(task)) {
DPRINT(("[%d] task not in stopped state\n", 
task_pid_nr(task)));
return -EBUSY;
}
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 63c95af..0bf1fa0 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -141,12 +141,7 @@ static const char *task_state_array[] = {
 
 static inline const char *get_task_state(struct task_struct *tsk)
 {
-   unsigned int state = (tsk->state & (TASK_RUNNING |
-   TASK_INTERRUPTIBLE |
-   TASK_UNINTERRUPTIBLE |
-   TASK_STOPPED |
-   TASK_TRACED)) |
-  tsk->exit_state;
+   unsigned int state = (tsk->state & TASK_REPORT) | tsk->exit_state;
const char **p = _state_array[0];
 
while (state) {
diff --git a/fs/proc/base.c b/fs/proc/base.c
index aeaf0d0..049a80c 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -199,7 +199,7 @@ static int proc_root_link(struct inode *inode, struct 
dentry **dentry, struct vf
(task == current || \
(task->parent == current && \
(task->ptrace & PT_PTRACED) && \
-(task->state == TASK_STOPPED || task->state == TASK_TRACED) && \
+(is_task_stopped_or_traced(task)) && \
 security_ptrace(current,task) == 0))
 
 static int proc_pid_cmdline(struct task_struct *task, char * buffer)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 13df99f..fc28637 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -178,6 +178,21 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq 
*cfs_rq)
 /* in tsk->state again */
 #define TASK_DEAD  64
 
+/* Convenience macros for the sake of wake_up */
+#define TASK_NORMAL(TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
+#define TASK_ALL   (TASK_NORMAL | TASK_STOPPED | TASK_TRACED)
+
+/* get_task_state() */
+#define TASK_REPORT(TASK_RUNNING | TASK_INTERRUPTIBLE | \
+TASK_UNINTERRUPTIBLE | TASK_STOPPED | \
+TASK_TRACED)
+
+#define is_task_traced(task)   ((task->state & TASK_TRACED) != 0)
+#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 & TASK_UNINTERRUPTIBLE) != 0)
+
 #define __set_task_state(tsk, state_value) \
do { (tsk)->state = (state_value); } while (0)
 #define set_task_state(tsk, state_value)   \
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 0e68628..0a410a4 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -152,14 +152,15 @@ int FASTCALL(out_of_line_wait_on_bit(void *, int, int 
(*)(void *), unsigned));
 int FASTCALL(out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), 
unsigned));
 wait_queue_head_t *FASTCALL(bit_waitqueue(void *, int));
 
-#define wake_up(x) __wake_up(x, TASK_UNINTERRUPTIBLE | 
TASK_INTERRUPTIBLE, 1, NULL)
-#define wake_up_nr(x, nr)  __wake_up(x, TASK_UNINTERRUPTIBLE | 
TASK_INTERRUPTIBLE, nr, NULL)
-#define wake_up_all(x) __wake_up(x, TASK_UNINTERRUPTIBLE | 
TASK_INTERRUPTIBLE, 0, NULL)

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 monkeys will come
along and wreck this diff during the next two months.  In which case
I might end up dropping bits of it, we'll see.

It would be much better if this patch was a series of patches: one to add
the new infrastructure and one-per-subsystem to introduce users of the
infrastructure.  That way I wouldn't have to go mucking around in the
internals of the patch and remembering to tell you when I tossed bits of it
out, and which bits those were.

This shouldn't come as news to an old-timer :(
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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 +-
  fs/proc/array.c|9 +---
  fs/proc/base.c |2 +-
  include/linux/sched.h  |   15 +++
  include/linux/wait.h   |   11 +++--
  kernel/exit.c  |   90
 +++ kernel/power/process.c |   
 7 +--
  kernel/ptrace.c|8 ++--
  kernel/sched.c |   15 +++
  kernel/signal.c|6 +-
  kernel/wait.c  |2 +-
  11 files changed, 83 insertions(+), 86 deletions(-)

 diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
 index f55fa07..6b0a6cf 100644
 --- a/arch/ia64/kernel/perfmon.c
 +++ b/arch/ia64/kernel/perfmon.c
 @@ -2630,7 +2630,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct
 task_struct *task) */
   if (task == current) return 0;

 - if ((task-state != TASK_STOPPED)  (task-state != TASK_TRACED)) {
 + if (!is_task_stopped_or_traced(task)) {
   DPRINT((cannot attach to non-stopped task [%d] state=%ld\n, 
 task-pid,
 task-state)); return -EBUSY;
   }
 @@ -4790,7 +4790,7 @@ recheck:
* the task must be stopped.
*/
   if (PFM_CMD_STOPPED(cmd)) {
 - if ((task-state != TASK_STOPPED)  (task-state != 
 TASK_TRACED)) {
 + if (!is_task_stopped_or_traced(task)) {
   DPRINT(([%d] task not in stopped state\n, task-pid));
   return -EBUSY;
   }
 diff --git a/fs/proc/array.c b/fs/proc/array.c
 index 27b59f5..8939bf0 100644
 --- a/fs/proc/array.c
 +++ b/fs/proc/array.c
 @@ -140,13 +140,8 @@ static const char *task_state_array[] = {

  static inline const char *get_task_state(struct task_struct *tsk)
  {
 - unsigned int state = (tsk-state  (TASK_RUNNING |
 - TASK_INTERRUPTIBLE |
 - TASK_UNINTERRUPTIBLE |
 - TASK_STOPPED |
 - TASK_TRACED)) |
 - (tsk-exit_state  (EXIT_ZOMBIE |
 - EXIT_DEAD));
 + unsigned int state = (tsk-state  TASK_REPORT) |
 + (tsk-exit_state  (EXIT_ZOMBIE | EXIT_DEAD));
   const char **p = task_state_array[0];

   while (state) {
 diff --git a/fs/proc/base.c b/fs/proc/base.c
 index 4fe74d1..e7e1815 100644
 --- a/fs/proc/base.c
 +++ b/fs/proc/base.c
 @@ -196,7 +196,7 @@ static int proc_root_link(struct inode *inode, struct
 dentry **dentry, struct vf (task == current || \
   (task-parent == current  \
   (task-ptrace  PT_PTRACED)  \
 -  (task-state == TASK_STOPPED || task-state == TASK_TRACED)  \
 +  (is_task_stopped_or_traced(task))  \
security_ptrace(current,task) == 0))

  static int proc_pid_cmdline(struct task_struct *task, char * buffer)
 diff --git a/include/linux/sched.h b/include/linux/sched.h
 index c204ab0..5ef5253 100644
 --- a/include/linux/sched.h
 +++ b/include/linux/sched.h
 @@ -177,6 +177,21 @@ print_cfs_rq(struct seq_file *m, int cpu, struct
 cfs_rq *cfs_rq) /* in tsk-state again */
  #define TASK_DEAD64

 +/* Convenience macros for the sake of wake_up */
 +#define TASK_NORMAL  (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
 +#define TASK_ALL (TASK_NORMAL | TASK_STOPPED | TASK_TRACED)
 +
 +/* get_task_state() */
 +#define TASK_REPORT  (TASK_RUNNING | TASK_INTERRUPTIBLE | \
 +  TASK_UNINTERRUPTIBLE | TASK_STOPPED | \
 +  TASK_TRACED)

I think it would be nicer if you made it explicit in the name that
these are not individual flags. Maybe it doesn't matter though...

Also, TASK_NORMAL / TASK_ALL aren't very good names. TASK_SLEEP_NORMAL
TASK_SLEEP_ALL might be a bit more helpful?
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[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 |2 +-
 include/linux/sched.h  |   15 +++
 include/linux/wait.h   |   11 +++--
 kernel/exit.c  |   90 +++
 kernel/power/process.c |6 +-
 kernel/ptrace.c|8 ++--
 kernel/sched.c |   15 +++
 kernel/signal.c|6 +-
 kernel/wait.c  |2 +-
 11 files changed, 82 insertions(+), 84 deletions(-)

diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 59169bf..c2ca724 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2631,7 +2631,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct 
task_struct *task)
 */
if (task == current) return 0;
 
-   if ((task-state != TASK_STOPPED)  (task-state != TASK_TRACED)) {
+   if (!is_task_stopped_or_traced(task)) {
DPRINT((cannot attach to non-stopped task [%d] state=%ld\n, 
task_pid_nr(task), task-state));
return -EBUSY;
}
@@ -4792,7 +4792,7 @@ recheck:
 * the task must be stopped.
 */
if (PFM_CMD_STOPPED(cmd)) {
-   if ((task-state != TASK_STOPPED)  (task-state != 
TASK_TRACED)) {
+   if (!is_task_stopped_or_traced(task)) {
DPRINT(([%d] task not in stopped state\n, 
task_pid_nr(task)));
return -EBUSY;
}
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 63c95af..0bf1fa0 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -141,12 +141,7 @@ static const char *task_state_array[] = {
 
 static inline const char *get_task_state(struct task_struct *tsk)
 {
-   unsigned int state = (tsk-state  (TASK_RUNNING |
-   TASK_INTERRUPTIBLE |
-   TASK_UNINTERRUPTIBLE |
-   TASK_STOPPED |
-   TASK_TRACED)) |
-  tsk-exit_state;
+   unsigned int state = (tsk-state  TASK_REPORT) | tsk-exit_state;
const char **p = task_state_array[0];
 
while (state) {
diff --git a/fs/proc/base.c b/fs/proc/base.c
index aeaf0d0..049a80c 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -199,7 +199,7 @@ static int proc_root_link(struct inode *inode, struct 
dentry **dentry, struct vf
(task == current || \
(task-parent == current  \
(task-ptrace  PT_PTRACED)  \
-(task-state == TASK_STOPPED || task-state == TASK_TRACED)  \
+(is_task_stopped_or_traced(task))  \
 security_ptrace(current,task) == 0))
 
 static int proc_pid_cmdline(struct task_struct *task, char * buffer)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 13df99f..fc28637 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -178,6 +178,21 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq 
*cfs_rq)
 /* in tsk-state again */
 #define TASK_DEAD  64
 
+/* Convenience macros for the sake of wake_up */
+#define TASK_NORMAL(TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
+#define TASK_ALL   (TASK_NORMAL | TASK_STOPPED | TASK_TRACED)
+
+/* get_task_state() */
+#define TASK_REPORT(TASK_RUNNING | TASK_INTERRUPTIBLE | \
+TASK_UNINTERRUPTIBLE | TASK_STOPPED | \
+TASK_TRACED)
+
+#define is_task_traced(task)   ((task-state  TASK_TRACED) != 0)
+#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  TASK_UNINTERRUPTIBLE) != 0)
+
 #define __set_task_state(tsk, state_value) \
do { (tsk)-state = (state_value); } while (0)
 #define set_task_state(tsk, state_value)   \
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 0e68628..0a410a4 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -152,14 +152,15 @@ int FASTCALL(out_of_line_wait_on_bit(void *, int, int 
(*)(void *), unsigned));
 int FASTCALL(out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), 
unsigned));
 wait_queue_head_t *FASTCALL(bit_waitqueue(void *, int));
 
-#define wake_up(x) __wake_up(x, TASK_UNINTERRUPTIBLE | 
TASK_INTERRUPTIBLE, 1, NULL)
-#define wake_up_nr(x, nr)  __wake_up(x, TASK_UNINTERRUPTIBLE | 
TASK_INTERRUPTIBLE, nr, NULL)
-#define wake_up_all(x) __wake_up(x, TASK_UNINTERRUPTIBLE | 
TASK_INTERRUPTIBLE, 0, NULL)
+#define wake_up(x) 

[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 |2 +-
 include/linux/sched.h  |   15 +++
 include/linux/wait.h   |   11 +++--
 kernel/exit.c  |   90 +++
 kernel/power/process.c |7 +--
 kernel/ptrace.c|8 ++--
 kernel/sched.c |   15 +++
 kernel/signal.c|6 +-
 kernel/wait.c  |2 +-
 11 files changed, 83 insertions(+), 86 deletions(-)

diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index f55fa07..6b0a6cf 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2630,7 +2630,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct 
task_struct *task)
 */
if (task == current) return 0;
 
-   if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) {
+   if (!is_task_stopped_or_traced(task)) {
DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", 
task->pid, task->state));
return -EBUSY;
}
@@ -4790,7 +4790,7 @@ recheck:
 * the task must be stopped.
 */
if (PFM_CMD_STOPPED(cmd)) {
-   if ((task->state != TASK_STOPPED) && (task->state != 
TASK_TRACED)) {
+   if (!is_task_stopped_or_traced(task)) {
DPRINT(("[%d] task not in stopped state\n", task->pid));
return -EBUSY;
}
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 27b59f5..8939bf0 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -140,13 +140,8 @@ static const char *task_state_array[] = {
 
 static inline const char *get_task_state(struct task_struct *tsk)
 {
-   unsigned int state = (tsk->state & (TASK_RUNNING |
-   TASK_INTERRUPTIBLE |
-   TASK_UNINTERRUPTIBLE |
-   TASK_STOPPED |
-   TASK_TRACED)) |
-   (tsk->exit_state & (EXIT_ZOMBIE |
-   EXIT_DEAD));
+   unsigned int state = (tsk->state & TASK_REPORT) |
+   (tsk->exit_state & (EXIT_ZOMBIE | EXIT_DEAD));
const char **p = _state_array[0];
 
while (state) {
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 4fe74d1..e7e1815 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -196,7 +196,7 @@ static int proc_root_link(struct inode *inode, struct 
dentry **dentry, struct vf
(task == current || \
(task->parent == current && \
(task->ptrace & PT_PTRACED) && \
-(task->state == TASK_STOPPED || task->state == TASK_TRACED) && \
+(is_task_stopped_or_traced(task)) && \
 security_ptrace(current,task) == 0))
 
 static int proc_pid_cmdline(struct task_struct *task, char * buffer)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index c204ab0..5ef5253 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -177,6 +177,21 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq 
*cfs_rq)
 /* in tsk->state again */
 #define TASK_DEAD  64
 
+/* Convenience macros for the sake of wake_up */
+#define TASK_NORMAL(TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
+#define TASK_ALL   (TASK_NORMAL | TASK_STOPPED | TASK_TRACED)
+
+/* get_task_state() */
+#define TASK_REPORT(TASK_RUNNING | TASK_INTERRUPTIBLE | \
+TASK_UNINTERRUPTIBLE | TASK_STOPPED | \
+TASK_TRACED)
+
+#define is_task_traced(task)   ((task->state & TASK_TRACED) != 0)
+#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 & TASK_UNINTERRUPTIBLE) != 0)
+
 #define __set_task_state(tsk, state_value) \
do { (tsk)->state = (state_value); } while (0)
 #define set_task_state(tsk, state_value)   \
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 0e68628..0a410a4 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -152,14 +152,15 @@ int FASTCALL(out_of_line_wait_on_bit(void *, int, int 
(*)(void *), unsigned));
 int FASTCALL(out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), 
unsigned));
 wait_queue_head_t *FASTCALL(bit_waitqueue(void *, int));
 
-#define wake_up(x) __wake_up(x, TASK_UNINTERRUPTIBLE | 
TASK_INTERRUPTIBLE, 1, NULL)
-#define wake_up_nr(x, nr)  __wake_up(x, TASK_UNINTERRUPTIBLE | 
TASK_INTERRUPTIBLE, nr, NULL)
-#define 

[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 |2 +-
 include/linux/sched.h  |   15 +++
 include/linux/wait.h   |   11 +++--
 kernel/exit.c  |   90 +++
 kernel/power/process.c |7 +--
 kernel/ptrace.c|8 ++--
 kernel/sched.c |   15 +++
 kernel/signal.c|6 +-
 kernel/wait.c  |2 +-
 11 files changed, 83 insertions(+), 86 deletions(-)

diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index f55fa07..6b0a6cf 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2630,7 +2630,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct 
task_struct *task)
 */
if (task == current) return 0;
 
-   if ((task-state != TASK_STOPPED)  (task-state != TASK_TRACED)) {
+   if (!is_task_stopped_or_traced(task)) {
DPRINT((cannot attach to non-stopped task [%d] state=%ld\n, 
task-pid, task-state));
return -EBUSY;
}
@@ -4790,7 +4790,7 @@ recheck:
 * the task must be stopped.
 */
if (PFM_CMD_STOPPED(cmd)) {
-   if ((task-state != TASK_STOPPED)  (task-state != 
TASK_TRACED)) {
+   if (!is_task_stopped_or_traced(task)) {
DPRINT(([%d] task not in stopped state\n, task-pid));
return -EBUSY;
}
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 27b59f5..8939bf0 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -140,13 +140,8 @@ static const char *task_state_array[] = {
 
 static inline const char *get_task_state(struct task_struct *tsk)
 {
-   unsigned int state = (tsk-state  (TASK_RUNNING |
-   TASK_INTERRUPTIBLE |
-   TASK_UNINTERRUPTIBLE |
-   TASK_STOPPED |
-   TASK_TRACED)) |
-   (tsk-exit_state  (EXIT_ZOMBIE |
-   EXIT_DEAD));
+   unsigned int state = (tsk-state  TASK_REPORT) |
+   (tsk-exit_state  (EXIT_ZOMBIE | EXIT_DEAD));
const char **p = task_state_array[0];
 
while (state) {
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 4fe74d1..e7e1815 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -196,7 +196,7 @@ static int proc_root_link(struct inode *inode, struct 
dentry **dentry, struct vf
(task == current || \
(task-parent == current  \
(task-ptrace  PT_PTRACED)  \
-(task-state == TASK_STOPPED || task-state == TASK_TRACED)  \
+(is_task_stopped_or_traced(task))  \
 security_ptrace(current,task) == 0))
 
 static int proc_pid_cmdline(struct task_struct *task, char * buffer)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index c204ab0..5ef5253 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -177,6 +177,21 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq 
*cfs_rq)
 /* in tsk-state again */
 #define TASK_DEAD  64
 
+/* Convenience macros for the sake of wake_up */
+#define TASK_NORMAL(TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
+#define TASK_ALL   (TASK_NORMAL | TASK_STOPPED | TASK_TRACED)
+
+/* get_task_state() */
+#define TASK_REPORT(TASK_RUNNING | TASK_INTERRUPTIBLE | \
+TASK_UNINTERRUPTIBLE | TASK_STOPPED | \
+TASK_TRACED)
+
+#define is_task_traced(task)   ((task-state  TASK_TRACED) != 0)
+#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  TASK_UNINTERRUPTIBLE) != 0)
+
 #define __set_task_state(tsk, state_value) \
do { (tsk)-state = (state_value); } while (0)
 #define set_task_state(tsk, state_value)   \
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 0e68628..0a410a4 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -152,14 +152,15 @@ int FASTCALL(out_of_line_wait_on_bit(void *, int, int 
(*)(void *), unsigned));
 int FASTCALL(out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), 
unsigned));
 wait_queue_head_t *FASTCALL(bit_waitqueue(void *, int));
 
-#define wake_up(x) __wake_up(x, TASK_UNINTERRUPTIBLE | 
TASK_INTERRUPTIBLE, 1, NULL)
-#define wake_up_nr(x, nr)  __wake_up(x, TASK_UNINTERRUPTIBLE | 
TASK_INTERRUPTIBLE, nr, NULL)
-#define wake_up_all(x) __wake_up(x, 

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]>
> ---
>  arch/ia64/kernel/perfmon.c |4 +-
>  fs/proc/array.c|9 +---
>  fs/proc/base.c |2 +-
>  include/linux/sched.h  |   15 +++
>  include/linux/wait.h   |   11 +++--
>  kernel/exit.c  |   90 +++
>  kernel/power/process.c |7 +--
>  kernel/ptrace.c|8 ++--
>  kernel/sched.c |   15 +++
>  kernel/signal.c|6 +-
>  kernel/wait.c  |2 +-
>  11 files changed, 83 insertions(+), 86 deletions(-)

Here's a replacement patch 2/5, including fixes for the problems spotted
by Daniel and myself.  A machine running a kernel including these patches
has been up for more than 24 hours.

commit 10287ac5d615a2ccca6611426572259ebc69dc92
Author: Matthew Wilcox <[EMAIL PROTECTED]>
Date:   Sat Sep 1 09:31:22 2007 -0400

Use macros instead of TASK_ flags

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]>

diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 14b8e5a..3690c46 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2637,7 +2637,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct 
task_struct *task)
 */
if (task == current) return 0;
 
-   if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) {
+   if (!is_task_stopped_or_traced(task)) {
DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", 
task->pid, task->state));
return -EBUSY;
}
@@ -4797,7 +4797,7 @@ recheck:
 * the task must be stopped.
 */
if (PFM_CMD_STOPPED(cmd)) {
-   if ((task->state != TASK_STOPPED) && (task->state != 
TASK_TRACED)) {
+   if (!is_task_stopped_or_traced(task)) {
DPRINT(("[%d] task not in stopped state\n", task->pid));
return -EBUSY;
}
diff --git a/fs/proc/array.c b/fs/proc/array.c
index ee4814d..6a3c876 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -140,13 +140,8 @@ static const char *task_state_array[] = {
 
 static inline const char *get_task_state(struct task_struct *tsk)
 {
-   unsigned int state = (tsk->state & (TASK_RUNNING |
-   TASK_INTERRUPTIBLE |
-   TASK_UNINTERRUPTIBLE |
-   TASK_STOPPED |
-   TASK_TRACED)) |
-   (tsk->exit_state & (EXIT_ZOMBIE |
-   EXIT_DEAD));
+   unsigned int state = (tsk->state & TASK_REPORT) |
+   (tsk->exit_state & (EXIT_ZOMBIE | EXIT_DEAD));
const char **p = _state_array[0];
 
while (state) {
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 19489b0..3155ef1 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -196,7 +196,7 @@ static int proc_root_link(struct inode *inode, struct 
dentry **dentry, struct vf
(task == current || \
(task->parent == current && \
(task->ptrace & PT_PTRACED) && \
-(task->state == TASK_STOPPED || task->state == TASK_TRACED) && \
+(is_task_stopped_or_traced(task)) && \
 security_ptrace(current,task) == 0))
 
 static int proc_pid_environ(struct task_struct *task, char * buffer)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index f4e324e..ea509e9 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -176,6 +176,21 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq 
*cfs_rq)
 #define TASK_NONINTERACTIVE64
 #define TASK_DEAD  128
 
+/* Convenience macros for the sake of wake_up */
+#define TASK_NORMAL(TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
+#define TASK_ALL   (TASK_NORMAL | TASK_STOPPED | TASK_TRACED)
+
+/* get_task_state() */
+#define TASK_REPORT(TASK_RUNNING | TASK_INTERRUPTIBLE | \
+TASK_UNINTERRUPTIBLE | TASK_STOPPED | \
+TASK_TRACED)
+
+#define is_task_traced(task)   ((task->state & TASK_TRACED) != 0)
+#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 & TASK_UNINTERRUPTIBLE) != 0)
+
 #define __set_task_state(tsk, state_value) \
do { (tsk)->state = 

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]
 ---
  arch/ia64/kernel/perfmon.c |4 +-
  fs/proc/array.c|9 +---
  fs/proc/base.c |2 +-
  include/linux/sched.h  |   15 +++
  include/linux/wait.h   |   11 +++--
  kernel/exit.c  |   90 +++
  kernel/power/process.c |7 +--
  kernel/ptrace.c|8 ++--
  kernel/sched.c |   15 +++
  kernel/signal.c|6 +-
  kernel/wait.c  |2 +-
  11 files changed, 83 insertions(+), 86 deletions(-)

Here's a replacement patch 2/5, including fixes for the problems spotted
by Daniel and myself.  A machine running a kernel including these patches
has been up for more than 24 hours.

commit 10287ac5d615a2ccca6611426572259ebc69dc92
Author: Matthew Wilcox [EMAIL PROTECTED]
Date:   Sat Sep 1 09:31:22 2007 -0400

Use macros instead of TASK_ flags

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]

diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 14b8e5a..3690c46 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2637,7 +2637,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct 
task_struct *task)
 */
if (task == current) return 0;
 
-   if ((task-state != TASK_STOPPED)  (task-state != TASK_TRACED)) {
+   if (!is_task_stopped_or_traced(task)) {
DPRINT((cannot attach to non-stopped task [%d] state=%ld\n, 
task-pid, task-state));
return -EBUSY;
}
@@ -4797,7 +4797,7 @@ recheck:
 * the task must be stopped.
 */
if (PFM_CMD_STOPPED(cmd)) {
-   if ((task-state != TASK_STOPPED)  (task-state != 
TASK_TRACED)) {
+   if (!is_task_stopped_or_traced(task)) {
DPRINT(([%d] task not in stopped state\n, task-pid));
return -EBUSY;
}
diff --git a/fs/proc/array.c b/fs/proc/array.c
index ee4814d..6a3c876 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -140,13 +140,8 @@ static const char *task_state_array[] = {
 
 static inline const char *get_task_state(struct task_struct *tsk)
 {
-   unsigned int state = (tsk-state  (TASK_RUNNING |
-   TASK_INTERRUPTIBLE |
-   TASK_UNINTERRUPTIBLE |
-   TASK_STOPPED |
-   TASK_TRACED)) |
-   (tsk-exit_state  (EXIT_ZOMBIE |
-   EXIT_DEAD));
+   unsigned int state = (tsk-state  TASK_REPORT) |
+   (tsk-exit_state  (EXIT_ZOMBIE | EXIT_DEAD));
const char **p = task_state_array[0];
 
while (state) {
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 19489b0..3155ef1 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -196,7 +196,7 @@ static int proc_root_link(struct inode *inode, struct 
dentry **dentry, struct vf
(task == current || \
(task-parent == current  \
(task-ptrace  PT_PTRACED)  \
-(task-state == TASK_STOPPED || task-state == TASK_TRACED)  \
+(is_task_stopped_or_traced(task))  \
 security_ptrace(current,task) == 0))
 
 static int proc_pid_environ(struct task_struct *task, char * buffer)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index f4e324e..ea509e9 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -176,6 +176,21 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq 
*cfs_rq)
 #define TASK_NONINTERACTIVE64
 #define TASK_DEAD  128
 
+/* Convenience macros for the sake of wake_up */
+#define TASK_NORMAL(TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
+#define TASK_ALL   (TASK_NORMAL | TASK_STOPPED | TASK_TRACED)
+
+/* get_task_state() */
+#define TASK_REPORT(TASK_RUNNING | TASK_INTERRUPTIBLE | \
+TASK_UNINTERRUPTIBLE | TASK_STOPPED | \
+TASK_TRACED)
+
+#define is_task_traced(task)   ((task-state  TASK_TRACED) != 0)
+#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  TASK_UNINTERRUPTIBLE) != 0)
+
 #define __set_task_state(tsk, state_value) \
do { (tsk)-state = (state_value); } while (0)
 #define set_task_state(tsk, state_value) 

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 signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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 task [%d] state=
> -   if ((task->state != TASK_STOPPED) && (task->state !=
> TASK_TRACED)) {
> +   if (!is_task_stopped_or_traced(task)) {
> DPRINT(("[%d] task not in stopped state\n",
> task->pid));
> return -EBUSY;
> } 

Does it take task->state or task ?

Daniel

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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)
>   struct task_struct *p;
>  
>   do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
> - if (p->state != TASK_STOPPED)
> + if (is_task_stopped(p))

Funny how I can't spot these things before I send them.

Fixed locally; I'll see if anyone else spots a problem before I send out
a v3.

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[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 |2 +-
 include/linux/sched.h  |   15 +++
 include/linux/wait.h   |   11 +++--
 kernel/exit.c  |   90 +++
 kernel/power/process.c |7 +--
 kernel/ptrace.c|8 ++--
 kernel/sched.c |   15 +++
 kernel/signal.c|6 +-
 kernel/wait.c  |2 +-
 11 files changed, 83 insertions(+), 86 deletions(-)

diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 14b8e5a..75a99ee 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2637,7 +2637,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct 
task_struct *task)
 */
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 task [%d] state=%ld\n", 
task->pid, task->state));
return -EBUSY;
}
@@ -4797,7 +4797,7 @@ recheck:
 * the task must be stopped.
 */
if (PFM_CMD_STOPPED(cmd)) {
-   if ((task->state != TASK_STOPPED) && (task->state != 
TASK_TRACED)) {
+   if (!is_task_stopped_or_traced(task)) {
DPRINT(("[%d] task not in stopped state\n", task->pid));
return -EBUSY;
}
diff --git a/fs/proc/array.c b/fs/proc/array.c
index ee4814d..6a3c876 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -140,13 +140,8 @@ static const char *task_state_array[] = {
 
 static inline const char *get_task_state(struct task_struct *tsk)
 {
-   unsigned int state = (tsk->state & (TASK_RUNNING |
-   TASK_INTERRUPTIBLE |
-   TASK_UNINTERRUPTIBLE |
-   TASK_STOPPED |
-   TASK_TRACED)) |
-   (tsk->exit_state & (EXIT_ZOMBIE |
-   EXIT_DEAD));
+   unsigned int state = (tsk->state & TASK_REPORT) |
+   (tsk->exit_state & (EXIT_ZOMBIE | EXIT_DEAD));
const char **p = _state_array[0];
 
while (state) {
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 19489b0..3155ef1 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -196,7 +196,7 @@ static int proc_root_link(struct inode *inode, struct 
dentry **dentry, struct vf
(task == current || \
(task->parent == current && \
(task->ptrace & PT_PTRACED) && \
-(task->state == TASK_STOPPED || task->state == TASK_TRACED) && \
+(is_task_stopped_or_traced(task)) && \
 security_ptrace(current,task) == 0))
 
 static int proc_pid_environ(struct task_struct *task, char * buffer)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index f4e324e..ea509e9 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -176,6 +176,21 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq 
*cfs_rq)
 #define TASK_NONINTERACTIVE64
 #define TASK_DEAD  128
 
+/* Convenience macros for the sake of wake_up */
+#define TASK_NORMAL(TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
+#define TASK_ALL   (TASK_NORMAL | TASK_STOPPED | TASK_TRACED)
+
+/* get_task_state() */
+#define TASK_REPORT(TASK_RUNNING | TASK_INTERRUPTIBLE | \
+TASK_UNINTERRUPTIBLE | TASK_STOPPED | \
+TASK_TRACED)
+
+#define is_task_traced(task)   ((task->state & TASK_TRACED) != 0)
+#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 & TASK_UNINTERRUPTIBLE) != 0)
+
 #define __set_task_state(tsk, state_value) \
do { (tsk)->state = (state_value); } while (0)
 #define set_task_state(tsk, state_value)   \
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 0e68628..0a410a4 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -152,14 +152,15 @@ int FASTCALL(out_of_line_wait_on_bit(void *, int, int 
(*)(void *), unsigned));
 int FASTCALL(out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), 
unsigned));
 wait_queue_head_t *FASTCALL(bit_waitqueue(void *, int));
 
-#define wake_up(x) __wake_up(x, TASK_UNINTERRUPTIBLE | 
TASK_INTERRUPTIBLE, 1, NULL)
-#define wake_up_nr(x, nr)  __wake_up(x, TASK_UNINTERRUPTIBLE | 
TASK_INTERRUPTIBLE, nr, NULL)

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)
   struct task_struct *p;
  
   do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
 - if (p-state != TASK_STOPPED)
 + if (is_task_stopped(p))

Funny how I can't spot these things before I send them.

Fixed locally; I'll see if anyone else spots a problem before I send out
a v3.

-- 
Intel are signing my paycheques ... these opinions are still mine
Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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 task [%d] state=
 -   if ((task-state != TASK_STOPPED)  (task-state !=
 TASK_TRACED)) {
 +   if (!is_task_stopped_or_traced(task)) {
 DPRINT(([%d] task not in stopped state\n,
 task-pid));
 return -EBUSY;
 } 

Does it take task-state or task ?

Daniel

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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 signing my paycheques ... these opinions are still mine
Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/