Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1237371ima; Wed, 24 Oct 2018 17:25:38 -0700 (PDT) X-Google-Smtp-Source: AJdET5cVhzk9w80cgd01YV0pFmNoqgS+6iOG9nuJ7OqgdY12uw94m731exKFwecketW23hNkwHzU X-Received: by 2002:a62:3701:: with SMTP id e1-v6mr4727893pfa.39.1540427138431; Wed, 24 Oct 2018 17:25:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540427138; cv=none; d=google.com; s=arc-20160816; b=LODep8b6D9CFjz4jf2WLY+pX7KPumjkgETTTubt9aXiSpmsNszUNWORc+R4/9ncyZP ZVgjQk+blIw4nXD6nvXGn5SuRQorfTI6y9oJp/prnjnMXxBmyahQ7NqaDUQ2g/16EMTw EK9oiSCxwsVx7Y1OXffQmrtJ0SUOPQv+1rv5KDhBdMvr8cMMtxzoxJpy7t7F7eDGRvvT sP2wHqggRGeTVMjo897QjtLkcNfwVNktEAN/a5KQyem3m8f5IoumtDojkLy/4PnNhGvU F1FCRpMLPFUhMkAX0Un9UqlwUNOLJqFJqC31zDxwwIyACNQxVx3RGJpLoImaxcFyKiex HJcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=adEBDHKYdQvd4UOGGDtM5RwesL4q02oJi3yLtZBTT/s=; b=qwXFY3L67VBVQLhKkfX6/an4KcC7dRdu2If0l/FI5HVVfkRBDOxeWKN29MgT1gqBV8 6MLwL1T/5r73IEQDQuBxBxHxG9qVox++RH7mUC642cHeq/FMBADXr1vrqIItrBP4bPhc oniN+dKSEZ5XAaKQOC+b8uWMUmnVlMRZh2c21Wv+iUZbUavzZJugapsNKYo1WapWDG81 uN4R3MsCvVpZH/W+Jczc37ZpAJbUnhX9hukA4bG27xPUzrmW470w0NBXDzfe77BdgxD4 mTCxg1b7cFwcci2NyqP/IAqT5wWgkz7tqyX2HydoZ+3eemHQ43Ve0H/3J4oTrvj4IDKU e0hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=WKW+PrfW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f32-v6si5931590pgf.203.2018.10.24.17.25.23; Wed, 24 Oct 2018 17:25:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=WKW+PrfW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726972AbeJYIxr (ORCPT + 99 others); Thu, 25 Oct 2018 04:53:47 -0400 Received: from merlin.infradead.org ([205.233.59.134]:42806 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726236AbeJYIxr (ORCPT ); Thu, 25 Oct 2018 04:53:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=adEBDHKYdQvd4UOGGDtM5RwesL4q02oJi3yLtZBTT/s=; b=WKW+PrfWXilIeIzhMkYGTp0Sj w3/xVuICRsX3/3lvoTqh+2TALTM2Q06BVjsRi7D5/66RRWaRozhzLSM9MEj/BXz+loWSGW75YMnhK vzSYhcleqPmLos9HTWL+4jentiW4bqlOGkBXboGzqm/3ncg+kI8umrkfOc+bFEsRdKQUipvkVVaDx Ba6pqhNCPtQsJGaRkyYxNPpuxUBPRGN0WYApm8EZsoi3xflLGluvd3Ks4shnl4s0fHrFy/kfw6CyI CO6D70JXtDmrUnBTUx1lQVd53Q3n1iz2M9ln/WHtKPgCKg0NWI1uKFabidNmNnqS4e6XlZyB3eIVe fCsPMOB6w==; Received: from [167.98.65.38] (helo=worktop) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gFTQl-0002Sa-2k; Thu, 25 Oct 2018 00:23:19 +0000 Received: by worktop (Postfix, from userid 1000) id 911626E0675; Thu, 25 Oct 2018 02:23:12 +0200 (CEST) Date: Thu, 25 Oct 2018 02:23:12 +0200 From: Peter Zijlstra To: Stephane Eranian Cc: "Liang, Kan" , Thomas Gleixner , Ingo Molnar , Arnaldo Carvalho de Melo , LKML , Borislav Petkov , Andi Kleen Subject: Re: [PATCH 1/2] perf: Add munmap callback Message-ID: <20181025002312.GS3109@worktop.c.hoisthospitality.com> References: <20181024151116.30935-1-kan.liang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 24, 2018 at 12:30:52PM -0700, Stephane Eranian wrote: > Hi, > > On Wed, Oct 24, 2018 at 8:12 AM wrote: > > > > From: Kan Liang > > > > To calculate the physical address, perf needs to walk the pages tables. > > The related mapping may has already been removed from pages table in > > some cases (e.g. large PEBS). The virtual address recorded in the first > > PEBS records may already be unmapped before draining PEBS buffers. > > > > Add a munmap callback to notify the PMU of any unmapping, which only be > > invoked when the munmap is implemented. > > > The need for this new record type extends beyond physical address conversions > and PEBS. A long while ago, someone reported issues with symbolization related > to perf lacking munmap tracking. It had to do with vma merging. I think the > sequence of mmaps was as follows in the problematic case: > 1. addr1 = mmap(8192); > 2. munmap(addr1 + 4096, 4096) > 3. addr2 = mmap(addr1+4096, 4096) > > If successful, that yields addr2 = addr1 + 4096 (could also get the > same without forcing the address). That is actually a different problem. And you're right, we never did fix that. I agree with you that Kan's Changelog is somewhat cryptic; it took me at least 3 times reading and looking at what the patches actually do to understand :/