Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752151AbbGOCCD (ORCPT ); Tue, 14 Jul 2015 22:02:03 -0400 Received: from mail-qk0-f181.google.com ([209.85.220.181]:36855 "EHLO mail-qk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750996AbbGOCCB (ORCPT ); Tue, 14 Jul 2015 22:02:01 -0400 Message-ID: <55A5BF0F.7090808@gmail.com> Date: Tue, 14 Jul 2015 22:01:51 -0400 From: David Ahern User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Oleg Nesterov , Andrey Vagin CC: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Andrew Morton , Cyrill Gorcunov , Pavel Emelyanov , Roger Luethi , Arnd Bergmann , Arnaldo Carvalho de Melo , Andy Lutomirski , Pavel Odintsov Subject: Re: [PATCH 20/24] task_diag: Only add VMAs for thread_group leader References: <1436172445-6979-1-git-send-email-avagin@openvz.org> <1436172445-6979-21-git-send-email-avagin@openvz.org> <20150714174703.GA8088@redhat.com> In-Reply-To: <20150714174703.GA8088@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1236 Lines: 43 On 7/14/15 1:47 PM, Oleg Nesterov wrote: > On 07/06, Andrey Vagin wrote: >> >> From: David Ahern >> >> threads of a process share the same VMAs, so when dumping all threads >> for all processes only push vma data for group leader. > > ... > >> @@ -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. > >> 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/