From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752816AbbIKNVi (ORCPT ); Fri, 11 Sep 2015 09:21:38 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([207.82.80.143]:61586 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752167AbbIKNVh convert rfc822-to-8bit (ORCPT ); Fri, 11 Sep 2015 09:21:37 -0400 Subject: Re: [PATCH 2/6] sched/fair: Convert arch_scale_cpu_capacity() from weak function to #define To: Vincent Guittot References: <1439569394-11974-1-git-send-email-morten.rasmussen@arm.com> <1439569394-11974-3-git-send-email-morten.rasmussen@arm.com> <55E8A65F.2070903@arm.com> Cc: Morten Rasmussen , Peter Zijlstra , "mingo@redhat.com" , Daniel Lezcano , Yuyang Du , Michael Turquette , "rjw@rjwysocki.net" , Juri Lelli , Sai Charan Gurrappadi , "pang.xunlei@zte.com.cn" , linux-kernel From: Dietmar Eggemann Message-ID: <55F2D55C.6040202@arm.com> Date: Fri, 11 Sep 2015 14:21:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: X-OriginalArrivalTime: 11 Sep 2015 13:21:33.0126 (UTC) FILETIME=[C6F8E660:01D0EC94] X-MC-Unique: -5YLaIfcQKmVLOMb_KjPRg-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/09/15 08:26, Vincent Guittot wrote: > On 3 September 2015 at 21:58, Dietmar Eggemann wrote: [...] > So, with the patch below that updates the arm definition of > arch_scale_cpu_capacity, you can add my Acked-by: Vincent Guittot > on this patch and the additional one > below My tests on ARM TC2 (only the 2 A15's) show that the influence of the non-default arch_scale_cpu_capacity function in arch/arm/kernel/topology.c and with it the extra function call to it from __update_load_avg() has no measurable influence on performance: perf stat --null --repeat 10 -- perf bench sched messaging --g 50 -l 200 - default arch_scale_cpu_capacity function [kernel/sched/sched.h] 16.006976251 seconds time elapsed ( +- 0.29% ) 16.063814914 seconds time elapsed ( +- 0.37% ) 16.088199252 seconds time elapsed ( +- 0.39% ) - arch_scale_cpu_capacity function [arch/arm/kernel/topology.c] 15.945975308 seconds time elapsed ( +- 0.10% ) 16.131203074 seconds time elapsed ( +- 0.21% ) 16.108302562 seconds time elapsed ( +- 0.41% ) If I force the function to be inline, the result is slightly worse: - arch_scale_cpu_capacity function [arch/arm/include/asm/topology.h] 16.122545216 seconds time elapsed ( +- 0.09% ) 16.285819258 seconds time elapsed ( +- 0.35% ) 16.157454024 seconds time elapsed ( +- 0.15% ) So I think we can connect the arch_scale_cpu_capacity function [arch/arm/kernel/topology.c] to the CFS scheduler for ARCH=arm so that people get cpu scale different to 1024 on arm big.little machines w/ A15/A7 in case the specify clock-frequency properties in their dtb file. Can we still have your 'Acked-by' for this patch and 3/6 even though we now scale weight (by frequency) and scale_freq (by cpu) instead of the time related values (delta_w, contrib, delta)? Thanks, -- Dietmar > > Regards, > Vincent > >> >> To connect the cpu invariant engine (scale_cpu_capacity() >> [arch/arm/kernel/topology.c]) with the scheduler, something like this is >> missing: >> >> diff --git a/arch/arm/include/asm/topology.h b/arch/arm/include/asm/topology.h >> index 370f7a732900..17c6b3243196 100644 >> --- a/arch/arm/include/asm/topology.h >> +++ b/arch/arm/include/asm/topology.h >> @@ -24,6 +24,10 @@ void init_cpu_topology(void); >> void store_cpu_topology(unsigned int cpuid); >> const struct cpumask *cpu_coregroup_mask(int cpu); >> >> +#define arch_scale_cpu_capacity scale_cpu_capacity >> +struct sched_domain; >> +extern unsigned long scale_cpu_capacity(struct sched_domain *sd, int cpu); >> + >> #else >> >> static inline void init_cpu_topology(void) { } >> diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c >> index 08b7847bf912..907e0d2d9b82 100644 >> --- a/arch/arm/kernel/topology.c >> +++ b/arch/arm/kernel/topology.c >> @@ -42,7 +42,7 @@ >> */ >> static DEFINE_PER_CPU(unsigned long, cpu_scale); >> >> -unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu) >> +unsigned long scale_cpu_capacity(struct sched_domain *sd, int cpu) >> { >> return per_cpu(cpu_scale, cpu); >> } >> @@ -166,7 +166,7 @@ static void update_cpu_capacity(unsigned int cpu) >> set_capacity_scale(cpu, cpu_capacity(cpu) / middle_capacity); >> >> pr_info("CPU%u: update cpu_capacity %lu\n", >> - cpu, arch_scale_cpu_capacity(NULL, cpu)); >> + cpu, scale_cpu_capacity(NULL, cpu)); >> } >> >> -- Dietmar >> >> [...]