From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752683AbcLGCVg (ORCPT ); Tue, 6 Dec 2016 21:21:36 -0500 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:49682 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751064AbcLGCVf (ORCPT ); Tue, 6 Dec 2016 21:21:35 -0500 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 165.244.249.25 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 10.177.227.17 X-Original-MAILFROM: namhyung@kernel.org Date: Wed, 7 Dec 2016 11:06:29 +0900 From: Namhyung Kim To: David Ahern CC: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , Andi Kleen , Minchan Kim Subject: Re: [PATCH 03/10] perf sched timehist: Handle zero sample->tid properly Message-ID: <20161207020629.GB17879@sejong> References: <20161206034010.6499-1-namhyung@kernel.org> <20161206034010.6499-4-namhyung@kernel.org> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB04/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/12/07 11:06:29, Serialize by Router on LGEKRMHUB04/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/12/07 11:06:29, Serialize complete at 2016/12/07 11:06:29 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 05, 2016 at 07:52:57PM -0800, David Ahern wrote: > On 12/5/16 7:40 PM, Namhyung Kim wrote: > > Sometimes samples have tid of 0 but non-0 pid. It ends up having a > > Any idea how that happens? It seems that an exiting task wakes up its parent and the parent might call wait(2) concurrently. So at the time of calling last schedule(), its pid (and tgid) link might be unhashed by the parent and can have 0 sample->tid and/or sample->pid depending on timing IMHO. Not sure anything guarantees that the sample tid/pid is preserved during the event. From a quick look I couldn't find.. If that's true we need to somehow make sure that sample->tid of 0 is actually from idle task or not. Thanks, Namhyung