Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp767510ybb; Wed, 8 Apr 2020 09:29:45 -0700 (PDT) X-Google-Smtp-Source: APiQypKMqLGZYxR5tCqSN0zVFO9TNNLhkPos0GhB9yAae8vfmGv/1Eea8omJhKKgUfeC6WryMxvC X-Received: by 2002:a05:6830:1bda:: with SMTP id v26mr4210125ota.259.1586363385664; Wed, 08 Apr 2020 09:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586363385; cv=none; d=google.com; s=arc-20160816; b=WHIuXcLk6glyKH2ky6jqm03u5mIxC+jFDE+zn2Ygc/dysdBRZLu2/4HVtAG4PMbprO dzbxlg7pOoYQd2APoLnhihLIm3cceVTRHqSxFHoEPFI5+35M4uUnPl+AbgAQkluoQsIT XVxftKE2VqQNjcqtEvGUI01CeMlq18hrHLU3YGpn6evKQi/YcvAfCP9lvDyz1d3oeq/5 dYj7JOXxN0H2h0FJV5EEotfFJjJcrINIn0CmUsMpcmCslvVh97vSgQFo7Dt5l6TTdbo1 6RM1A4ml9/RfCvsJIjSuMZIRMF5DZO5kG2xUav4Gb3eCmZtKdrk4ve20O1mxkhHqjHaS NuHQ== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=FuguizMF+5SLRIPsE3Jrk0ATkE8K98YSgJqXB1Ra+AA=; b=rAhDfbW84B5TVIcCsWGOxTSuInvyG7JabxAIjvEk0KDQLmaNxzBWIFwNhPZzlurIfD 0gJ/ls0elSWK1os915q4rZX68fVAKWxglnKAMNtsPV6b9w42cnjB+QovTkV/nWFT/dmA g+o/0Mu2NfZKm9ctfu8T5J5fokQKYaCtelmM/E+7dux6PrYsH2zQmm8hwWl3ZU7+TH4F iuQwjnCbGh1Mw82b+UoFpvh2fySg6cXcncDxKtAnPjEZDVBJRgTuVnN7fh2ATrPb88+N kG3tFZzhr4W1r0fU8aO6fouQDoZTgw6Fw1RjKUe1J6X3aEwmrCTXKRLkX4bh4dneCBCk kw+w== 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 i22si413340ots.37.2020.04.08.09.29.31; Wed, 08 Apr 2020 09:29:45 -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 S1728782AbgDHOax (ORCPT + 99 others); Wed, 8 Apr 2020 10:30:53 -0400 Received: from mail.santannapisa.it ([193.205.80.98]:18167 "EHLO mail.santannapisa.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726774AbgDHOax (ORCPT ); Wed, 8 Apr 2020 10:30:53 -0400 X-Greylist: delayed 3600 seconds by postgrey-1.27 at vger.kernel.org; Wed, 08 Apr 2020 10:30:52 EDT Received: from [151.41.75.232] (account l.abeni@santannapisa.it HELO nowhere) by santannapisa.it (CommuniGate Pro SMTP 6.1.11) with ESMTPSA id 147238791; Wed, 08 Apr 2020 15:30:48 +0200 Date: Wed, 8 Apr 2020 15:30:32 +0200 From: luca abeni To: Valentin Schneider Cc: Dietmar Eggemann , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Steven Rostedt , 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: <20200408153032.447e098d@nowhere> In-Reply-To: References: <20200408095012.3819-1-dietmar.eggemann@arm.com> <20200408095012.3819-3-dietmar.eggemann@arm.com> Organization: Scuola Superiore S.Anna X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Valentin, On Wed, 08 Apr 2020 11:42:14 +0100 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. Sorry, I suspect this is my fault, because the bug comes from my original patch. When I wrote the original code, I believed that when a CPU is deactivated it is also removed from its root domain. I now see that I was wrong. Luca