Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp670140pxy; Wed, 28 Apr 2021 11:40:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjI+m18C3ZyBV/TMlrxegJu19U3h475GgibNt+Qa/A2OAztoKyyX8vV1z6fYLRtL2vEVz9 X-Received: by 2002:aa7:87d3:0:b029:259:ff63:3500 with SMTP id i19-20020aa787d30000b0290259ff633500mr28387812pfo.35.1619635245798; Wed, 28 Apr 2021 11:40:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619635245; cv=none; d=google.com; s=arc-20160816; b=Wo7AqvELdv2Etuoofn/pmXQeOH1Gp1S+vW0RIZ3EXZ9k/bfOnuAgffGx+ZJYfk9qab x69kyccft6NTivgU7NozQ1sumhELfZCErtgFw998tSsJ3X+pkIx7f74rr2M43f2qxzaW eqxwhW1e1eU+R34td+GdhCf6n/aUb7L8jb7umfDD1tKyB1wjIExMgyjvzwHnSLpizXz+ I3pTsjUaFxuRQPM1CU5Sd3rxTD5S3wGH5CpX3R0R61OzFKBxSkuIg7BWhQ0G7pfnkpKz fv2UdXDfiez7P4ugfiBPVQ2jDlfMNM1ij7NCLw2yhe52stwNfk70JMcgc4dAUiTXYc8X AfWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=xVGLwwwdCJ7cjviEJV6UeL5Zs8qkPASswE83hDL9yNs=; b=o4cfJjDo3C95dGGRD8lAlK7QVNzkabGqejedMpzuGUDJYNn8aA51hBX0N4F6uaVaPj UJNwC9d8PAuYYnDuyd1edfSe8DcCLzgDw3AqdFnxo8+CHYxsyg59U16zcQfx6BBB/ab7 Zy3adva5MpnYoDIA7bayll5OhliI1K4ijEx6KVyaLFf3ou9q5bzASGcO1CAWy8xITuv8 Zs92cvUX/+DPGXc94fome4+EvYvjPTizGCW2VwA/Bo163pKhx2lQE7U8vILet6wvbGGP +TzQGiWQAl3AWOgxmID/xrNcposXGnLiQY5cnv8g3FDvjAXV2lGaKLCRdSzfFMyzwr5M Xf6w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u18si7657468pjy.86.2021.04.28.11.40.30; Wed, 28 Apr 2021 11:40:45 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236884AbhD1OrA (ORCPT + 99 others); Wed, 28 Apr 2021 10:47:00 -0400 Received: from foss.arm.com ([217.140.110.172]:44400 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232569AbhD1Oq7 (ORCPT ); Wed, 28 Apr 2021 10:46:59 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2766DED1; Wed, 28 Apr 2021 07:46:14 -0700 (PDT) Received: from e120877-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E442F3F694; Wed, 28 Apr 2021 07:46:12 -0700 (PDT) Date: Wed, 28 Apr 2021 15:46:10 +0100 From: Vincent Donnefort To: Quentin Perret Cc: peterz@infradead.org, rjw@rjwysocki.net, viresh.kumar@linaro.org, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, ionela.voinescu@arm.com, lukasz.luba@arm.com, dietmar.eggemann@arm.com Subject: Re: [PATCH] PM / EM: Inefficient OPPs detection Message-ID: <20210428144609.GB71893@e120877-lin.cambridge.arm.com> References: <1617901829-381963-1-git-send-email-vincent.donnefort@arm.com> <1617901829-381963-2-git-send-email-vincent.donnefort@arm.com> <20210422153644.GA316798@e124901.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > On the Pixel4, I used rt-app to generate a task whom duty cycle is getting > > higher for each phase. Then for each rt-app task placement, I measured how long > > find_energy_efficient_cpu() took to run. I repeated the operation several > > times to increase the count. Here's what I've got: > > > > ┌────────┬─────────────┬───────┬────────────────┬───────────────┬───────────────┐ > > │ Phase │ duty-cycle │ CPU │ w/o LUT │ w/ LUT │ │ > > │ │ │ ├────────┬───────┼───────┬───────┤ Diff │ > > │ │ │ │ Mean │ count │ Mean │ count │ │ > > ├────────┼─────────────┼───────┼────────┼───────┼───────┼───────┼───────────────┤ > > │ 0 │ 12.5% │ Little│ 10791 │ 3124 │ 10657 │ 3741 │ -1.2% -134ns │ > > ├────────┼─────────────┼───────┼────────┼───────┼───────┼───────┼───────────────┤ > > │ 1 │ 25% │ Mid │ 2924 │ 3097 │ 2894 │ 3740 │ -1% -30ns │ > > ├────────┼─────────────┼───────┼────────┼───────┼───────┼───────┼───────────────┤ > > │ 2 │ 37.5% │ Mid │ 2207 │ 3104 │ 2162 │ 3740 │ -2% -45ns │ > > ├────────┼─────────────┼───────┼────────┼───────┼───────┼───────┼───────────────┤ > > │ 3 │ 50% │ Mid │ 1897 │ 3119 │ 1864 │ 3717 │ -1.7% -33ns │ > > ├────────┼─────────────┼───────┼────────┼───────┼───────┼───────┼───────────────┤ > > │ │ │ Mid │ 1700 │ 396 │ 1609 │ 1232 │ -5.4% -91ns │ > > │ 4 │ 62.5% ├───────┼────────┼───────┼───────┼───────┼───────────────┤ > > │ │ │ Big │ 1187 │ 2729 │ 1129 │ 2518 │ -4.9% -58ns │ > > ├────────┼─────────────┼───────┼────────┼───────┼───────┼───────┼───────────────┤ > > │ 5 │ 75% │ Big │ 984 │ 3124 │ 900 │ 3693 │ -8.5% -84ns │ > > └────────┴─────────────┴───────┴────────┴───────┴───────┴───────┴───────────────┘ > > Thanks for that. Do you have the stddev handy? I do, it shows that the distribution is quite wide. I also have a 95% confidence interval, as follow: w/o LUT W/ LUT Mean std Mean std Phase0: 10791+/-79 2262 10657+/-71 2240 [1] Phase1: 2924 +/-19 529 2894 +/-16 513 [1] Phase2: 2207 +/-19 535 2162 +/-17 515 Phase3: 1897 +/-18 504 1864 +/-17 515 [1] Phase4: Mid CPU 1700 +/-46 463 1609 +/-26 458 Phase4: Big CPU 1187 +/-15 407 1129 +/-15 385 Phase5: 987 +/-14 395 900 +/-12 365 [1] I included these results originally as the p-value for the test I used showed we can reject confidently the null hypothesis that the 2 samples are coming from the same distribution... However, the confidence intervals for the mean overlaps. It is then complicated to conclude for those phases. Interestingly it shows the distribution is slightly more narrow with the LUT. I suppose due to the fact the LUT is less relying on caches than the original table walk is. > > > Notice: > > > > * The CPU column describes which CPU ran the find_energy_efficient() > > function. > > > > * I modified my patch so that no inefficient OPPs are reported. This is to > > have a fairer comparison between the original table walk and the lookup > > table. > > You mean to avoid the impact of the frequency selection itself? Maybe > pinning the frequencies in the cpufreq policy could do? Yes, it could have worked too, maybe it would have even been better, as it would have removed the running frequency variations. > > > > > * I removed from the table results that didn't have enough count to be > > statistically significant. > > > Anyways, this looks like a small but consistent gain throughout, so it's a > win for the LUT :) > > Thanks, > Quentin