Loading kernel/acct.c +28 −22 Original line number Diff line number Diff line Loading @@ -599,8 +599,9 @@ void acct_collect(long exitcode, int group_dead) spin_unlock_irq(¤t->sighand->siglock); } static void acct_process_in_ns(struct pid_namespace *ns) static void slow_acct_process(struct pid_namespace *ns) { for ( ; ns; ns = ns->parent) { struct file *file = NULL; struct bsd_acct_struct *acct; Loading @@ -609,13 +610,13 @@ static void acct_process_in_ns(struct pid_namespace *ns) * accelerate the common fastpath: */ if (!acct || !acct->file) return; continue; spin_lock(&acct_lock); file = acct->file; if (unlikely(!file)) { spin_unlock(&acct_lock); return; continue; } get_file(file); spin_unlock(&acct_lock); Loading @@ -623,10 +624,10 @@ static void acct_process_in_ns(struct pid_namespace *ns) do_acct_process(acct, ns, file); fput(file); } } /** * acct_process - now just a wrapper around acct_process_in_ns, * which in turn is a wrapper around do_acct_process. * acct_process * * handles process accounting for an exiting task */ Loading @@ -639,6 +640,11 @@ void acct_process(void) * 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); for (ns = task_active_pid_ns(current); ns != NULL; ns = ns->parent) { struct bsd_acct_struct *acct = ns->bacct; if (acct && acct->file) break; } if (unlikely(ns)) slow_acct_process(ns); } Loading
kernel/acct.c +28 −22 Original line number Diff line number Diff line Loading @@ -599,8 +599,9 @@ void acct_collect(long exitcode, int group_dead) spin_unlock_irq(¤t->sighand->siglock); } static void acct_process_in_ns(struct pid_namespace *ns) static void slow_acct_process(struct pid_namespace *ns) { for ( ; ns; ns = ns->parent) { struct file *file = NULL; struct bsd_acct_struct *acct; Loading @@ -609,13 +610,13 @@ static void acct_process_in_ns(struct pid_namespace *ns) * accelerate the common fastpath: */ if (!acct || !acct->file) return; continue; spin_lock(&acct_lock); file = acct->file; if (unlikely(!file)) { spin_unlock(&acct_lock); return; continue; } get_file(file); spin_unlock(&acct_lock); Loading @@ -623,10 +624,10 @@ static void acct_process_in_ns(struct pid_namespace *ns) do_acct_process(acct, ns, file); fput(file); } } /** * acct_process - now just a wrapper around acct_process_in_ns, * which in turn is a wrapper around do_acct_process. * acct_process * * handles process accounting for an exiting task */ Loading @@ -639,6 +640,11 @@ void acct_process(void) * 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); for (ns = task_active_pid_ns(current); ns != NULL; ns = ns->parent) { struct bsd_acct_struct *acct = ns->bacct; if (acct && acct->file) break; } if (unlikely(ns)) slow_acct_process(ns); }