Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp624986ybb; Wed, 8 Apr 2020 06:48:32 -0700 (PDT) X-Google-Smtp-Source: APiQypL3Fr65nkiiIby6tn+cYix/cnglOdUk55otPVkkd08imhf0fPN5yNEdKK4slEh2pQ2g5IQ3 X-Received: by 2002:aca:5643:: with SMTP id k64mr2034844oib.152.1586353712617; Wed, 08 Apr 2020 06:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586353712; cv=none; d=google.com; s=arc-20160816; b=x5Fv6PvMX4PmetoWRAhPbRY4Caeg8gCde/yRQ5XMSrVhPiJuzmD9yRjznGRzrefi+D FPzobFqob6uD7NNVgaHek0t0lK7H4u3v5BRL+ZE+OGDHqHOg5nwh+CYyTDstpZlPCUS3 xQTnMIGsuG6FdZHFTcuUGYfHodueGbPyrVzfBSDuZKF0S8ziBxm3VzWCGk1EpJ5QvAdh mfiZHBOegfHua5KXc/3RlJlzxReXa8dIYkRpqVFmU2XIPnLPchKaZLlqxw5In/7plF2r xdnDuxRGozlSc7Ry2WXe7FM/m1mDOYkezERqoXUfkqa8QlrANxtbU8fvLKdTK/NcK3Up 5/zg== 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=wUUHFLpcZs9xF7k9blxqDI06yQyRgUxdZja4IoNTVRM=; b=i7VZPXojkj2ynh+neIMFt6YsAEwSacUATx050OVMgDHljObKn8d51QiYg6MSD+i1F3 hvdrKjFpyxiN8HVA4NyYGxlNGDd60JebBMbVtrbXxfECTa26byx6N7tYFqT3MAWiAWOI JqlRaLWCYpeXaJuwXx68mEt3Aw8fciR++j05CghoERzJZIJlmRz/rcKViJRa17Ywsm0A IiymujNiFySgFMuJ8+9Li8XzDdcyyycb6loRyHWJSgnEmSDTy8cSuLf1ceuI2Y9MCM88 9mmmF4SNZkBhwdkHQDvs9dxqNehYFEqBQWPlbmCmeMnsro+vCQnPIGXhBIFL2F2HXGU7 ZBFg== 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 193si2446584oie.51.2020.04.08.06.48.18; Wed, 08 Apr 2020 06:48:32 -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 S1728501AbgDHM0L (ORCPT + 99 others); Wed, 8 Apr 2020 08:26:11 -0400 Received: from foss.arm.com ([217.140.110.172]:38238 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727070AbgDHM0L (ORCPT ); Wed, 8 Apr 2020 08:26:11 -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 B257431B; Wed, 8 Apr 2020 05:26:10 -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 06CF03F73D; Wed, 8 Apr 2020 05:26:06 -0700 (PDT) Subject: Re: [PATCH 2/4] sched/deadline: Improve admission control for asymmetric CPU capacities To: Valentin Schneider Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Steven Rostedt , Luca Abeni , Daniel Bristot de Oliveira , Wei Wang , Quentin Perret , Alessio Balsini , Pavan Kondeti , Patrick Bellasi , Morten Rasmussen , Qais Yousef , linux-kernel@vger.kernel.org References: <20200408095012.3819-1-dietmar.eggemann@arm.com> <20200408095012.3819-3-dietmar.eggemann@arm.com> From: Dietmar Eggemann Message-ID: <740e5992-a5d6-9b8a-33c8-fffb7e2785b8@arm.com> Date: Wed, 8 Apr 2020 14:26: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 08.04.20 12:42, Valentin Schneider wrote: > > On 08/04/20 10:50, Dietmar Eggemann wrote: >> +++ b/kernel/sched/sched.h >> @@ -304,11 +304,14 @@ void __dl_add(struct dl_bw *dl_b, u64 tsk_bw, int cpus) >> __dl_update(dl_b, -((s32)tsk_bw / cpus)); >> } >> >> +static inline unsigned long rd_capacity(int cpu); >> + >> static inline >> -bool __dl_overflow(struct dl_bw *dl_b, int cpus, u64 old_bw, u64 new_bw) >> +bool __dl_overflow(struct dl_bw *dl_b, int cpu, u64 old_bw, u64 new_bw) >> { >> return dl_b->bw != -1 && >> - dl_b->bw * cpus < dl_b->total_bw - old_bw + new_bw; >> + cap_scale(dl_b->bw, rd_capacity(cpu)) < >> + dl_b->total_bw - old_bw + new_bw; >> } >> > > I don't think this is strictly equivalent to what we have now for the SMP > case. 'cpus' used to come from dl_bw_cpus(), which is an ugly way of > writing > > cpumask_weight(rd->span AND cpu_active_mask); > > The rd->cpu_capacity_orig field you added gets set once per domain rebuild, > so it also happens in sched_cpu_(de)activate() but is separate from > touching cpu_active_mask. AFAICT this mean we can observe a CPU as !active > but still see its capacity_orig accounted in a root_domain. I see what you mean. The int dl_bw_cpus(int i) { ... for_each_cpu_and(i, rd->span, cpu_active_mask) cpus++; ... } should be there to handle the 'rd->span &nsub cpu_active_mask' case. We could use a similar implementation for s/cpus/capacity: unsigned long dl_bw_capacity(int i) { ... for_each_cpu_and(i, rd->span, cpu_active_mask) cap += arch_scale_cpu_capacity(i); ... } [...]