Messages in this thread | | | Date | Wed, 26 Nov 2008 13:02:15 +0100 | From | Andi Kleen <> | Subject | Re: [patch 20/24] perfmon: system calls interface |
| |
> +static int pfm_task_incompatible(struct pfm_context *ctx, > + struct task_struct *task) > +{ > + /* > + * cannot attach to a kernel thread > + */ > + if (!task->mm) { > + PFM_DBG("cannot attach to kernel thread [%d]", task->pid); > + return -EPERM; > + }
Check for init_mm too?
> + > + /* > + * cannot attach to a zombie task > + */ > + if (task->exit_state == EXIT_ZOMBIE || task->exit_state == EXIT_DEAD) { > + PFM_DBG("cannot attach to zombie/dead task [%d]", task->pid); > + return -EBUSY; > + }
This happens unlocked doesn't it? Couldn't the state change in parallel?
-Andi -- ak@linux.intel.com
| |