Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1726637imm; Sat, 15 Sep 2018 01:49:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY0jTIkP7wklhoLfDI8YTrvFmHRy1c1rDf/ktgF6qa3uhVZRMdevPZqvCR+zJ8NqJMVt1+d X-Received: by 2002:a62:1605:: with SMTP id 5-v6mr16360452pfw.11.1537001341459; Sat, 15 Sep 2018 01:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537001341; cv=none; d=google.com; s=arc-20160816; b=x8y4a8umGSVQlty/Fjfic3I4hcJyy8GpNS86QNgsRvS+VGbALjeFZ7LVjz3LqABqM6 SWHLVAsHchQRcQuQiYY3lJGVautcfLszh1i30gvO3HE131wT3e5lnfnyvGz2Wnfgs0Qg u6XLeX+RtYfxHvCk4RfQKqWEJYeSUFkm9/aFMO6gCTfvB5B7w9Xa8rIQXiBUCTL71uwD 3ty4qBAjq6NoIhXQ9KUUTfMkRy3ZghjwUEzMIeueLT9yw0DmaiZej6+bDGN+nP9znIOY GvzzSGoPR07XHdDeNdoMlzsJNYRKx1XAJ8KDbQREmCHCYgLbZvt8uu6T2fLvgvq6JO4q iu8g== 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:openpgp:references:cc:to:from:subject:dkim-signature; bh=vw2DB2zcnP+gDwbbRzEWSKdSYbouUlMjD2mwAmdwVR0=; b=veP/+ga26dqlszaCf+mUuOSqmxh2RsDu53ogeEetL6/0AZEI9SB7IuYhB3lbvaT0T5 U6lSvZkL0+58Cm5lGyht1oiV1KlGf+WWPRrhIblMbAiLyYNZLxNoEsK8qC/diABfL+Uk /AFdDV79eoS5KZwRzNAf23DxnFPRpqv2FuOq3iJi6oIMiQJGglHZEYCiuQ4OsgiCmA7X e0CnNm21CF7H0+o6Kly6RHlQpM+HZQJrP0/VQAZXFVaFXozSx3vgKv5jxJzfzIY9BMlq Q/Q7ZbUIv/g6LoR7OU2ZqolrmOMVBucB6EuKp8I+i8lcpydB0d0GoNHP1INiZyPR/bg0 kigQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=G9mPef2X; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x17-v6si9300529pgi.243.2018.09.15.01.48.46; Sat, 15 Sep 2018 01:49:01 -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; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=G9mPef2X; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727040AbeIOOGp (ORCPT + 99 others); Sat, 15 Sep 2018 10:06:45 -0400 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:59829 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726446AbeIOOGp (ORCPT ); Sat, 15 Sep 2018 10:06:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1537001312; x=1568537312; h=subject:from:to:cc:references:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=vw2DB2zcnP+gDwbbRzEWSKdSYbouUlMjD2mwAmdwVR0=; b=G9mPef2XqBX2WhcoRskvvJ7cMhOSAo/YzHknKwDWj7iVXlg5uKX1XPJm dTT7g+GiSQStDuRiPsEbvFDyj9bw8P7wwYGXf1vS8aeGmJv/zjHSv0Q8l kxeLFfAfHE1ycPM+kN8w7IoQPZnuo4XAg/KIznuUsr3Yd/H/DlnRp+qzW E=; X-IronPort-AV: E=Sophos;i="5.53,376,1531785600"; d="scan'208";a="362530902" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1d-f273de60.us-east-1.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 15 Sep 2018 08:48:31 +0000 Received: from u7588a65da6b65f.ant.amazon.com (iad7-ws-svc-lb50-vlan2.amazon.com [10.0.93.210]) by email-inbound-relay-1d-f273de60.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id w8F8mO9K110025 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 15 Sep 2018 08:48:28 GMT Received: from u7588a65da6b65f.ant.amazon.com (localhost [127.0.0.1]) by u7588a65da6b65f.ant.amazon.com (8.15.2/8.15.2/Debian-3) with ESMTP id w8F8mLNn027075; Sat, 15 Sep 2018 10:48:21 +0200 Subject: Task group cleanups and optimizations (was: Re: [RFC 00/60] Coscheduling for Linux) From: "=?UTF-8?Q?Jan_H._Sch=c3=b6nherr?=" To: Peter Zijlstra Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Paul Turner , Vincent Guittot , Morten Rasmussen , Tim Chen References: <20180907214047.26914-1-jschoenh@amazon.de> <20180914111251.GC24106@hirez.programming.kicks-ass.net> <1d86f497-9fef-0b19-50d6-d46ef1c0bffa@amazon.de> Openpgp: preference=signencrypt Message-ID: <282230fe-b8de-01f9-c19b-6070717ba5f8@amazon.de> Date: Sat, 15 Sep 2018 10:48:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1d86f497-9fef-0b19-50d6-d46ef1c0bffa@amazon.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/14/2018 06:25 PM, Jan H. Schönherr wrote: > On 09/14/2018 01:12 PM, Peter Zijlstra wrote: >> >> There are known scalability problems with the existing cgroup muck; you >> just made things a ton worse. The existing cgroup overhead is >> significant, you also made that many times worse. >> >> The cgroup stuff needs cleanups and optimization, not this. [...] > With respect to the need of cleanups and optimizations: I agree, that > task groups are a bit messy. For example, here's my current wish list > off the top of my head: > > a) lazy scheduler operations; for example: when dequeuing a task, don't bother > walking up the task group hierarchy to dequeue all the SEs -- do it lazily > when encountering an empty CFS RQ during picking when we hold the lock anyway. > > b) ability to move CFS RQs between CPUs: someone changed the affinity of > a cpuset? No problem, just attach the runqueue with all the tasks elsewhere. > No need to touch each and every task. > > c) light-weight task groups: don't allocate a runqueue for every CPU in the > system, when it is known that tasks in the task group will only ever run > on at most two CPUs, or so. (And while there is of course a use case for > VMs in this, another class of use cases are auxiliary tasks, see eg, [1-5].) > > Is this the level of optimizations, you're thinking about? Or do you want > to throw away the whole nested CFS RQ experience in the code? I guess, it would be possible to flatten the task group hierarchy, that is usually created when nesting cgroups. That is, enqueue task group SEs always within the root task group. That should take away much of the (runtime-)overhead, no? The calculation of shares would need to be a different kind of complex than it is now. But that might be manageable. CFS bandwidth control would also need to change significantly as we would now have to dequeue/enqueue nested cgroups below a throttled/unthrottled hierarchy. Unless *those* task groups don't participate in this flattening. (And probably lots of other stuff, I didn't think about right now.) Regards Jan