Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752758AbcC1Ne7 (ORCPT ); Mon, 28 Mar 2016 09:34:59 -0400 Received: from mail-am1on0063.outbound.protection.outlook.com ([157.56.112.63]:41083 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751969AbcC1Ne4 (ORCPT ); Mon, 28 Mar 2016 09:34:56 -0400 Authentication-Results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=arm.com; Subject: Re: [PATCH 1/2] sched/fair: move cpufreq hook to update_cfs_rq_load_avg() To: Steve Muckle , Peter Zijlstra , Ingo Molnar References: <1458606068-7476-1-git-send-email-smuckle@linaro.org> CC: , , "Rafael J. Wysocki" , Vincent Guittot , Morten Rasmussen , Juri Lelli , Patrick Bellasi , Michael Turquette From: Dietmar Eggemann Message-ID: <56F91D56.4020007@arm.com> Date: Mon, 28 Mar 2016 14:02:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1458606068-7476-1-git-send-email-smuckle@linaro.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131036401533077540;(7f4fb8e1-17aa-4746-8602-08d27e8c8cd0);() X-Forefront-Antispam-Report: CIP:217.140.96.140;IPV:NLI;CTRY:GB;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(24454002)(377454003)(199003)(189002)(11100500001)(15650500001)(586003)(5008740100001)(83506001)(36756003)(6806005)(106466001)(104016004)(4326007)(50986999)(54356999)(76176999)(86362001)(2906002)(87266999)(33656002)(1220700001)(1096002)(5001770100001)(4001350100001)(47776003)(65816999)(65806001)(65956001)(189998001)(92566002)(50466002)(23746002)(19580405001)(64126003)(77096005)(230700001)(2950100001)(87936001)(19580395003)(59896002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB4PR07MB0606;H:nebula.arm.com;FPR:;SPF:Pass;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;AM1FFO11FD035;1:lBNMU/Eql28fZPYM4vniPFF7pJ41YiSBSNqoDEA0BSd7ZheMIPLAqh8eEJjZOrrjTLDuBy447sZHmxz1LBDypONbV4sIUdeHwpmq4gpCLFYk1nU4SNJpzXEwO1uN5EeesEokMBvdkfXKtpFDq0AaGNoRWYDqZUQXEhV1y5w1zhqWiucng2+ghH33EcblWwGqFuaGNtU7maQjXhJKB+ok9OXQAFg3ZrQBFQYDFqj0W55EEIS2WCbWQi5/4q2X2VRWZeH+GINgQtVD3StzgQob9SOp5Kz2qsN+qJbQI9R7niNM04MJ7GtsQhXnlL5dYScB4O3Qka1bspV+gXjBxMLEGOZZMAP5NQxK6+fY2FVAhh3Tskx79kw3kRafMxKqJVttRWea5x7DH0dtggwEW00O0L753WkuU+ymeyQKNmEHhbD36q88ZBkNS7QsdNfripvsJKIUtYOfrEe02I5TsRIjj5In5+QPSpyp+YRkVo3+WOWMYkHMIZL0wfRbxJcjdjJFrtX7dNgIMaXpb/KlKg+9lgbv7bBAli83xFmMHISqT64= X-MS-Office365-Filtering-Correlation-Id: 6a06fbfd-d7a5-4c06-4824-08d35700d87d X-Microsoft-Exchange-Diagnostics: 1;DB4PR07MB0606;2:mmJsMc9oSmqfJ3V3OEr4fxwyqw6jY6e4LkAPMR2zMIWZvs7Qd2XowTz98Wsr88NMhIkUKx3ItCEzsov68aE/Uhq35Lhztz3wK4sSeg79GyCiYbQxwiGNSYCxYVuqusZbap9kdF0Xjl9hlvzbm6wdSSVgmeRNKtECQVFJ+rr5J8FXPaP3CtRxuVxBy5wAz9an;3:pipSMVGzOaBrR6dpmGoj0+kyjP3sXaDGhG3D6g6Hc08g/wbRr21UKG2Wa16GhJpR8OqDXZP8/uPR6JKVh3n3JO6vh0eJy7Fq/DvIPz2joo+YjVYoV+bTde4CXIiqvKtaFI2F/N+im8C9TX7XmJvJSUBfMABic9J0kYj7m33iuZEJ5YLDS5KSk7xowSPyqurh2BADbVqF3rcZ5vP+8xEtgwlvtveXkxAfGNL6eDeFc/2w//nmRLTm1Lct3rKpKsxUhE86le7PVZS77XNJvWKVsQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501002);SRVR:DB4PR07MB0606; X-Microsoft-Exchange-Diagnostics: 1;DB4PR07MB0606;25:seZ4qQO9dis0lbJl4EwIxEcm8m1vx7AmPlqLqZ1QPo9VoOJYXlYsbLB37XKzmOlXYZw/mZGA5yt6PVBPN0BvK44Q2XKBCCbaxJxtSFv5EW3yCfxOE9QwatInRUMZ+m/VZ77p52+fodsDhwiuadNxnEZeroKlDArd6AkHaYnmf3muLfd9btdfebuuMNS82Ma0FcKhcA/RsfaKqw6Ysna83nCGmG3C2+8y+eWPdztTP7ZOM9pSJzL5xo8BjWOWN2IqF3rlXIRth9iIeb64B5njH70T5Tnt/dB14oxwxIWQXo1deeP4xLTYEEynPq5ozsAy+0LHp4j1XQLDvkiWSMYvRWmSpAAXNhtc1JA8pDD7PfUj4KaSDh7rh8BVBFrxz8w6OXkA5dHZU6z0lmUX2fKblfUKdRe8QKrARQZBXWvGpXJmdutOJ1Mxu+b6SQF5NNjb/LwaBRSNPe/jzgCTqiop8uWZZA/BkPkgR5OAu5KMhTVd1+2r3hjgK7Zd1k5PtbMnL54tMWuQLokxpMAJfb3o4F+uxnPCgnCt9YnOAqxx+mQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(13018025)(13023025)(13016025)(8121501046)(13024025)(10201501046)(3002001);SRVR:DB4PR07MB0606;BCL:0;PCL:0;RULEID:(400006);SRVR:DB4PR07MB0606; X-Microsoft-Exchange-Diagnostics: 1;DB4PR07MB0606;4:+bWAqzSLe/ZmW+7wLpETvF/YL/k6ULeGtiX/++ncomeI5Xb+FOgeqzAq20YuIAODliczH9wiKbqpdXxA/3BAlUgf+vTf8CmDJO+cgjMJwQjMSYR/D3M0UEN5+q11eNK8UmkB2/8RurYlYAOIM/hQHO9QBr/+XUui02rDfWDlMQm82MLBVnm/eNkqGpyQlxgOlFSW21aJfbX1TknI8K785PeVyXoq7VttjvnLeLff5Nai9E8OKSOd6Kq867jhojx8DwYdL4mFC8oevXQjH4rQI8Mpp49/EvaKUCas+jBEi75mF+WQipoxN2rgrHcZKK8iyAUpmqNnsFDrL5VM8v+/mt7agIf7Ts4ep2LHM+7nIIoPF3y5DwPNRSaLoZpT3B7PFzltP3pFN+hpYcPp29fAeY90OCRyp1uKJcx4G9ucZr+ROx2XZgRmsrJQlHzotAJW X-Forefront-PRVS: 0895DF8FFD X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;DB4PR07MB0606;23:pqSjHjnlaXXULRO96SIGz/qzYj6DS64UtRuMl?= =?Windows-1252?Q?GhW4qEUs9/2c20lz3wsOZJB/LWTMuaCm5FatJshex11VaCcaBDqGSxkb?= =?Windows-1252?Q?6YpPE/1/eSyNSNbP/q3GeJ7Blxbl4xAlS5j95b/tz6eWNwGyewMS4X5x?= =?Windows-1252?Q?X8xpHkUWYzQRkVsdJ8ToTNBliDI/QvUeD3pMFtsafy+zxxFz2CgiuKYW?= =?Windows-1252?Q?B2ySYtDK1BdTbDb2hElD75Oa1RoZMyOqDpfKqMZqL+m+XoVq98lNC6as?= =?Windows-1252?Q?AEnOwDpGdFbnN1t3um45gPJMEw8ty7XHl2TuXRsO4cp8DIWY+sAVb5Gx?= =?Windows-1252?Q?ZLjRu3RA9PGEWNs+OT3KFyd5DRb5E2fJk9yJsD+5Jz0GN9ZXHtdLCO5g?= =?Windows-1252?Q?Ke6FoAkI7hXvM2mV/XRgb+RNLf0og0akHQ0OGPQCDs9S4LoMkhHucL3o?= =?Windows-1252?Q?+rZats3ISNWBRUkQcU/7EBYpXHb8ZwAh8tDa7zwMtjRyoRQct1SM+rK6?= =?Windows-1252?Q?OpdTAU9+Vb7dGO1MqKPDLNfeqIacw8xoVmWvuV5NqjCQSP8t+fCdZ+CV?= =?Windows-1252?Q?pTMvJCb6t+EHxKiqfs3gFiEYXpGbfPIAof1RkxqZYsZch36GI30hO6Me?= =?Windows-1252?Q?Q1TYLhly2yc1vKKXtw+pJYJETIlDHTZ1aEavn/1nwsVR0Qyn73ZSbtTW?= =?Windows-1252?Q?6UnvQ0fR1vIjz+sAZjDY94nuKZ4S4nFhD9e7tDVZrR2mpBxR/WiBDm/U?= =?Windows-1252?Q?x+Ml5Iftg8/6IUwkAFdFNqoPz+urVOxmruNNopc1rB74taw0Bf34f1IT?= =?Windows-1252?Q?JSMCv7mZb0Eh3f2G4+QQPTW7cN32st1BotoeDK6jOeZ9QKRtsCnZ2SK0?= =?Windows-1252?Q?ek7U4q57+BJ14HbHXC2dWJr5C/3sJ2slPASfK51G0QimPOqrAgUEiBJH?= =?Windows-1252?Q?SMliu9S8HZvkjhcpSmVBbKUXdetmgOGv1GBPsZ6ahjqCLvIAnWwAjua1?= =?Windows-1252?Q?zH7OIfElOh4SNLdjX3vprAibwGEuFdMz+UoXxUJD5NX33oO/EZbuXB5x?= =?Windows-1252?Q?vuT+7+QbvdefQjUxK/0Xvlgll0ySUfZv/QB5ues2d1y068y/Jmn9lLXt?= =?Windows-1252?Q?tsXSEAHxaYGKNaFnRVW3lrT9RxGLjKr+XhSfZ3puFC+hSaiC9fLWPFSF?= =?Windows-1252?Q?dt6LZkXrRsBPuq3yzwFJp+2mhtoyDPNMe+FWHaNyBRgnGD4Emkx?= X-Microsoft-Exchange-Diagnostics: 1;DB4PR07MB0606;5:OdkxCe0zBIpxbEuF08G8u8v3lRD6pJBqPvvllElUk17kEi7AFFAxekKxO/dtBPL1+QXKxdY6GP8494dAD+iy66U1x5NNW/FEXRRmvKufi8hN3+UpVtFDDbn2VpDy4UQjN4e5IKThRyAhPP1rk9uAuM4/tpWbNI/lOvAEZriPpPI=;24:XeilJa5BjweAvB2Z3oIMvzMkxWJuIBs5oPiIvLoXUOT3DNte9iR2lcp/ZyIOpp/uV3IKPkfEye0MWBqVWbHvPNBAegKfGYjjKDKI1GppvUw= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2016 12:02:33.0581 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[217.140.96.140];Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR07MB0606 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2237 Lines: 53 Hi Steve, these patches fall into the bucket of 'optimization of updating the value only if the root cfs_rq util has changed' as discussed in '[PATCH 5/8] sched/cpufreq: pass sched class into cpufreq_update_util' of Mike T's current series '[PATCH 0/8] schedutil enhancements', right? I wonder if it makes sense to apply them before a proper 'capacity vote aggregation from CFS/RT/DL' has been agreed upon? Otherwise I agree with the changes in your 3 patches (inc. "[RFC PATCH] sched/fair: call cpufreq hook in additional paths") to only invoke cpufreq_update_util() if &rq->cfs.avg.util_avg has really changed. On 03/22/2016 01:21 AM, Steve Muckle wrote: > The cpufreq hook should be called whenever the root cfs_rq > utilization changes so update_cfs_rq_load_avg() is a better > place for it. The current location is not invoked in the > enqueue_entity() or update_blocked_averages() paths. > > Suggested-by: Vincent Guittot > Signed-off-by: Steve Muckle > --- > kernel/sched/fair.c | 50 ++++++++++++++++++++++++++------------------------ > 1 file changed, 26 insertions(+), 24 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 46d64e4ccfde..d418deb04049 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -2825,7 +2825,9 @@ static inline u64 cfs_rq_clock_task(struct cfs_rq *cfs_rq); > static inline int update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq) > { > struct sched_avg *sa = &cfs_rq->avg; > + struct rq *rq = rq_of(cfs_rq); > int decayed, removed = 0; > + int cpu = cpu_of(rq); > > if (atomic_long_read(&cfs_rq->removed_load_avg)) { > s64 r = atomic_long_xchg(&cfs_rq->removed_load_avg, 0); > @@ -2840,7 +2842,7 @@ static inline int update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq) > sa->util_sum = max_t(s32, sa->util_sum - r * LOAD_AVG_MAX, 0); > } > > - decayed = __update_load_avg(now, cpu_of(rq_of(cfs_rq)), sa, > + decayed = __update_load_avg(now, cpu, sa, > scale_load_down(cfs_rq->load.weight), cfs_rq->curr != NULL, cfs_rq); Why did you change these 3 lines above? You reverted this back in "[RFC PATCH] sched/fair: call cpufreq hook in additional paths". [...]