Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4724746yba; Wed, 8 May 2019 01:29:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoPq+z4Iq3OV2PeXEb0Ebi4XC6YPtn+fiRLHL+GqAnxSR1Fan96leUz2AHJAjZoheCFLAv X-Received: by 2002:aa7:99dd:: with SMTP id v29mr48389613pfi.252.1557304174469; Wed, 08 May 2019 01:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557304174; cv=none; d=google.com; s=arc-20160816; b=OrcSW3ZS1mPdQq3aQjFE1DRPK3HyFxMfRbXea2XjM7TPdaa9hQyOHMMa9THwi8GMfc w9Bl94DatgNohkSkYlO5SkYVvG9IgQQFE6yLtSI4PtuLTIslR+j2CFyUGQCrruMXlAEL d64bxRXPyss6ox4pHAAXnACUIesD0Vs2Y4+8y0buaM86+yONkxPBhmob4ol8tMqiaZnt iP6/RrqjOdGkYi2sL7jioD4kcOh/YToBCnv3uY/K1u5ag/pFII4zDeuFHuWVgfeHb4Eh A2hhe+uIq/hYZJrIpn2GXjXhSgYzzKs6jRNrYw7NgZYkb2a8BhbzPKpHNv0AWVYkzwxC gR/g== 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=p3M6VpCOo+8zhmclCcaBvwy7A+sCaCq6V5BAT0dJWiM=; b=bKAah6W15i0oLs2o4DpRd8+LbnQx5uISGOoRRq7/9Doli/MmsDRUJfMDDqK1HtUfRP rY3i+BCAgw/7LWL1H1jaE16d0q/ca0D0itUxwnYkvTr+eLzj/dpYspxsiCXUkhHT3vMH EzCsITtHncZYMKOsZwQuKO/uCj6LfbOJaqWnJ/ypFSlGcoUbfPo4ADZE7P5objM3HblR LPEDndbnIr3pF1iBWNqSFpPIjxD9xkQV/3dwwxVNqdaCJ1H/9tlw2MWuBR6CvhWk1Pq9 i4OdRBiPCzgSe2xTOo7Et8HLYBBx2x+shJP3rhPCOJr5y9PQsRYyPXmWJb8yVnGK6UcD zqoA== 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 d197si11078047pga.110.2019.05.08.01.29.18; Wed, 08 May 2019 01:29:34 -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 S1726992AbfEHISG (ORCPT + 99 others); Wed, 8 May 2019 04:18:06 -0400 Received: from mail.sssup.it ([193.205.80.98]:27196 "EHLO mail.santannapisa.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725778AbfEHISG (ORCPT ); Wed, 8 May 2019 04:18:06 -0400 Received: from [83.43.182.198] (account l.abeni@santannapisa.it HELO nowhere) by santannapisa.it (CommuniGate Pro SMTP 6.1.11) with ESMTPSA id 138918824; Wed, 08 May 2019 10:18:03 +0200 Date: Wed, 8 May 2019 10:17:57 +0200 From: luca abeni To: Juri Lelli Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Rafael J . Wysocki" , Ingo Molnar , Peter Zijlstra , Vincent Guittot , "Paul E . McKenney" , Joel Fernandes , Quentin Perret , Luc Van Oostenryck , Morten Rasmussen , Daniel Bristot de Oliveira , Patrick Bellasi , Tommaso Cucinotta Subject: Re: [RFC PATCH 2/6] sched/dl: Capacity-aware migrations Message-ID: <20190508101757.1245ab84@nowhere> In-Reply-To: <20190508080436.GF6551@localhost.localdomain> References: <20190506044836.2914-1-luca.abeni@santannapisa.it> <20190506044836.2914-3-luca.abeni@santannapisa.it> <20190508080436.GF6551@localhost.localdomain> 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 On Wed, 8 May 2019 10:04:36 +0200 Juri Lelli wrote: > Hi Luca, > > On 06/05/19 06:48, Luca Abeni wrote: > > From: luca abeni > > > > Currently, the SCHED_DEADLINE scheduler uses a global EDF scheduling > > algorithm, migrating tasks to CPU cores without considering the core > > capacity and the task utilization. This works well on homogeneous > > systems (SCHED_DEADLINE tasks are guaranteed to have a bounded > > tardiness), but presents some issues on heterogeneous systems. For > > example, a SCHED_DEADLINE task might be migrated on a core that has > > not enough processing capacity to correctly serve the task (think > > about a task with runtime 70ms and period 100ms migrated to a core > > with processing capacity 0.5) > > > > This commit is a first step to address the issue: When a task wakes > > up or migrates away from a CPU core, the scheduler tries to find an > > idle core having enough processing capacity to serve the task. > > > > Signed-off-by: luca abeni > > --- > > kernel/sched/cpudeadline.c | 31 +++++++++++++++++++++++++++++-- > > kernel/sched/deadline.c | 8 ++++++-- > > kernel/sched/sched.h | 7 ++++++- > > 3 files changed, 41 insertions(+), 5 deletions(-) > > > > diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c > > index 50316455ea66..d21f7905b9c1 100644 > > --- a/kernel/sched/cpudeadline.c > > +++ b/kernel/sched/cpudeadline.c > > @@ -110,6 +110,22 @@ static inline int cpudl_maximum(struct cpudl > > *cp) return cp->elements[0].cpu; > > } > > > > +static inline int dl_task_fit(const struct sched_dl_entity *dl_se, > > + int cpu, u64 *c) > > +{ > > + u64 cap = (arch_scale_cpu_capacity(NULL, cpu) * > > arch_scale_freq_capacity(cpu)) >> SCHED_CAPACITY_SHIFT; > > + s64 rel_deadline = dl_se->dl_deadline; > > + u64 rem_runtime = dl_se->dl_runtime; > > This is not the dynamic remaining one, is it? Right; I preferred to split this in two patches so that if we decide to use only the static task parameters (dl_deadline and dl_runtime) I can simply drop a patch ;-) Luca > > I see however 4/6.. lemme better look at that. > > Best, > > - Juri