Thread (55 messages) 55 messages, 9 authors, 2015-12-15

Re: [PATCH 20/24] task_diag: Only add VMAs for thread_group leader

flat view

From: David Ahern <hidden>
Date: 2015-07-15 02:02:03
Also in: lkml

On 7/14/15 1:47 PM, Oleg Nesterov wrote:
On 07/06, Andrey Vagin wrote:
quoted
From: David Ahern <redacted>

threads of a process share the same VMAs, so when dumping all threads
for all processes only push vma data for group leader.
...
quoted
@@ -492,6 +493,13 @@ static int task_diag_fill(struct task_struct *tsk, struct sk_buff *skb,
  	}

  	if (show_flags & TASK_DIAG_SHOW_VMA) {
+		/* 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 &&
+		    !thread_group_leader(tsk))
+			goto done;
+
This doesn't look right, group leader can be a zombie with ->mm == NULL,
Seriously? I'll find some way to track whether VMAs have been dumped for a pid.
quoted
  		if (i >= n)
  			err = fill_vma(tsk, skb, cb, &progress, show_flags);
so this probably needs something like find_lock_task_mm().
ok.

Thanks for the review,
David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help