Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp357326ybv; Wed, 5 Feb 2020 06:49:13 -0800 (PST) X-Google-Smtp-Source: APXvYqxXmbcEPj52su/2636KXM+fcrBn0T84Wub8qk/gqWDZJL8H9BYrPUzjAVRrh1f/ATt34Mj2 X-Received: by 2002:a05:6808:84:: with SMTP id s4mr3123792oic.147.1580914153020; Wed, 05 Feb 2020 06:49:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580914152; cv=none; d=google.com; s=arc-20160816; b=HGu1VF2DiBceujONepxMiqvYfP5m4PWuvpXGSo/57Vs9nq8dNyoQiRUh2eIPsM1qp8 5RS/STsucAmZWe+tuY/H94saKa6sXcRJbYKZeaP5Jw/SPqPfdIoX4WCsQTrPWEWK6k2K KZpY2QfuHkuV5BxKGj0azP9XUIOwJmIwWGgEpeS+k7HvOngJIGdAbcEytJqf6gen6fY7 xYHVdI1h6GVf/ceRMNm6VvteMWc0B5qxDkr407CqXJ+NU/xG8Vc/qXcmhENzJX+gkgYg qt2NX080p8v3cBp5kySxmM7T8dYNdLiY7O4676Mct9rV7V7+Z8LcTOoUOJG4IbWha6RF qcAA== 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=+n6ht6w5y6vOTeRjM2nb4LLzXai7ol/PyjEkY13950g=; b=LfoA869KsJvYEGLjgg6sz5//9B6UbA6EHYwXsA8DanEjCbdP8vxry07TOt63ScdJ3c LnNu4jeIG8NnLI1mvlRXhsXC5JupVeMB//cQ8lVNv6dnHox0DoqhOLyJfJI26S5PFnZP 1ArwY59DfJ/wqpxxsegur1V7Ky6Eg/hr2cWpegI3v7tkyNXajVuhrSG+gEKH3DQ8GLd2 TGFvozrozKfxMWrONrdePgMOik1AggYcF/9k9Xf3uCtiwCu0zSbJ8JsyJ8ghcue9PUtR ZKBGlhhmB9niIcqbS4bp89gjg+RDGfazC/NMIjS3uQf1cPgYv37K7t335QWfPfPRzbDm yAYA== 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 p14si15033586ota.71.2020.02.05.06.48.58; Wed, 05 Feb 2020 06:49:12 -0800 (PST) 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 S1726597AbgBEOsG (ORCPT + 99 others); Wed, 5 Feb 2020 09:48:06 -0500 Received: from foss.arm.com ([217.140.110.172]:48246 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726334AbgBEOsG (ORCPT ); Wed, 5 Feb 2020 09:48:06 -0500 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 50F9531B; Wed, 5 Feb 2020 06:48:05 -0800 (PST) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F283D3F68E; Wed, 5 Feb 2020 06:48:03 -0800 (PST) Date: Wed, 5 Feb 2020 14:48:01 +0000 From: Qais Yousef To: Dietmar Eggemann Cc: Steven Rostedt , Pavan Kondeti , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Ben Segall , Mel Gorman , LKML Subject: Re: [PATCH v2] sched: rt: Make RT capacity aware Message-ID: <20200205144801.gkmxu3h3lfczbmbk@e107158-lin.cambridge.arm.com> References: <20191009104611.15363-1-qais.yousef@arm.com> <20200131100629.GC27398@codeaurora.org> <20200131153405.2ejp7fggqtg5dodx@e107158-lin.cambridge.arm.com> <20200203142712.a7yvlyo2y3le5cpn@e107158-lin> <20200203111451.0d1da58f@oasis.local.home> <20200203171745.alba7aswajhnsocj@e107158-lin> <20200203131203.20bf3fc3@oasis.local.home> <20200203190259.bnly7hfp3wfiteof@e107158-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/04/20 18:23, Dietmar Eggemann wrote: > On 03/02/2020 20:03, Qais Yousef wrote: > > On 02/03/20 13:12, Steven Rostedt wrote: > >> On Mon, 3 Feb 2020 17:17:46 +0000 > >> Qais Yousef wrote: > > [...] > > > In the light of strictly adhering to priority based scheduling; yes this makes > > sense. Though I still think the migration will produce worse performance, but > > I can appreciate even if that was true it breaks the strict priority rule. > > > >> > >> You can add to the logic that you do not take over an RT task that is > >> pinned and can't move itself. Perhaps that may be the only change to > > > > I get this. > > > >> cpu_find(), is that it will only pick a big CPU if little CPUs are > >> available if the big CPU doesn't have a pinned RT task on it. > > > > But not that. Do you mind rephrasing it? > > > > Or let me try first: > > > > 1. Search all priority levels for a fitting CPU > > Just so I get this right: All _lower_ prio levels than p->prio, right? Correct, that's what I meant :) > > > 2. If failed, return the first lowest mask found > > 3. If it succeeds, remove any CPU that has a pinned task in it > > 4. If the lowest_mask is empty, return (2). > > 5. Else return the lowest_mask with the fitting CPU(s) > > Mapping this to the 5 FIFO tasks rt-tasks of Pavan's example (all > p->prio=89 (dflt rt-app prio), dflt min_cap=1024 max_cap=1024) on a 4 > big (Cpu Capacity=1024) 4 little (Cpu capacity < 1024) system: > > You search from idx 1 to 11 [p->prio=89 eq. idx (task_pri)=12] and since > there are no lower prior RT tasks the lowest mask of idx=1 (CFS or Idle) > for the 5th RT task is returned. We should basically fallback to whatever was supposed to be returned if this patch is not applied. if (lower_mask) { // record the value of the first valid lower_mask if lower_mask doesn't contain a fitting CPU: continue searching in the next priority level } if no fitting cpu was found at any lower level: return the recorded first valid lower_mask > > But that means that CPU capacity trumps priority? I'm not sure how to translate 'trumps' here. So priority has precedence over capacity. I think this is not the best option, but it keeps the rules consistent; which is if a higher priority task is runnable it'd be pushed to another CPU running a lower priority one if we can find one. We'll attempt to make sure this CPU fits the capacity requirement of the task, but if there isn't one we'll fallback to the next best thing. I think this makes sense and will keep this fitness logic generic. Maybe it's easier to discuss over a patch. I will post one soon hopefully. Thanks -- Qais Yousef