Re: [PATCH 10/10] Bsdacct: account dying tasks in all relevant namespaces

From: Pavel Emelyanov
Date: Fri May 16 2008 - 06:14:00 EST


Andrew Morton wrote:
> On Thu, 15 May 2008 15:11:55 +0400 Pavel Emelyanov <xemul@xxxxxxxxxx> wrote:
>
>> +/**
>> + * acct_process - now just a wrapper around do_acct_process
>
> comment seems wrong.

Oops. I've fixed it once and forgot to re-check after the set.
Will do shortly.

>> + * handles process accounting for an exiting task
>> + */
>> +void acct_process(void)
>> +{
>> + struct pid_namespace *ns;
>> +
>> + for (ns = task_active_pid_ns(current); ns != NULL; ns = ns->parent)
>> + acct_process_in_ns(ns);
>> +}
>
> Is it really safe to walk this list locklessly?

Well, yes - I wrote it in the comment to the 10th patch:

"ns->parent access if safe lockless, since current it still
alive and holds its namespace, which in turn holds its parent."

Should I also add this as a comment here?

Thanks,
Pavel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/