lkml.org 
[lkml]   [2008]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH (resend)] Bsdacct: stir up comments around acct_process
Fix the one describing what this function is and add one
more - about locking absence around pid namespaces loop.

Changes from v1: fixed misprints pointed out by Randy.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>

---

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 in 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 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);
}

\
 
 \ /
  Last update: 2008-05-19 09:51    [W:0.039 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site