Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2429983pxk; Mon, 14 Sep 2020 13:09:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyf7/Lu1nuuIVg5W0yKJIx68I0+Huwyw3L6aeNe2hrD80A4M6C3IVox6NtU8nNQlKJ5RABz X-Received: by 2002:a17:907:724f:: with SMTP id ds15mr16161689ejc.119.1600114187444; Mon, 14 Sep 2020 13:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600114187; cv=none; d=google.com; s=arc-20160816; b=e+cQxdCRJY8bCb/kBEPU0/W3nVOtssCMufvYPF+Uvo+a12wtUONc1TA8orM5FN/qvg sKPilQHM4FB0Ql/7Gf5Ev1KBOgNgxzWz9FBYZ26EzJH0HSffEYwxarMixTiFczpfjUY2 50ko0y3U5CKQ21jDqt1hPHoYkxXXA1xn01wdcN1CpAEsFTxc+ppffySVo+uAAMlxdRE5 Us6/l/3TpMjKpRrf2B4yg5TjnLGG7BrroG50SnXpkxOwxo4R9dW2NdfWjqOKEy4gi5m2 fIiV6BreZNnWu547PAgqqPb29xW/F8sPGn2MTTd1IdD2Am9PKNzJCx6rd4LVBV2oieoj inXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=kRlln9V1GvO5+NGpvkV2buBDGuKlOmRWgBQoF1uRx3c=; b=j4l+z88zi8AdPkEBv1KFTzWmEcKne1Z5YKW6IRrTiY4+b+siEDswHiS8KYq1mgog+o o1SGisAwpSMYeY+kjkZmWpadmLAMTAdeAXNok9bp04KtVpaeniOZgVGQAoijIeXVlbfk jJvk2aE/hahYWHQAKAWMbUnO29IfvuD6qlzGKDy0mLJ8Qi7zBefI8wVAzqfl7akpZepC 8lqI+G1kh4LX3a0MzrpAoCq0nahAh8/ZkPRrctMfs7y/YK9ulxSCT9OAukUJTCrVchcp G8iNCxcGq8/GdxXGQQLHyu/ttPj3pfCssQuYUaes1APxzzUyHbo0SEtaLFE3faLYq0k6 p3CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HW8Rt1Bl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id w21si8035047edv.485.2020.09.14.13.09.25; Mon, 14 Sep 2020 13:09:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HW8Rt1Bl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726068AbgINUHa (ORCPT + 99 others); Mon, 14 Sep 2020 16:07:30 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:29709 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726040AbgINUHY (ORCPT ); Mon, 14 Sep 2020 16:07:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600114043; 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: in-reply-to:in-reply-to:references:references; bh=kRlln9V1GvO5+NGpvkV2buBDGuKlOmRWgBQoF1uRx3c=; b=HW8Rt1Bl+0c+N0fxDnTy9OFmd7I0X9GNY/ISVo64cvpzHLdzWZP539o/YDPywxOQYlzH/A re5tKAJORFLv8QX7XP2gCV/4qetVDvcjIDUxVLdxBtgLYKc5aUEkWgYV+Op/P4rT3yTjpA jVGzFwyaXSXJq33Vm3oGtFwpaiKlVQE= 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-492-IFp-zbWpOIiZ13MOUbmYrQ-1; Mon, 14 Sep 2020 16:07:21 -0400 X-MC-Unique: IFp-zbWpOIiZ13MOUbmYrQ-1 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 86C8D1084C92; Mon, 14 Sep 2020 20:07:18 +0000 (UTC) Received: from krava (unknown [10.40.192.180]) by smtp.corp.redhat.com (Postfix) with SMTP id 03F1D19C4F; Mon, 14 Sep 2020 20:07:12 +0000 (UTC) Date: Mon, 14 Sep 2020 22:07:11 +0200 From: Jiri Olsa To: Ian Rogers Cc: Peter Zijlstra , Arnaldo Carvalho de Melo , Namhyung Kim , Jiri Olsa , lkml , Ingo Molnar , Mark Rutland , Alexander Shishkin , Michael Petlan , Song Liu , "Frank Ch. Eigler" , Stephane Eranian , Alexey Budankov , Andi Kleen , Adrian Hunter , Alexei Starovoitov , Daniel Borkmann , Yonghong Song Subject: Re: [PATCH 02/26] perf: Introduce mmap3 version of mmap event Message-ID: <20200914200711.GS1714160@krava> References: <20200913210313.1985612-1-jolsa@kernel.org> <20200913210313.1985612-3-jolsa@kernel.org> <20200914152841.GC160517@kernel.org> <20200914163534.GT1362448@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 14, 2020 at 10:08:01AM -0700, Ian Rogers wrote: SNIP > > > > Using one of the MISC bits to resolve the union. Might actually bring > > benefit to everyone. Us normal people get to have a smaller MMAP record, > > while the buildid folks can have it too. > > > > Even more extreme would be using 2 MISC bits and allowing the union to > > be 0 sized for anon. > > > > That said; I have the nagging feeling there were unresolved issues with > > mmap2, but I can't seem to find any relevant emails on it :/ My > > google-fu is weak today. > > Firstly, thanks Jiri for this really useful patch set for our > use-cases! Some thoughts: > > One issue with mmap2 events at the moment is that they happen "after" > the mmap is performed. This allows the mapped address to be known but > has the unfortunate problem of causing mmap events to get "extended" > due to adjacent vmas being merged. There are some workarounds like > commit c8f6ae1fb28d (perf inject jit: Remove //anon mmap events). > Perhaps these events can switch to reporting the length the mmap > requested rather than the length of the vma? seems like separate feature, perhaps we could use another MISC bit for that? > > I could imagine that changes here could be interesting to folks doing > CHERI or hypervisors, for example, they may want more address bits. > > BPF has stack traces with elements of buildid + offset. Using these in > perf samples would avoid the need for mmap events, synthesis, etc. but > at the cost of larger and possibly slower stack traces. Perhaps we > should just remove the idea of mmap events altogether? hm, we also need mmap events to resolve PERF_SAMPLE_IP, right? also not sure how would we do that for dwarf unwind, and perhaps there are some other places.. c2c data address resolving? thanks, jirka