Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1124996imu; Tue, 20 Nov 2018 12:07:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/XOnmwloyzAXGHcXtYu36RWpxWYZgLaeSjMyOBoqJcuKv5gNgRDMbknKs37nB0rR8JZS5PT X-Received: by 2002:a17:902:509:: with SMTP id 9-v6mr3617288plf.3.1542744434914; Tue, 20 Nov 2018 12:07:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542744434; cv=none; d=google.com; s=arc-20160816; b=cQsErmlVJfq/T75D43y6m8Q8o0pRZD8H6BaYAJ9M/4rpefHbXbnXDQyNcZKzw9pnun tL3y2IUIGfVzcxdNru09VRMHHTsQ2DyEDSfg1+/VXLoxTAP8nCHU7EUzLk21/b9lJJqq r1PgPH4+bofUl1X0DIs1mE9dz0GwGVJEk1Gh9LWZvZe2Q8JMMCovoOcmlmIallyYP9Yd grssgYMzfMVXWvNXjI+sE24IzMjgg6tox/xAPUniTGG4VfCj2L0f+dKRZ5kluZZTzyoo 77/7MIcK7pRBLY7aOD77POvBmzi8nA96/HFAsew0ATkh0BG8vl6ptr85HEwWpZyhP/Or WWTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=GDe5/SqMalRsAoMZPeUdNnZtjKNVC3Onu/lQPQP24vs=; b=n7QCsEZqkUB0Se2u0x2gVq4lt8D7Ao41IfOL8dOzQCsMGQG/88i6z8wkC04u6+q4X0 Rn7srTmj5+OYvqS8+8NV4bLEddfLXnW7H3w2v/fYuzMqAtUwC7BhVwEoSgjaIr0Se91m IngCMrzwQHUB5EZgMXLT5CENrEmoVEsRIhcpfYY7AZW4rBA6ROYZZQDQ55VPwnWNjRLN TBxNbeX3S4fus/Xk5tUR7XTUWroZDrKYFBZoctLIyiEnpmzoA22HO0BmIx3RaajX+kPm tNMRUxYxSfUtlge8WJNnj+cpjqUWzi22VUKAE3IHMM7pLfV6wAso3B+rJOoJdf8tXhzC 9RPA== 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 w19si37544916pgf.573.2018.11.20.12.06.59; Tue, 20 Nov 2018 12:07:14 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729433AbeKUEWb (ORCPT + 99 others); Tue, 20 Nov 2018 23:22:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34910 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbeKUEWa (ORCPT ); Tue, 20 Nov 2018 23:22:30 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D2CBC0495A8; Tue, 20 Nov 2018 17:52:09 +0000 (UTC) Received: from llong.com (ovpn-120-174.rdu2.redhat.com [10.10.120.174]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35AF818FA5; Tue, 20 Nov 2018 17:52:07 +0000 (UTC) From: Waiman Long To: Tejun Heo , Li Zefan , Johannes Weiner , Peter Zijlstra , Ingo Molnar , Jonathan Corbet Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Roman Gushchin , Jens Axboe , Andrew Morton , Dennis Zhou , Shakeel Butt , Waiman Long Subject: [PATCH v4 0/5] cgroup: Introducing bypass mode Date: Tue, 20 Nov 2018 12:51:24 -0500 Message-Id: <1542736289-31338-1-git-send-email-longman@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 20 Nov 2018 17:52:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v4: - Rebased to the latest for-4.21 branch of cgroup tree. - Make each controller explicitly opt in to become bypassable by setting the bypassable cgroup_subsys flag. Currently, only cpu controller is made bypassable. - Break out the cgroup_v2.rst documentation update as separate patch. v3: - Remove invalid cgroup subdirectory creation patch. - Add use cases for the bypass mode and removing statements about control files ownership in cgroup-v2.txt. - Restrict bypass mode to non-domain (threaded) controllers only. v3 patch - https://lkml.org/lkml/2017/8/9/604 This patchset introduces a new bypass mode to the cgroup v2 core to give more freedom and flexibility to controllers which choose to become bypassable the freedom to shape their own unique views of the virtual cgroup hierarchies that can best suit thier own use cases. Because of the inherent performance overhead in enabling cpu controller, it is made bypassable so that the controller only needs to be enabled at those cgroups that really need it instead of in every cgroups at a given layer if at least one of them needs it. The cpu controller performance problem is one of the major issues in migrating from cgroup v1 to v2. For example, R - A(+) - B(#) - C(+) \ D(#) where "+" means the controller is enabled and "#" means the controller is bypassed. For this controller's perspective, the cgroups are equivalent to: R - A|B|D - C Underneath the root R, cgoups A, B and D are controlled by one set of knobs and cgroup C is controlled by another set of knobs as a child of cgroups A|B|C. This patchset is layered on top of the "for-4.21" branch of Tejun's cgroup git tree. Patch 1 introduces a new bypass mode that allows a bypassable controller to be disabled in a cgroup, but to be re-enabled again in its children. This is enabled by writing the controller name prefixed with '#' to the "cgroup.subtree_control" file. Then all its children will have this controller in bypass mode. Patch 2 extends the bypass mode mechanism to allow those child cgroups that are put into the bypass mode for a particular bypassable controller by their parent to be re-enabled again by writing the controller name with the '+' prefix to the "cgroup.controllers" file. Patch 3 extends the debug controller to expose additional controller masks introduced by this patchset. Patch 4 makes the cpu controller bypassable. Patch 5 documents the new bypass mode in cgroup-v2.rst file. Waiman Long (5): cgroup: subtree_control bypass mode for bypassable controllers cgroup: Allow reenabling of controller in bypass mode cgroup: Make debug controller report new controller masks sched/core: Make cpu cgroup controller bypassable cgroup: Document bypass mode Documentation/admin-guide/cgroup-v2.rst | 66 +++++--- include/linux/cgroup-defs.h | 26 +++- kernel/cgroup/cgroup.c | 256 +++++++++++++++++++++++++------- kernel/cgroup/debug.c | 2 + kernel/sched/core.c | 1 + 5 files changed, 276 insertions(+), 75 deletions(-) -- 1.8.3.1