Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp644469ybz; Wed, 15 Apr 2020 15:50:14 -0700 (PDT) X-Google-Smtp-Source: APiQypKqc/S09sHXGDLzyk50cthAgqwfvKmRO8M93HSyRLG1v1NBc/krWBfojWzko9/4HoETQkbr X-Received: by 2002:a17:906:1804:: with SMTP id v4mr7304431eje.104.1586991014134; Wed, 15 Apr 2020 15:50:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586991014; cv=none; d=google.com; s=arc-20160816; b=JYVnzPmAMM+/VffdeuEo6olpH+gy4zcJKuCj/d5VGZ2Az68zxSP70W2E3a+0DCaC4a o7LdDJP3e4ZAP0bNJzf9sF4GrCWpnBnCSdI+jp2+LeACC02nk7X+GFgVO2LIaAhkZo3t 1zhWGSV6X7krIZWqM4ujiI2b7m81cn/VJ+B9sNVgdg8b3IumtCgT0UAFYyt6Tk7WKwVN tNXy20btnJpG6vEJQppUeA3MT268mWy+VQD/qIKSqFynPVl6n3rFfoiEzM+6lcPdXunu 6WD1vy+We7C8946+vIEiLRtzwFQ3FLgUPUOM9hDLOBe8y5PDFXNpSgUNGRI+9C5RXdxM A9Eg== 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=ZOJ9JZ8HFRxYWXC2V3DUiqCjcIBffTnv3djnP2gChZ0=; b=FJVUd1dHKQ0EppsWW+6QTXpBotDSRtj0TRSgg6Vc4XWciKooFOCwGlCQBV1XwJgQ3J w5ypFPFI26vECa5zNRpua42QTbIADzbRvs3o5k4H5vmKrzNakSrGG6rc0StywhtJX4rD +DQw4LUhG/8jtHa7r0dkyJulzhyOOiHqE8/Y5XHosjWFUbENxbg61Xp2PE3BRbaN0hbX hmEJAmqLPtN4mc9lY8S2rDe6CG/kLsHuPmhzcVqIvm33xFpYMKsRgqsofy6VYJn7rICY 6+CSTssbGGLYYYpIUvK71xC3OC3HHZzVJ1fvvsIT46bsjQbDobe5cl4QAl5f6gKIY0v2 kLIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k7si12161971ejq.480.2020.04.15.15.49.50; Wed, 15 Apr 2020 15:50:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2895724AbgDOJjr (ORCPT + 99 others); Wed, 15 Apr 2020 05:39:47 -0400 Received: from foss.arm.com ([217.140.110.172]:40752 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2895721AbgDOJjk (ORCPT ); Wed, 15 Apr 2020 05:39:40 -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 E1F8E1063; Wed, 15 Apr 2020 02:39:39 -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 365CF3F68F; Wed, 15 Apr 2020 02:39:37 -0700 (PDT) Subject: Re: [PATCH 3/4] sched/deadline: Make DL capacity-aware To: Juri Lelli Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Steven Rostedt , Luca Abeni , Daniel Bristot de Oliveira , Wei Wang , Quentin Perret , Alessio Balsini , Pavan Kondeti , Patrick Bellasi , Morten Rasmussen , Valentin Schneider , Qais Yousef , linux-kernel@vger.kernel.org References: <20200408095012.3819-1-dietmar.eggemann@arm.com> <20200408095012.3819-4-dietmar.eggemann@arm.com> <20200410125253.GE14300@localhost.localdomain> From: Dietmar Eggemann Message-ID: Date: Wed, 15 Apr 2020 11:39:35 +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: <20200410125253.GE14300@localhost.localdomain> 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 10.04.20 14:52, Juri Lelli wrote: > Hi, > > On 08/04/20 11:50, Dietmar Eggemann wrote: >> From: Luca Abeni [...] >> @@ -1623,10 +1624,19 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags) >> * other hand, if it has a shorter deadline, we >> * try to make it stay here, it might be important. >> */ >> - if (unlikely(dl_task(curr)) && >> - (curr->nr_cpus_allowed < 2 || >> - !dl_entity_preempt(&p->dl, &curr->dl)) && >> - (p->nr_cpus_allowed > 1)) { >> + select_rq = unlikely(dl_task(curr)) && >> + (curr->nr_cpus_allowed < 2 || >> + !dl_entity_preempt(&p->dl, &curr->dl)) && >> + p->nr_cpus_allowed > 1; >> + >> + /* >> + * We take into account the capacity of the CPU to >> + * ensure it fits the requirement of the task. >> + */ >> + if (static_branch_unlikely(&sched_asym_cpucapacity)) >> + select_rq |= !dl_task_fits_capacity(p, cpu); > > I'm thinking that, while dl_task_fits_capacity() works well when > selecting idle cpus, in this case we should consider the fact that curr > might be deadline as well and already consuming some of the rq capacity. > > Do you think we should try to take that into account, maybe using > dl_rq->this_bw ? So you're saying that cpudl_find(..., later_mask) could return 1 (w/ best_cpu (cp->elements[0].cpu) in later_mask). And that this best_cpu could be a non-fitting CPU for p. This could happen if cp->free_cpus is empty (no idle CPUs) so we take cpudl_find()'s else path and in case p's deadline < cp->elements[0] deadline. We could condition the 'return 1' on best_cpu fitting p. But should we do this for cpudl_find(..., NULL) calls from check_preempt_equal_dl() as well or will this break GEDF?