Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4707708yba; Wed, 8 May 2019 01:06:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyou3leuDZzehzv5yFN0yTZBNn9ZB8UOu6uf5qaI9uO5TDNDgmaDiOeLPkDpUeSKO6fUdH3 X-Received: by 2002:a63:4346:: with SMTP id q67mr45194822pga.241.1557302803386; Wed, 08 May 2019 01:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557302803; cv=none; d=google.com; s=arc-20160816; b=HU8IquLh6SL4xHBMBr+qyx7s134Y+ASWXPBjVXI95roW3jR+7pGDZ3KfnjXgGCqyaM nhKNH8Ybx6PSwFp0xncnUZGXR1RtLePHN4YLRvzO+XqbaH4g/iriycTVRQbSI0dMQbjt 1Cp2pmOZ8V50kHYYIz533SFjQoN0SsKDt4th6IIX06VBxRur7xdMyVQCC1SlGRma8wNB bnyFPWeOrZZ2IMC9xnuEHhQ1a+FiJzA7hmV1caAaLWdZJz7WB901d7gDdNiqmBv2QzlF Mt8PdV9X8F7Fch3rD9UHkjJmIZLw7Svh/5hvyT/rU2r20+IBQAb0gJrTYvO0yNQuA05P Y84A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9quD3rUlId3s9xE5WQ9qfoKtV1iDyOxaETbvD2qMUps=; b=wA5HBV3L/i+MqEjq5+ELKrlfMD0Ylt9TWpMw6SSciA+jF00zz5UlKo+s3aELedF/8w esDxeYBZA9INESXHGomCIK+v5+vp8IdCWnSUWwqp6IeKwqDY6a/wly7Zw/VUmcSEPHBe nawBwT9p4jDCS0dmwnM8wCJ2hK6AVpUYqrvt9CEiAh73gCGqRgZPjNwMZHQkLOZEaP5g BOtFBmZJw7l6w49GaZUJHFx5oG0TNS8A549VqHJNu8NXKRfQPqYxoOUf2m3FvC1kAW7L D4nIzb4IHQIpA2uOammEmGwwhTrG6R6CdS+yS1bP6Rst15W16up9cqXU8LCa/Gt6GDcx vd7Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h7si21292575pgj.363.2019.05.08.01.06.27; Wed, 08 May 2019 01:06:43 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726933AbfEHIEm (ORCPT + 99 others); Wed, 8 May 2019 04:04:42 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35973 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726892AbfEHIEl (ORCPT ); Wed, 8 May 2019 04:04:41 -0400 Received: by mail-wr1-f68.google.com with SMTP id o4so25907680wra.3 for ; Wed, 08 May 2019 01:04:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9quD3rUlId3s9xE5WQ9qfoKtV1iDyOxaETbvD2qMUps=; b=ptAXye10M1bTT8akY8EXX5jtyYLwORy6rwfrSlsTJzqZ7GHUn9wO+9SKoI1CKY45IV JtOmzO0R+UVVEiJ5+IvGEZzgqz+9NjVh7UZd1b2Po/ucAUXK1QSfw4Y1OrHi8eEQhd0j b0ZvyxOut/TqonmqGKZWwKZTjyVTlswqRxHL9g0rGKDwKi+88UMLyTIs6mZY858BUwmM XcbICoRe16IpBB117JvRxknvJHxYaYvQAdK26xT1k85DeBmbaXghNlijPZKszMLIhC+k VEB2njJWBudSTZiEQ3PQ2Mu9sDb36lORdUSZtN9qm6LTaupO1lxkqvcSaaTCUB4vLEKQ F+oA== X-Gm-Message-State: APjAAAXHsJdFKisAqPKHHYCUxVHCUTilvU24CAmS6WcRA3rYjpwT/6dW gwGXdDXKbePA6/M6dBjHyXpLQQ== X-Received: by 2002:adf:f803:: with SMTP id s3mr5103478wrp.153.1557302679450; Wed, 08 May 2019 01:04:39 -0700 (PDT) Received: from localhost.localdomain ([151.29.174.33]) by smtp.gmail.com with ESMTPSA id t15sm1407934wmt.2.2019.05.08.01.04.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 May 2019 01:04:38 -0700 (PDT) Date: Wed, 8 May 2019 10:04:36 +0200 From: Juri Lelli To: Luca Abeni 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: <20190508080436.GF6551@localhost.localdomain> References: <20190506044836.2914-1-luca.abeni@santannapisa.it> <20190506044836.2914-3-luca.abeni@santannapisa.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190506044836.2914-3-luca.abeni@santannapisa.it> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? I see however 4/6.. lemme better look at that. Best, - Juri