[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081126120215.GU6703@one.firstfloor.org>
Date: Wed, 26 Nov 2008 13:02:15 +0100
From: Andi Kleen <andi@...stfloor.org>
To: eranian@...glemail.com
Cc: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
mingo@...e.hu, x86@...nel.org, andi@...stfloor.org,
eranian@...il.com, sfr@...b.auug.org.au
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@...ux.intel.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists