From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D04FC00140 for ; Tue, 2 Aug 2022 09:10:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yBabOIl84nZ4sW4xyhxqpHax3DRpsZIt8VThua10fBw=; b=nj3s7gKx/Ai8Kg 0j5dOqPOPZENSba+xk8F1+EkxDHsgImKvtMYWGoIyT7stOBqhUbPjnx2nel3ujBb2D+CLIPDl/bPU cOylNN/BGtTLB8wWNPiuL2Hh3LvjC+HUvKvBjAA1LwU0Qd95ol/ZxHX/YC6IWA09jEXig+lDuj5LA aUgoqpd52YbXVmFL5EMS2HIrCI6ykJKOv6AmQGJbxOtIda8orbBVIkUiF83KHyZZgevP2M6aSRZ24 4m7CK4XYesv1edzFH7pCxa3OIOoF+fOc/1AC44cJY75YrUpSRzcmLm9YmNEsW/mFt9b9s4stfHYjL vZaQ7K3Gkbo1dBR0wKww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIntf-00CDKn-Hs; Tue, 02 Aug 2022 09:09:03 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIntZ-00CDD9-Gr for linux-arm-kernel@lists.infradead.org; Tue, 02 Aug 2022 09:09:00 +0000 Received: from fraeml740-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4LxpyB6WQYz682wj; Tue, 2 Aug 2022 17:06:26 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml740-chm.china.huawei.com (10.206.15.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 2 Aug 2022 11:08:48 +0200 Received: from [10.195.33.92] (10.195.33.92) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 2 Aug 2022 10:08:47 +0100 Message-ID: <3d0c1ec0-42ec-8c51-743b-5d93cabb53fb@huawei.com> Date: Tue, 2 Aug 2022 10:08:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v3 00/17] Compress the pmu_event tables To: Ian Rogers CC: Will Deacon , James Clark , "Mike Leach" , Leo Yan , Peter Zijlstra , Ingo Molnar , "Arnaldo Carvalho de Melo" , Mark Rutland , "Alexander Shishkin" , Jiri Olsa , Namhyung Kim , Andi Kleen , "Zhengjun Xing" , Ravi Bangoria , Kan Liang , Adrian Hunter , , , , Stephane Eranian References: <20220729074351.138260-1-irogers@google.com> From: John Garry In-Reply-To: X-Originating-IP: [10.195.33.92] X-ClientProxiedBy: lhreml717-chm.china.huawei.com (10.201.108.68) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220802_020857_907110_97B77839 X-CRM114-Status: GOOD ( 22.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 29/07/2022 18:27, Ian Rogers wrote: >> This implementation would require core pmu.c to be changed, but there is >> ways that this could be done without needing to change core pmu.c >> >> Thanks, >> John > Thanks John! > > You are right about broadwell, it is an extreme case of sharing. IIRC > BDX is the server core/uncore events, BDW is the consumer core/uncore > and BDW-DE is consumer core with server uncore - so the sharing is > inherent in this. Metrics become interesting as they may mix core and > uncore, but I'll ignore that here. > > In the old code every event needs 15 char*s, with 64-bit that is 15*8 > bytes per entry with 741 core and 23 uncore entries for BDW, and 372 > core and 1284 uncore for BDX. I expect the strings themselves will be > shared by the C compiler, and so I just focus on the pointer sizes. > With the new code every event is just 1 32-bit int. So for BDW we go > from 15*8*(741+23)=91,680 to 4*(741+23)=3056, BDX is > 15*8*(372+1284)=198720 to 4*(372+1284)=6624. This means we've gone > from 290,400bytes to 9,680bytes for BDW and BDX. BDW-DE goes from > 243,000bytes to 8,100bytes - > we can ignore the costs of the strings as > they should be fully shared, especially for BDW-DE. Are you sure about this? I did not think that the compiler would have the intelligence to try to share strings. That is the basis of the size optimisation which I was proposing (that the compiler would not share strings). > > If we added some kind of table sharing, so BDW-DE was core from BDW > and uncore from BDX and the tables shared, then in the old code you > could save nearly 0.25MB but with the new code the saving is only > around 8KB. I think we can go after that 8KB but it is less urgent > after this change which gets 96% of the benefit. We have 72 > architectures for jevents at the moment and so I'd ball park (assuming > they all saved as much as BDW-DE) the max saving as about 0.5MB, which > is 12% of what is saved here. > > Longer term I'd like to make the pmu-events.c logic look closer to the > sysfs API. Perhaps we can unify the uncore events for BDX and BDW-DE > with some notion of a common PMU, or PMUs with common events and > tables, and automate deduction of this. It also isn't clear to me the > advantage of storing the metrics inside the events, separate tables > feel cleaner. Anyway, there's lots of follow up. Thanks, John _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel