Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp469601ybz; Wed, 15 Apr 2020 12:12:14 -0700 (PDT) X-Google-Smtp-Source: APiQypJQOAmp9FOCWf9cOv1XYYyGUwi1VBcug0BGDUNyi0dQPGf0/E+N9UZAmkynGDGE3m80AHa3 X-Received: by 2002:aa7:cdce:: with SMTP id h14mr18701548edw.51.1586977934323; Wed, 15 Apr 2020 12:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586977934; cv=none; d=google.com; s=arc-20160816; b=UPMpTnLD71o6BWp5grM95Bso9ORT/AiiFc0QHUm7chprJp1eaGYcxP7b64LQzIityM 27m/QsU80r3xuaeHmtKGUoyrpVYstrtt5eANcxoLwP6jCryPE7gi+i8YIIJNI6IJg7Wl yjyuNSbi7mJvQd+ra9ghIYdFry8G1pUW2W9hXE2MrZKrwXE59cy4S48icQ1VTl9zFbn5 N5YD/+G1aDjoEr+yh94xBw9V6PwOF0v3uvh/R1v07kwtOiJBE82xyJPyhoxZl+kJDDCW eCSnlhRMaCper0g8MKFTZVMvnRvHypDXqkWI0C5+/vlu9gMqgiEqWLgaWF2ZmX9rT92z NYXw== 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=IcdTk5PZvUMKgOE8lnRRvmJZEJrTEy2unJXIz0YfdGs=; b=owwn8c89H/y7IZns53PNCYllg+IO6suK2im6IOmFmXlVrtruUKBe1DSfWyBJzmTC7i VTc9MYTexGuXsGOO7Hobpbdn1qKGEZzJPZL7yQRDcWJleSpKLGsfGVz6b6fQbgzmKgY0 WZv25QUiQY1cwO6dDCcVmuORBupwFYh9/SEEey1iUoGobI3XnFVh/eWL269ksB8KRDhL mjKkjP7qW4VTOMcV3b/mxGCONYkRLYx0yUs1cbgFI5h/qJajAgAD1XsdNdQ2z96vtX5a DS/IKHsCvWePMECTNww/3BgvC/UlH+gvtYSqilXG2TW9bn5AWwyeSBGIs0SqEwI6rRmI fgpw== 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 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m28si6254061eda.183.2020.04.15.12.11.49; Wed, 15 Apr 2020 12:12:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437566AbgDNJUN (ORCPT + 99 others); Tue, 14 Apr 2020 05:20:13 -0400 Received: from foss.arm.com ([217.140.110.172]:51518 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728324AbgDNJUK (ORCPT ); Tue, 14 Apr 2020 05:20:10 -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 E3E6C1FB; Tue, 14 Apr 2020 02:20:09 -0700 (PDT) Received: from [192.168.1.19] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 28B823F6C4; Tue, 14 Apr 2020 02:20:07 -0700 (PDT) Subject: Re: [PATCH 1/4] sched/topology: Store root domain CPU capacity sum To: Vincent Guittot Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Steven Rostedt , Luca Abeni , Daniel Bristot de Oliveira , Wei Wang , Quentin Perret , Alessio Balsini , Pavan Kondeti , Patrick Bellasi , Morten Rasmussen , Valentin Schneider , Qais Yousef , linux-kernel References: <20200408095012.3819-1-dietmar.eggemann@arm.com> <20200408095012.3819-2-dietmar.eggemann@arm.com> <42cc3878-4c57-96ba-3ebd-1b4d4ef87fae@arm.com> From: Dietmar Eggemann Message-ID: Date: Tue, 14 Apr 2020 11:20:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09.04.20 16:13, Vincent Guittot wrote: > On Thu, 9 Apr 2020 at 15:50, Dietmar Eggemann wrote: >> >> On 08.04.20 19:03, Vincent Guittot wrote: >>> On Wed, 8 Apr 2020 at 18:31, Dietmar Eggemann wrote: >>>> >>>> On 08.04.20 14:29, Vincent Guittot wrote: >>>>> On Wed, 8 Apr 2020 at 11:50, Dietmar Eggemann wrote: [...] >> And it looks like that asym_cpu_capacity_level() [topology.c] would fail >> if we would use capacity_orig_of() instead of arch_scale_cpu_capacity(). > > Yes I agree. See below > >> post_init_entity_util_avg() [fair.c] and sugov_get_util() >> [cpufreq_schedutil.c] would be temporarily off until >> update_cpu_capacity() has updated cpu_rq(cpu)->cpu_capacity_orig. > > I think that we could even get rid of this update in > update_cpu_capacity(). cpu_capacity_orig should be set while building > the sched_domain topology because the topology itself is built based > on this max cpu capacity with asym_cpu_capacity_level(). So changing > the capacity without rebuilding the domain could break the > sched_domain topology correctness. True. rq->cpu_capacity_orig could be set early in build_sched_domains(), before the call to asym_cpu_capacity_level() or within this function. > And we can't really set cpu_capacity_orig earlier during the boot > because the capacity of b.L is set late during the boot and a rebuild > of the sched_domain topology is then triggered. > >> >> compute_energy() [fair.c] is guarded by sched_energy_enabled() from >> being used at startup. >> >> scale_rt_capacity() could be changed in case we call it after the >> cpu_rq(cpu)->cpu_capacity_orig = arch_scale_cpu_capacity(cpu) in >> update_cpu_capacity(). > > With the removal of the update in update_cpu_capacity(), we don't have > a problem anymore, isn't it ? True. >> The Energy Model (and CPUfreq cooling) code would need >> capacity_orig_of() exported. arch_scale_cpu_capacity() currently is >> exported via include/linux/sched/topology.h. > > Not sure that we need to export it outside scheduler, they can still > use arch_scale_cpu_capacity() OK, let's change this for the task scheduler only. >> I guess Pelt and 'scale invariant Deadline bandwidth enforcement' should >> continue using arch_scale_cpu_capacity() in sync with >> arch_scale_freq_capacity(). > > Why can't they use capacity_orig_of ? > we keep using arch_scale_freq_capacity() because it's dynamic but we > don't really need to keep using arch_scale_cpu_capacity() OK, Pelt is task scheduler so it can be changed here as well. I'm going to create a patch following these ideas. [...]