Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6080791ybx; Mon, 11 Nov 2019 03:34:17 -0800 (PST) X-Google-Smtp-Source: APXvYqyB/fNg9e4D9dQK9UHKJn2hCRcPr8se77F8tpMsS8yw9gIEKLYUME4WyfbDB/huzpoM7pVx X-Received: by 2002:a17:906:4dda:: with SMTP id f26mr22118577ejw.89.1573472057448; Mon, 11 Nov 2019 03:34:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573472057; cv=none; d=google.com; s=arc-20160816; b=ZP5tLGLcJPRK5cXqxYLTEPW1CMIjK5JolguvH1b/iathXm1Pa19uzzCnBxvvUsJlv6 2yl5KVgo5PPRWH7M/pjO9z0VlK4SwlYt8Zm23EvtOP90m9u8qSnYji9kasETc+i7fX2D QDiRFfmtuLVCHbfUmg3i/miZD9eKMlehfpK09OaCYZXMxKOCBO9jbbjhE6qDv9qTpuqV UExmyRGDvPlQiUsCoqIY4DUKU0eEb8VBvTwQ4nKq0X1ko7vmLB9VV/SLecvgnks7qfe9 qqkI2gSxFqElcYBoI3vxvw2SNqywbys7g0vK/fPJV7SfHRb6Zty5D4tD09wSf1YFrM2a agSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:user-agent:in-reply-to:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LI2CwsVQX5RYYaIpqN0MpmZCFExe3h+UKOjo8EkHCRs=; b=CTW0db9lez5sCKOF+61QglfKYfSMl30NHmJtIrz6AL1NfKmvNqkj9keIFc0w/UNsFI qN++ReR9wo2uihzU0lrPUFq5Koy8dOtLZtZ63X+D2F9mIqEDQHGcXhxDb2fEzWtcvINs dPKR9c4dQQ3aNCBWVdEEAR7ptiaKFB5TEPncmnsmRsTleG5S2pkBTcZ7mpw+TMn/wyye WKQIlotXr16uKhBClmSAxmy4Wqp/DWhPD9b0xaY94J8ui3uLxkQCRoN7Gay0NEk8aLn2 z3qxeTC2mkLqhucsOfy6GH4WdnW+klAZl3XNH6C4iiht0JBe2l1y5o2B9FWKt9y22h+U QeGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CUcBcBlR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i15si9110578ejz.434.2019.11.11.03.33.53; Mon, 11 Nov 2019 03:34:17 -0800 (PST) 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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CUcBcBlR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726943AbfKKLdU (ORCPT + 99 others); Mon, 11 Nov 2019 06:33:20 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:24270 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726810AbfKKLdU (ORCPT ); Mon, 11 Nov 2019 06:33:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573471998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LI2CwsVQX5RYYaIpqN0MpmZCFExe3h+UKOjo8EkHCRs=; b=CUcBcBlRlDwvRTdmKIIbJIszn/18qnh7j88hFzxjeGet4LwFrJFlWriBSwBM2BP6xeYoH2 SgnDQB1k/s8qb/HkjjjO9QHU0MuDyKJ/Vjt435Jcbp70aSPEEhir7bAuztjGnoDcM1814C MYu3aGviiwDTvTFbbeegeelJIk6D1Rs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-155-4mY9sfvKO2ikT0NC-zfiXQ-1; Mon, 11 Nov 2019 06:33:15 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5FC3B107ACC5; Mon, 11 Nov 2019 11:33:14 +0000 (UTC) Received: from krava (unknown [10.43.17.48]) by smtp.corp.redhat.com (Postfix) with SMTP id 64CFA19C4F; Mon, 11 Nov 2019 11:33:12 +0000 (UTC) Date: Mon, 11 Nov 2019 12:33:11 +0100 From: Jiri Olsa To: Steve MacLean Cc: Steve MacLean , Stephane Eranian , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3] perf inject --jit: Remove //anon mmap events Message-ID: <20191111113311.GA9791@krava> References: <1572553836-32361-1-git-send-email-steve.maclean@linux.microsoft.com> <20191101082740.GB2172@krava> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: 4mY9sfvKO2ikT0NC-zfiXQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 09, 2019 at 04:49:25PM +0000, Steve MacLean wrote: > > > While a JIT is jitting code it will eventually need to commit more=20 > > > pages and change these pages to executable permissions. > > >=20 > > > Typically the JIT will want these colocated to minimize branch displa= cements. > > >=20 > > > The kernel will coalesce these anonymous mapping with identical=20 > > > permissions before sending an MMAP event for the new pages. This mean= s=20 > > > the mmap event for the new pages will include the older pages. > > >=20 > > > These anonymous mmap events will obscure the jitdump injected pseudo = events. > > > This means that the jitdump generated symbols, machine code, debuggin= g=20 > > > info, and unwind info will no longer be used. > > >=20 > > > Observations: > > >=20 > > > When a process emits a jit dump marker and a jitdump file, the=20 > > > perf-xxx.map file represents inferior information which has been=20 > > > superceded by the jitdump jit-xxx.dump file. > > >=20 > > > Further the '//anon*' mmap events are only required for the legacy=20 > > > perf-xxx.map mapping. > > >=20 > > > When attaching to an existing process, the synthetic anon map events= =20 > > > are given a time stamp of -1. These should not obscure the jitdump=20 > > > events which have an actual time. > > >=20 > > > Summary: > > >=20 > > > Use thread->priv to store whether a jitdump file has been processed > >=20 > > I'm ok wih the implementation but not sure about the described JIT/mmap= logic, Stephane? > >=20 > > jirka >=20 > The kernel only seems to coalesce the anonymous mappings when the allocat= ions grow beyond 64K. It may not affect JITs for smaller sets of JITted cod= e. I would guess a javascript JIT engine might not hit this type of proble= m often. >=20 > @Stephane Eranian could you comment. >=20 > @Jiri Olsa I am happy to expand the explanation if it would be helpful. that'd be great, thanks jirka