[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1460417755-18201-9-git-send-email-avagin@openvz.org>
Date: Mon, 11 Apr 2016 16:35:48 -0700
From: Andrey Vagin <avagin@...nvz.org>
To: linux-kernel@...r.kernel.org
Cc: Andrey Vagin <avagin@...nvz.org>, Oleg Nesterov <oleg@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Cyrill Gorcunov <gorcunov@...nvz.org>,
Pavel Emelyanov <xemul@...allels.com>,
Roger Luethi <rl@...lgate.ch>, Arnd Bergmann <arnd@...db.de>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
David Ahern <dsahern@...il.com>,
Andy Lutomirski <luto@...capital.net>,
Pavel Odintsov <pavel.odintsov@...il.com>
Subject: [PATCH 08/15] task_diag: Only add VMAs for thread_group leader
From: David Ahern <dsahern@...il.com>
threads of a process share the same VMAs, so when dumping all threads
for all processes only push vma data for group leader.
Signed-off-by: David Ahern <dsahern@...il.com>
Signed-off-by: Andrey Vagin <avagin@...nvz.org>
---
fs/proc/task_diag.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/fs/proc/task_diag.c b/fs/proc/task_diag.c
index e0f0b03..00db32d 100644
--- a/fs/proc/task_diag.c
+++ b/fs/proc/task_diag.c
@@ -433,7 +433,17 @@ static int task_diag_fill(struct task_struct *tsk, struct sk_buff *skb,
}
if (show_flags & TASK_DIAG_SHOW_VMA) {
- if (i >= n)
+ bool dump_vma = true;
+
+ /* if the request is to dump all threads of all processes
+ * only show VMAs for group leader.
+ */
+ if ((req->dump_strategy == TASK_DIAG_DUMP_ALL_THREAD ||
+ req->dump_strategy == TASK_DIAG_DUMP_THREAD) &&
+ !thread_group_leader(tsk))
+ dump_vma = false;
+
+ if (dump_vma && i >= n)
err = fill_vma(tsk, skb, cb, &progress, show_flags);
if (err)
goto err;
--
2.5.5
Powered by blists - more mailing lists