All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bsdacct: stir up comments around acct_process.
@ 2008-05-16 10:54 Pavel Emelyanov
  2008-05-16 15:48 ` Randy Dunlap
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2008-05-16 10:54 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel Mailing List

Fix the one describing what this function is and add one
more - about locking absence around pid namespaces loop.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/kernel/acct.c b/kernel/acct.c
index 0feba97..d7b670c 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -657,7 +657,8 @@ static void acct_process_in_ns(struct pid_namespace *ns)
 }
 
 /**
- * acct_process - now just a wrapper around do_acct_process
+ * acct_process - now just a wrapper around acct_process_in_ns,
+ * which int turn is a wrapper around do_acct_process.
  *
  * handles process accounting for an exiting task
  */
@@ -665,6 +666,11 @@ void acct_process(void)
 {
 	struct pid_namespace *ns;
 
+	/*
+	 * This loop is safe lockless, since current it still
+	 * alive and holds its namespace, which in turn holds
+	 * its parent.
+	 */
 	for (ns = task_active_pid_ns(current); ns != NULL; ns = ns->parent)
 		acct_process_in_ns(ns);
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bsdacct: stir up comments around acct_process.
  2008-05-16 10:54 [PATCH] Bsdacct: stir up comments around acct_process Pavel Emelyanov
@ 2008-05-16 15:48 ` Randy Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: Randy Dunlap @ 2008-05-16 15:48 UTC (permalink / raw)
  To: Pavel Emelyanov; +Cc: Andrew Morton, Linux Kernel Mailing List

On Fri, 16 May 2008 14:54:59 +0400 Pavel Emelyanov wrote:

> Fix the one describing what this function is and add one
> more - about locking absence around pid namespaces loop.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
> 
> ---
> 
> diff --git a/kernel/acct.c b/kernel/acct.c
> index 0feba97..d7b670c 100644
> --- a/kernel/acct.c
> +++ b/kernel/acct.c
> @@ -657,7 +657,8 @@ static void acct_process_in_ns(struct pid_namespace *ns)
>  }
>  
>  /**
> - * acct_process - now just a wrapper around do_acct_process
> + * acct_process - now just a wrapper around acct_process_in_ns,
> + * which int turn is a wrapper around do_acct_process.

            in

>   *
>   * handles process accounting for an exiting task
>   */
> @@ -665,6 +666,11 @@ void acct_process(void)
>  {
>  	struct pid_namespace *ns;
>  
> +	/*
> +	 * This loop is safe lockless, since current it still

                                                     is still

> +	 * alive and holds its namespace, which in turn holds
> +	 * its parent.
> +	 */
>  	for (ns = task_active_pid_ns(current); ns != NULL; ns = ns->parent)
>  		acct_process_in_ns(ns);
>  }

---
~Randy

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-16 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-16 10:54 [PATCH] Bsdacct: stir up comments around acct_process Pavel Emelyanov
2008-05-16 15:48 ` Randy Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.