Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6847282ybi; Mon, 8 Jul 2019 09:33:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqximu+4l+YS+rlqpUlrOQJr+Ro7pLsMje8uQdFqr1Fv5itDY0zbxhAJYkc3H2cUn6IJXwT/ X-Received: by 2002:a17:90a:bb01:: with SMTP id u1mr26598187pjr.92.1562603593429; Mon, 08 Jul 2019 09:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562603593; cv=none; d=google.com; s=arc-20160816; b=WMDJiB7EeuZ5068St9+W2tkPZw7wWACoJyhiEzdEuoDYI0NcHDW/WvJgZDrdDFmA8m uVjgOwDKi1Pf1y2VUkAzxY/hM+O63kD3zKD8VgCQbb2cW63K7jynl1i/LRcomwxlM+od 8mupBwC6NKF3IO6W2W7GpCND+pxxBlnKpoNr+636Qdgfhpcycru1vG8J+EVBzwtUnKfx JvvqKpiUKMpa6zhOCX8FRWFJbjdWt7GdcK1fsh9Ajc9krF+cKz0yldr1ABoGgqkNI8zE 58m9Xi87c0XhYHuDzwFEj8ee5kzkeHJWoGtGSKnwF/keXtTMLaBa5868Zt/cN5OamvHr vaVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=04cwyFPxStiRmhQlbn1cLMkVj2V08+e7v3ihr12qPxc=; b=itvcbgxDZGsFUH/GuTneQdS+pPcPwj1LGt/s/dmQN/X0hkTx06PEMlux52ZY5nEWLS z0U4wmIGRvHry5b1QPcinv2TxGHli5qvcSRuKk+eQfsbORO9InEKTUe/AYYNO6VGFbjx WmDBG/nFZZ14zfbD4q67lE/8YVzdE55Zhsvc9CQ6JCFnwi3UuTb9dtDKrIj8Ui+/23hL j163S6EQv91cTc0Dk+UjSRsySCj1WhDE23OmBa8PKgY1+Idhi7WMLPFGPXbsdr2UMZ3a ToREBeDnqjIWgUDqkNK+9zF+8ngeshtm/VRbX1d77OlK5Syy8KpgCq2a1vn9DhH6hBzD 2Kow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m71si100537pjb.26.2019.07.08.09.32.24; Mon, 08 Jul 2019 09:33:13 -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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730455AbfGHLWk (ORCPT + 99 others); Mon, 8 Jul 2019 07:22:40 -0400 Received: from foss.arm.com ([217.140.110.172]:45264 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730444AbfGHLWj (ORCPT ); Mon, 8 Jul 2019 07:22:39 -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 551A2360; Mon, 8 Jul 2019 04:22:39 -0700 (PDT) Received: from [0.0.0.0] (e107985-lin.cambridge.arm.com [10.1.194.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B56EC3F738; Mon, 8 Jul 2019 04:22:36 -0700 (PDT) Subject: Re: [RFC PATCH 1/6] sched/dl: Improve deadline admission control for asymmetric CPU capacities To: luca abeni , Quentin Perret Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Rafael J . Wysocki" , Ingo Molnar , Peter Zijlstra , Vincent Guittot , "Paul E . McKenney" , Joel Fernandes , Luc Van Oostenryck , Morten Rasmussen , Juri Lelli , Daniel Bristot de Oliveira , Patrick Bellasi , Tommaso Cucinotta References: <20190506044836.2914-1-luca.abeni@santannapisa.it> <20190506044836.2914-2-luca.abeni@santannapisa.it> <20190507134850.yreebscc3zigfmtd@queper01-lin> <20190507162523.6a405d48@nowhere> <20190507143125.cjfhdxngcugqmko3@queper01-lin> <20190507164349.2823fdaa@nowhere> From: Dietmar Eggemann Message-ID: <3ddfc5ce-8870-a8d5-265a-462763fb348c@arm.com> Date: Mon, 8 Jul 2019 13:22:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190507164349.2823fdaa@nowhere> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/7/19 4:43 PM, luca abeni wrote: > On Tue, 7 May 2019 15:31:27 +0100 > Quentin Perret wrote: > >> On Tuesday 07 May 2019 at 16:25:23 (+0200), luca abeni wrote: >>> On Tue, 7 May 2019 14:48:52 +0100 >>> Quentin Perret wrote: >>> >>>> Hi Luca, >>>> >>>> On Monday 06 May 2019 at 06:48:31 (+0200), Luca Abeni wrote: [...] >> Right and things moved recently in this area, see bb1fbdd3c3fd >> ("sched/topology, drivers/base/arch_topology: Rebuild the sched_domain >> hierarchy when capacities change") > > Ah, thanks! I missed this change when rebasing the patchset. > I guess this part of the patch has to be updated (and probably became > useless?), then. [...] >>> This achieved the effect of correctly setting up the "rd_capacity" >>> field, but I do not know if there is a better/simpler way to achieve >>> the same result :) >> >> OK, that's really an implementation detail, so no need to worry too >> much about it at the RFC stage I suppose :-) What about we integrate the code to calculate the rd capacity into build_sched_domains() (next to the code to establish the rd max_cpu_capacity)? root@juno:~# cat /sys/devices/system/cpu/cpu*/cpu_capacity 446 1024 1024 446 446 446 root@juno:~# dmesg | grep "rd capacity" /* before CPUfreq max CPU freq calibration */ [ 0.749389] rd span: 0-5 rd capacity: 4360 max cpu_capacity: 1024 /* after CPUfreq max CPU freq calibration */ [ 3.372759] rd span: 0-5 rd capacity: 3832 max cpu_capacity: 1024 /* 2*1024 + 4*446 = 3832 */ root@juno:~# echo 0 > /sys/devices/system/cpu/cpu5/online root@juno:~# dmesg | grep "rd capacity" ... [ 2715.068198] rd span: 0-4 rd capacity: 3386 max cpu_capacity: 1024 root@juno:~# echo 1 > /sys/devices/system/cpu/cpu5/online root@juno:~# dmesg | grep "rd capacity" ... [ 2807.200662] rd span: 0-5 rd capacity: 3832 max cpu_capacity: 1024 --->8--- @@ -768,6 +769,7 @@ struct root_domain { cpumask_var_t rto_mask; struct cpupri cpupri; + unsigned long capacity; unsigned long max_cpu_capacity; /* diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index f751ce0b783e..68acdca27eaf 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -2000,6 +2000,9 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att if (rq->cpu_capacity_orig > READ_ONCE(d.rd->max_cpu_capacity)) WRITE_ONCE(d.rd->max_cpu_capacity, rq->cpu_capacity_orig); + WRITE_ONCE(d.rd->capacity, + READ_ONCE(d.rd->capacity) + rq->cpu_capacity_orig); + cpu_attach_domain(sd, d.rd, i); } rcu_read_unlock(); @@ -2008,8 +2011,9 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att static_branch_enable_cpuslocked(&sched_asym_cpucapacity); if (rq && sched_debug_enabled) { - pr_info("root domain span: %*pbl (max cpu_capacity = %lu)\n", - cpumask_pr_args(cpu_map), rq->rd->max_cpu_capacity); + pr_info("rd span: %*pbl rd capacity: %lu max cpu_capacity: %lu\n", + cpumask_pr_args(cpu_map), rq->rd->capacity, + rq->rd->max_cpu_capacity); }