]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/acct.c
[SCSI] 3w-9xxx: remove unnecessary local_irq_save/restore for scsi sg copy API
[linux-2.6-omap-h63xx.git] / kernel / acct.c
index 0feba97e114e4025040e8c73f5accb133c9a4f03..f6006a60df5ddff73990656f73ea7fff55dcf9b8 100644 (file)
@@ -548,7 +548,7 @@ static void do_acct_process(struct bsd_acct_struct *acct,
 #endif
 
        spin_lock_irq(&current->sighand->siglock);
-       tty = current->signal->tty;
+       tty = current->signal->tty;     /* Safe as we hold the siglock */
        ac.ac_tty = tty ? old_encode_dev(tty_devnum(tty)) : 0;
        ac.ac_utime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_utime)));
        ac.ac_stime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_stime)));
@@ -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);
 }