Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp471002ybb; Wed, 8 Apr 2020 03:44:09 -0700 (PDT) X-Google-Smtp-Source: APiQypLi8bqY4HK74Z2Q8kkhl/ANK0CK4FpG7JwZ/5TL+ZH8ioiaT4fUV1VhuCppiaJi4k6qIcpQ X-Received: by 2002:a9d:1b31:: with SMTP id l46mr4801074otl.95.1586342649373; Wed, 08 Apr 2020 03:44:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586342649; cv=none; d=google.com; s=arc-20160816; b=hcOyKRGQJXlPl7Nkd7c0BZPpQ7yC7XNRR0q24GB+hNvf4HnBXry0dPr9vvV9Yh7bU8 ztHu1ZWfIewtOoLMSNYgsCrBVTWFBDaJgSY4pqoTYXwlUdf+v4nSqwO4lIv4hp8Hv93N Z1aSpl+9MGDqiCI8rtt+AleI9LDbJ8uz4h+YSYsUVNZi1DVuzS4kBAEOxkxvK1CuYJCd bGSmOQwPAEx4yqkzxWEOMStj/cK/JW4zfuDvCRP2QX8PcdC3bdOES1Qx31980ULQ5DfA axt0475URrGzw/y9ouOti/rkSqr9oqxh6rflisyWQvC4Gh8RDbXenGni8/zrXfH1BY1+ B5QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:date:in-reply-to:message-id :subject:cc:to:from:user-agent:references; bh=LoVPql8+krOszHLrlvMQ2GSzWTUbcQHPthb8OiI6J2k=; b=FY6+zY2rguKQBAXbocqehF1u0jyGmVcDMaY0gH7TvTIQbjk8OVIwGW+6nWm3/Rpm0J q1gkcAi1OUPlZgEFnvr1I5mCJDT1kUl+S2VSXCqA7Ai+tJWYwjnbPoVU1z4a/f8J+ow0 7YvIrAWDgqKi6MU5+7L3HEb18JT30YQkcFxAmtJ9R5bMEAoJEmrC42BJV9JDXZH0Q55t UuavuS5b3cnwvfKFnV4fva0BRYliC8coH9mUV4oxKfDCtTCk6iIoVI5uWFl3nHaDb//P QEtIMGkrxUZEUyDXSdF4eS0HNHRTSIrewDTLi5Czi+VrDd6ozvZBGQWKJc6nDrtlu65C ABjg== 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 i2si1899629oif.204.2020.04.08.03.43.40; Wed, 08 Apr 2020 03:44:09 -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 S1728099AbgDHKmX (ORCPT + 99 others); Wed, 8 Apr 2020 06:42:23 -0400 Received: from foss.arm.com ([217.140.110.172]:36774 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbgDHKmX (ORCPT ); Wed, 8 Apr 2020 06:42:23 -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 75D7931B; Wed, 8 Apr 2020 03:42:22 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 745523F73D; Wed, 8 Apr 2020 03:42:20 -0700 (PDT) References: <20200408095012.3819-1-dietmar.eggemann@arm.com> <20200408095012.3819-3-dietmar.eggemann@arm.com> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: Dietmar Eggemann 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 Subject: Re: [PATCH 2/4] sched/deadline: Improve admission control for asymmetric CPU capacities Message-ID: In-reply-to: <20200408095012.3819-3-dietmar.eggemann@arm.com> Date: Wed, 08 Apr 2020 11:42:14 +0100 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > extern void init_dl_bw(struct dl_bw *dl_b);