Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935134AbcJXMMK (ORCPT ); Mon, 24 Oct 2016 08:12:10 -0400 Received: from merlin.infradead.org ([205.233.59.134]:55664 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934815AbcJXMMF (ORCPT ); Mon, 24 Oct 2016 08:12:05 -0400 Date: Mon, 24 Oct 2016 14:12:02 +0200 From: Peter Zijlstra To: Jiri Olsa Cc: Oleg Nesterov , "Ni, BaoleX" , "mingo@redhat.com" , "acme@kernel.org" , "linux-kernel@vger.kernel.org" , "alexander.shishkin@linux.intel.com" , "Liu, Chuansheng" , Jiri Olsa Subject: Re: hit a KASan bug related to Perf during stress test Message-ID: <20161024121202.GE3142@twins.programming.kicks-ass.net> References: <318B87A793BE164187D8851D6CE09D64371C8811@shsmsx102.ccr.corp.intel.com> <20161024095341.GF3102@twins.programming.kicks-ass.net> <20161024111526.GA13509@redhat.com> <20161024112732.GJ3102@twins.programming.kicks-ass.net> <20161024112945.GI3157@twins.programming.kicks-ass.net> <20161024120411.GA27567@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161024120411.GA27567@krava> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 589 Lines: 15 On Mon, Oct 24, 2016 at 02:04:11PM +0200, Jiri Olsa wrote: > On Mon, Oct 24, 2016 at 01:29:45PM +0200, Peter Zijlstra wrote: > > Hurm, then again, I imagine that after unhash_process the PID/TID could > > be instantly re-used and then we're still confused. > > sounds bad.. I haven't checked the related pid_alive code, > but shouldn't we already get the EXIT event in this case? It has, perf_event_exit_task() happens before we unhash. But a per-cpu event that has PID/TID reporting on will run into this. We'll observe 'funny' values between the unhash and the next context switch.