Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2756922ybc; Mon, 18 Nov 2019 04:16:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyd8SkGdoOXR9L3RAJtqRjZm2xd24r++8R2Ds+mIDQaBeat0SGj/L5qjKhFiFdkHZdig12d X-Received: by 2002:a1c:7f94:: with SMTP id a142mr27721143wmd.33.1574079365469; Mon, 18 Nov 2019 04:16:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574079365; cv=none; d=google.com; s=arc-20160816; b=e9bMJMCIhWTDJx+sveIQtCBhSHaSvvrY/s6acj0J9x8Ui5jP4CkhjDYDMGqHz5w5AC EIzbrwRu0u3GfSKPiG7CdJCqJX+c35iW0FJoUVlkM7Qy7oeThdC3EL9AJOhZQzC2OYa1 G+DdX7pr76K8R1PBFHrKS7id8c2MwlRN6NjXz05yoCaFndxjtWrhQPj5YOeyiKnb0lRx RpXQsRmOtmiLwQcB3oHXgI4fqLF7rWf9HM+Lx2Bf3NWXQqQ3EVxNqmyp//9vN6eHDMo9 GY31cWILi8jNmZVHYm7RIPTYW/WPsskACoSXoCrMNtIYkpDA/Ji//EqJy7bHTh6RQ4iV uUaA== 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=T0uEV+1gem/l/NJ+2CcnpzBDHX5b7ZLnFJR2bueznwk=; b=a2FO2W/qd0NjHmm415o4+IZ24ovBVLmIFUY7TNEPg2pGOmT6RKJC9gSdTZr7L3s0Wt svV5AlItyoALPdLbKtJFTvLNI86yT4zxTiVfsOBndjyiyYLN7giQCYiZBjddHHSJady/ PZiBzfx6Hzz5LlR+sZDMpfkYATKpjppSTS23Suln0bSSybpsAbIWhnf6RBmFhih6Hou9 2o1LtuiMRDPWJJGYDfcEjKXVkyH/Mk4bzuqYvKAAB9AyX3pL8YfsFwf1FQ0vUzDGU4o/ t/dh7jIhhdwlnvl1fYZOgQUcJ0yB3OkI6hgB2O7uneaGBROne5xrOaajDGJ8lHrb7ZB9 M+eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=W4LPqkWd; 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 g24si12395212edv.239.2019.11.18.04.15.41; Mon, 18 Nov 2019 04:16:05 -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=W4LPqkWd; 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 S1726646AbfKRMOJ (ORCPT + 99 others); Mon, 18 Nov 2019 07:14:09 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:33533 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726536AbfKRMOJ (ORCPT ); Mon, 18 Nov 2019 07:14:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574079248; 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=T0uEV+1gem/l/NJ+2CcnpzBDHX5b7ZLnFJR2bueznwk=; b=W4LPqkWdb64eFwn1sV4gGCcOTkiSIBk+X3HXnm5EDUN0Ub4ugtaPZtihCKUtKblpmpN0cy ctUhhmAfNxGDizcqGBW+j2FRx2AnOo4WruuORgjYLJeL4GSS5JjyS/ibPjSNhDLjdwNYmL r0b/+krNq6A7DEUlbfV4TVZ1vKa3DRQ= 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-91-RwvITnJoPj2Om1RsNqicgQ-1; Mon, 18 Nov 2019 07:14:05 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4AFC5184B7FF; Mon, 18 Nov 2019 12:14:03 +0000 (UTC) Received: from krava (unknown [10.43.17.48]) by smtp.corp.redhat.com (Postfix) with SMTP id E0B1118783; Mon, 18 Nov 2019 12:14:00 +0000 (UTC) Date: Mon, 18 Nov 2019 13:14:00 +0100 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Andi Kleen , Stephane Eranian , Jin Yao , Alexey Budankov Subject: Re: [PATCHv2 0/2] perf tools: Share struct map after clone Message-ID: <20191118121400.GA14046@krava> References: <20191016082226.10325-1-jolsa@kernel.org> <20191023075517.GA22919@krava> <20191029205855.GA20826@krava> MIME-Version: 1.0 In-Reply-To: <20191029205855.GA20826@krava> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: RwvITnJoPj2Om1RsNqicgQ-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 Tue, Oct 29, 2019 at 09:58:55PM +0100, Jiri Olsa wrote: > On Wed, Oct 23, 2019 at 09:55:17AM +0200, Jiri Olsa wrote: > > On Wed, Oct 16, 2019 at 10:22:24AM +0200, Jiri Olsa wrote: > > > hi, > > > Andi reported that maps cloning is eating lot of memory and > > > it's probably unnecessary, because they keep the same data. > > >=20 > > > This 'maps sharing' seems to save lot of heap for reports with > > > many forks/cloned mmaps (over 60% in example below). > > >=20 > > > Profile kernel build: > > >=20 > > > $ perf record make -j 40 > > >=20 > > > Get heap profile (tools/perf directory): > > >=20 > > > $ > > > $ make TCMALLOC=3D1 > > > $ HEAPPROFILE=3D/tmp/heapprof ./perf report -i perf.data --stdio > = out > > > $ pprof ./perf /tmp/heapprof.000* > > >=20 > > > Before: > > >=20 > > > (pprof) top > > > Total: 2335.5 MB > > > 1735.1 74.3% 74.3% 1735.1 74.3% memdup > > > 402.0 17.2% 91.5% 402.0 17.2% zalloc > > > 140.2 6.0% 97.5% 145.8 6.2% map__new > > > 33.6 1.4% 98.9% 33.6 1.4% symbol__new > > > 12.4 0.5% 99.5% 12.4 0.5% alloc_event > > > 6.2 0.3% 99.7% 6.2 0.3% nsinfo__new > > > 5.5 0.2% 100.0% 5.5 0.2% nsinfo__copy > > > 0.3 0.0% 100.0% 0.3 0.0% dso__new > > > 0.1 0.0% 100.0% 0.1 0.0% do_read_string > > > 0.0 0.0% 100.0% 0.0 0.0% __GI__IO_file_doallocate > > >=20 > > > After: > > >=20 > > > (pprof) top > > > Total: 784.5 MB > > > 385.8 49.2% 49.2% 385.8 49.2% memdup > > > 285.8 36.4% 85.6% 285.8 36.4% zalloc > > > 80.4 10.3% 95.9% 83.7 10.7% map__new > > > 19.1 2.4% 98.3% 19.1 2.4% symbol__new > > > 6.2 0.8% 99.1% 6.2 0.8% alloc_event > > > 3.6 0.5% 99.6% 3.6 0.5% nsinfo__new > > > 3.2 0.4% 100.0% 3.2 0.4% nsinfo__copy > > > 0.2 0.0% 100.0% 0.2 0.0% dso__new > > > 0.0 0.0% 100.0% 0.0 0.0% do_read_string > > > 0.0 0.0% 100.0% 0.0 0.0% elf_fill > > >=20 > > > v2 changes: > > > - rebased to Arnaldo's perf/core > > > - patch 1 already taken > > >=20 > > > Also available in here: > > > git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git > > > perf/map_shared > >=20 > > I rebased to latest perf/core and pushed the branch out >=20 > rebased and pushed out heya, I lost track of this.. what's the status, are you going with your version, or is this one still in? I don't see any of them in latest code.. thanks, jirka