From patchwork Thu Sep 3 19:58:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 53052 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id EA11F22E23 for ; Thu, 3 Sep 2015 19:58:33 +0000 (UTC) Received: by lagj9 with SMTP id j9sf116488lag.0 for ; Thu, 03 Sep 2015 12:58:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:subject:to:references:cc:from :message-id:date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=cjOc1Bay422cX/YVsh+3KLw6ruvmRixyrFV+jP0muKU=; b=I/Pb5jkar/nj6+SLgpWuRceDoOlVM8Zhw/QjoyxrDS8x55ENKx4aYgBuNAXtInA0mz SFxrXveBHnAY90CvEm39h8jQ5rQ3SpMzORdewc65pE61cPDZ6r2v961ByjezuZfXr8dc 7qkGU6mka29ZCBdJqw6gJWDML62TXQ9FIEqTZi80WxGh2zNjt0fZuWugT60vYDYw1IP8 L6RvsIqhfJAsPlW4PgQp172uSkKRSJSTrHR4I0Ug10vGqTRmvAhgxeTn1aECVD5uFDj4 jAXIdpJij1UQZjdOTvAQF6CzteBaLZtk6b6iv4Tx6a7r2oxSOpHubpau91OQbbLzgvAA FiZg== X-Gm-Message-State: ALoCoQmYQVtspgJSRzEsAGOvoQYsl5lP/ZDQt6n2EMHuBagiVXRIc9AXt4CQLoQ2aMhYbVc+pI++ X-Received: by 10.112.189.105 with SMTP id gh9mr11236459lbc.16.1441310312571; Thu, 03 Sep 2015 12:58:32 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.103 with SMTP id l7ls261879laf.35.gmail; Thu, 03 Sep 2015 12:58:32 -0700 (PDT) X-Received: by 10.152.23.103 with SMTP id l7mr23888421laf.50.1441310312353; Thu, 03 Sep 2015 12:58:32 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id b2si24121532laa.31.2015.09.03.12.58.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Sep 2015 12:58:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by lamp12 with SMTP id p12so245017lam.0 for ; Thu, 03 Sep 2015 12:58:32 -0700 (PDT) X-Received: by 10.152.43.198 with SMTP id y6mr15167009lal.41.1441310312149; Thu, 03 Sep 2015 12:58:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.164.42 with SMTP id yn10csp1491096lbb; Thu, 3 Sep 2015 12:58:31 -0700 (PDT) X-Received: by 10.68.200.40 with SMTP id jp8mr73419792pbc.16.1441310310949; Thu, 03 Sep 2015 12:58:30 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wq1si43117980pbc.98.2015.09.03.12.58.30; Thu, 03 Sep 2015 12:58:30 -0700 (PDT) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757396AbbICT62 (ORCPT + 28 others); Thu, 3 Sep 2015 15:58:28 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([146.101.78.143]:11949 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751699AbbICT60 convert rfc822-to-8bit (ORCPT ); Thu, 3 Sep 2015 15:58:26 -0400 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-15-CoaSrxcMT0ir8c3OC0JbEg-1; Thu, 03 Sep 2015 20:58:24 +0100 Received: from [10.2.131.51] ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 3 Sep 2015 20:58:23 +0100 Subject: Re: [PATCH 2/6] sched/fair: Convert arch_scale_cpu_capacity() from weak function to #define To: Vincent Guittot , Morten Rasmussen References: <1439569394-11974-1-git-send-email-morten.rasmussen@arm.com> <1439569394-11974-3-git-send-email-morten.rasmussen@arm.com> Cc: 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: <55E8A65F.2070903@arm.com> Date: Thu, 3 Sep 2015 20:58:23 +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: 03 Sep 2015 19:58:23.0193 (UTC) FILETIME=[E392CC90:01D0E682] X-MC-Unique: CoaSrxcMT0ir8c3OC0JbEg-1 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: dietmar.eggemann@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Hi Vincent, On 02/09/15 10:31, Vincent Guittot wrote: > Hi Morten, > > On 14 August 2015 at 18:23, Morten Rasmussen wrote: >> Bring arch_scale_cpu_capacity() in line with the recent change of its >> arch_scale_freq_capacity() sibling in commit dfbca41f3479 ("sched: >> Optimize freq invariant accounting") from weak function to #define to >> allow inlining of the function. >> >> While at it, remove the ARCH_CAPACITY sched_feature as well. With the >> change to #define there isn't a straightforward way to allow runtime >> switch between an arch implementation and the default implementation of >> arch_scale_cpu_capacity() using sched_feature. The default was to use >> the arch-specific implementation, but only the arm architecture provides >> one and that is essentially equivalent to the default implementation. [...] > > So you change the way to declare arch_scale_cpu_capacity but i don't > see the update of the arm arch which declare a > arch_scale_cpu_capacity to reflect this change in your series. We were reluctant to do this because this functionality makes only sense for ARCH=arm big.Little systems w/ cortex-a{15|7} cores and only if the clock-frequency property is set in the dts file. Are you planning to push for a 'struct cpu_efficiency/clock-frequency property' solution for ARCH=arm64 as well? I'm asking because for ARCH=arm64 systems today (JUNO, Hi6220) we use the capacity value of the last entry of the capacity_state vector for the cores (e.g. cortex-a{57|53). To connect the cpu invariant engine (scale_cpu_capacity() [arch/arm/kernel/topology.c]) with the scheduler, something like this is missing: [...] --- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ 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