[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <1403011478-20206-1-git-send-email-p.wilczek@samsung.com>
Date: Tue, 17 Jun 2014 15:24:37 +0200
From: Piotr Wilczek <p.wilczek@...sung.com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org, Kyungmin Park <kyungmin.park@...sung.com>,
Juho Son <juho80.son@...sung.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Piotr Wilczek <p.wilczek@...sung.com>
Subject: [PATCH net-next 1/2] procfs: split proc_pid_status function
Split proc_pid_status function to get proces status with task locked elswere.
This allows to collect multiple process information with a single task lock.
Signed-off-by: Piotr Wilczek <p.wilczek@...sung.com>
---
fs/proc/array.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 64db2bc..dcf9a28 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -356,24 +356,36 @@ static void task_cpus_allowed(struct seq_file *m, struct task_struct *task)
seq_putc(m, '\n');
}
-int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
- struct pid *pid, struct task_struct *task)
+int proc_pid_status_mm(struct seq_file *m, struct pid_namespace *ns,
+ struct pid *pid, struct task_struct *task,
+ struct mm_struct *mm)
{
- struct mm_struct *mm = get_task_mm(task);
-
task_name(m, task);
task_state(m, ns, pid, task);
- if (mm) {
+ if (mm)
task_mem(m, mm);
- mmput(mm);
- }
+
task_sig(m, task);
task_cap(m, task);
task_seccomp(m, task);
task_cpus_allowed(m, task);
cpuset_task_status_allowed(m, task);
task_context_switch_counts(m, task);
+
+ return 0;
+}
+
+int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
+ struct pid *pid, struct task_struct *task)
+{
+ struct mm_struct *mm = get_task_mm(task);
+
+ if (mm) {
+ proc_pid_status_mm(m, ns, pid, task, mm);
+ mmput(mm);
+ }
+
return 0;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists