Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4976430ybi; Tue, 30 Jul 2019 11:28:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVM4SLswsjjhPp91cx/poXg1AO8zwx1cJIwPg4A/ZBQNnEib8JdQuY6zOqrJzY94xqY2pG X-Received: by 2002:a17:90a:a008:: with SMTP id q8mr119305461pjp.114.1564511337250; Tue, 30 Jul 2019 11:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564511337; cv=none; d=google.com; s=arc-20160816; b=tJuipFSSSsK65sqv/nMw+RV1q+HjirLYGEyRx5sr+kSOa8MJR3GD8sInQAynTe5UGC crD4OBkki4x7PazbyYU9SC0noPZVbMpS4d/DMFmjpnmZkFpe5ASxVqj8jZEIcZubLFbI 5WRQhb+fp1MqetmTqAjB6pXjMySFuADnj1ayO8AJ4lgN5ff6156ah6W2Agw01Xka9yOA UQ/izoimL3/Zya1Wh7WH3CZH8BuSGnWxbwoIlOULy82QDFi48EwuX6uF1mOBXCmke19i On7oHPIY4VX42L/271CpnAs82dw3oEOyvBLUF+JxQqXFWWVh3wRsRcLp+nQ7aDhZX2Bn 9O+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=7hAuiXrhxAlGgjElzYb9Po1fG6T3f8A9AVfum8ihS50=; b=xqs1fktfzL20CkcI9lVbgrdOHpjwOWxIfzdCKVTStmQ1q6kPacABbeY90iT9mCTMfz u48rYaK+QcELqZl3hmE3EzSB4OZdJtS2AzVz/TKEsCSQEdzNpycRlEup46PvEoQS1YHV 832r+L/sjwJYhBl7lB5jY5gS444H6iGqDa6tFukJsBMKcxywrSLmPDAWwxuQewvyVbCj W3AokTvtq6hoO5/FLTIYrzsAuoPLlXdp8nfT5ngUOdFBZIDtEpbYdeYj+OUhBbLaFWuR 5lbq7QQxbMpZpYNypnttcHYOIJu9hT27+owTgljiSMfyh65RX0Q8uElDy4QrS5mB9nS4 3Z0w== 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 a9si30831006pfn.104.2019.07.30.11.28.41; Tue, 30 Jul 2019 11:28:57 -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 S1729590AbfG3S1g (ORCPT + 99 others); Tue, 30 Jul 2019 14:27:36 -0400 Received: from shelob.surriel.com ([96.67.55.147]:32838 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727948AbfG3S1f (ORCPT ); Tue, 30 Jul 2019 14:27:35 -0400 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hsWqI-0000go-Lu; Tue, 30 Jul 2019 14:27:22 -0400 Message-ID: Subject: Re: [PATCH RFC v3 0/14] sched,fair: flatten CPU controller runqueues From: Rik van Riel To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, pjt@google.com, dietmar.eggemann@arm.com, mingo@redhat.com, morten.rasmussen@arm.com, tglx@linutronix.de, mgorman@techsingularity.net, vincent.guittot@linaro.org Date: Tue, 30 Jul 2019 14:27:22 -0400 In-Reply-To: <20190730162933.GW31398@hirez.programming.kicks-ass.net> References: <20190722173348.9241-1-riel@surriel.com> <20190730162933.GW31398@hirez.programming.kicks-ass.net> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-w+XrJxZWZMVSU7Dom0r+" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-w+XrJxZWZMVSU7Dom0r+ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2019-07-30 at 18:29 +0200, Peter Zijlstra wrote: > On Mon, Jul 22, 2019 at 01:33:34PM -0400, Rik van Riel wrote: > > Plan for the CONFIG_CFS_BANDWIDTH reimplementation: > > - When a cgroup gets throttled, mark the cgroup and its children > > as throttled. > > - When pick_next_entity finds a task that is on a throttled cgroup, > > stash it on the cgroup runqueue (which is not used for runnable > > tasks any more). Leave the vruntime unchanged, and adjust that > > runqueue's vruntime to be that of the left-most task. >=20 > and ignore such tasks for the load-balancer; I suppose Good point. I suppose we need to find a lazy way of doing this, too... > > - When a cgroup gets unthrottled, and has tasks on it, place it on > > a vruntime ordered heap separate from the main runqueue. >=20 > and expose said heap to the load-balancer.. >=20 > Now, I suppose you do this because merging heaps is easier than > merging > RB trees? (not in complexity iirc, but probably in code) >=20 > > - Have pick_next_task_fair grab one task off that heap every time > > it > > is called, and the min vruntime of that heap is lower than the > > vruntime of the CPU's cfs_rq (or the CPU has no other runnable > > tasks). >=20 > That's like a smeared out merge :-) But since the other tasks kept on > running, this CPUs vruntime will be (much) advanced vs those > throttled > tasks and we'll most likely end up picking them all before we pick a > 'normal' task. The GENTLE_FAIR_SLEEPERS code should place the vruntime of newly unthrottled tasks to the right of that of the current top task on the runqueue, to prevent thundering herd effects (and the throttled group immediately going over its quota again, while causing bad latency for others). > > - Place that selected task on the CPU's cfs_rq, renormalizing its > > vruntime with the GENTLE_FAIR_SLEEPERS logic. That should help > > interleave the already runnable tasks with the recently > > unthrottled > > group, and prevent thundering herd issues. > > - If the group gets throttled again before all of its task had a > > chance > > to run, vruntime sorting ensures all the tasks in the throttled > > cgroup > > get a chance to run over time. >=20 >=20 --=20 All Rights Reversed. --=-w+XrJxZWZMVSU7Dom0r+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl1AjAoACgkQznnekoTE 3oN7bgf+MY2UaY9JEX5tYWJt1qyr3gnTvUVp9YZnbcH/BllW6+etzLkgj4inKUzd NKOQXFnm+VNCQ4DMHxgAKL03EqoR45bvryo0Il4Fvk9QiS1T13KJvKtIZ/MA35Hq wgBqk6/M/teBQ+hFschJa4kgAJH6YoNYgi+8nVPVgOyiy9ktWD9yiggJSiqau1Zj 5X6nAxtJD//nhMIIN7YfaP3244gyQqFV87LJiuAJPUBrz4BsHlAkGb/Xq7tJQrwa ROwDOiqXFUh6VwOvu3M/hcSxWrBfOcJvsJGkjZmwhWH2eb0rYwPwrOIV6VbXZTYx EK/hpWWG0J52GXdsLdsLRGNtwb7G1g== =7eJP -----END PGP SIGNATURE----- --=-w+XrJxZWZMVSU7Dom0r+--