Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2300372imu; Wed, 21 Nov 2018 09:29:01 -0800 (PST) X-Google-Smtp-Source: AJdET5f1kgfQvkxybMKlkyP2+x7S+QIQZr1tt8Wn0euxbFRCPErbMrURDqx4CcsN2NmkYI7kdaWW X-Received: by 2002:a62:6181:: with SMTP id v123-v6mr7901466pfb.117.1542821341281; Wed, 21 Nov 2018 09:29:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542821341; cv=none; d=google.com; s=arc-20160816; b=ICmCux1vKv2XRwWimzT/vmR7tpweN6l4OQ17FI6u9XbMOqKWrmo0x7wwBzo7sPTzhF MbdrfOrU85bFTb1YGgQh0TtMpW1dVcUWjOelmsfFLeHuzGlBQNgHSlmal7xFj5j34iTa UAAF9N5EvNPWuKzvd1Ca9oq50nZg/Jx+qduhcNgXmrjwY3fQ7554QB/mfeY7Q2CGlokV AfJlxOuR16YmB157YOwKIxFJhR6iI7J6ficLEeeqxKe0LYS64O1Hayr04eupg9M2X91a TfGWLSLLBk3hms0wBm6YHtpui1nXEQz80qanrZ95WvCM5e13wsZjH1wmHcD1i1hS7QWN imVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=34QTK7OeG1TZywdi1Tg4zHkVOpYjEGspENTdEZheEyM=; b=n6JfoGBVqkJSq5QzEkW/964SBFS5ih4LNghljk5xQzuxDQOPGonw0abuVtmbOE3YKK P6zM/gqdkDA5TM8Q/jLQut6sUKc8aL6HdRZtBndLSj82rKKzSUDuNkjQNzuyIb9AAdOi X7mEyxmtXNjE6qHCkyR/itd/fZb6TtADmq0tFtFkbzZj6e0NBph0CVIQo3ZV+MZDUTsG 5KNaeywauK8fOUU+cXyMIOZiYM1Axf0nkrfHHEoX57BvPZeB3OzgVx/HGOnt+BYkuga8 2qvxBY6rIdCTI33mkvBjcnYWRGzKFl0EJy4J9VwUpJtSZEpmGGyA/x38fOKOAeZPhiQ6 t5ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M2tigcFW; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p12si46310353pgl.106.2018.11.21.09.28.35; Wed, 21 Nov 2018 09:29:01 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M2tigcFW; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730541AbeKVBCI (ORCPT + 99 others); Wed, 21 Nov 2018 20:02:08 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:45369 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726849AbeKVBCH (ORCPT ); Wed, 21 Nov 2018 20:02:07 -0500 Received: by mail-ed1-f68.google.com with SMTP id d39so5011005edb.12; Wed, 21 Nov 2018 06:27:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=34QTK7OeG1TZywdi1Tg4zHkVOpYjEGspENTdEZheEyM=; b=M2tigcFW240lX227EHTuCKKAMFHhLYO5UMQJdpXtOAzHhQaoFmPCLAP6iPS+WN7v06 DRDs7ioEZ7eEXawBnrA84ST7Kqizu4xNb8KRWx1z1U0rya83pYyuh0i0ppHr1oa78x2I BJS3B0Wjdq+Qlf3zm54nM8e53WYx9hCtdL3apm7TGsourckflNDUFjVUrj84+hE5Gwn9 ObWvIXIUxwAh4sxd2ijkoIAvjmSn1RFxlSn5jkdfKXJUxtiB2+wwUxUUxegUXBo5IFVn UUl1t4Q4KNCotMW8HmZdb0AXPQ4ky+Agbi045pNgvIe0ZtxlHhN+5CzO/14Rtij+l8MT UGrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=34QTK7OeG1TZywdi1Tg4zHkVOpYjEGspENTdEZheEyM=; b=XgFFr1D/7phWPWsKmnZC7vita+I9fZPnzzIL1yQjSkR8uvz+6Gm62j2MyItt6JuKcT TrtNlE44NHBTwzFJmOz1OlHxb58Mtl5yyfV5lr9Fqd/xgQLkTORQyPiHEy9LNmQbXGWL eVodIPZlWa95sNlwDoLZx1TXQCYMF2BsUb3FgiB8Z4+JH+mGlgoNjkDjLkidXP2WxaEO Rgv4/6oHYFR0/36BAAsCM28Be0LeOSnK7OSSobgu3dN29afsDscuhQXDGQAYqZeCxEp8 HWVrdbTpLATF2nS3jeMu1W4bGziXQoGIS0rboyTWr/Bi2F3QKit3hLWESvOyqVGBT61x 7pfA== X-Gm-Message-State: AA+aEWZj1jtDmUnReCHa1Tx7u3wTAonmn56l4eqI9E+/xbg5x5/qc8O1 oYFpn0qsZoGb1dus6aWxnsMRYL3leAJwiXWbKvo= X-Received: by 2002:a17:906:d054:: with SMTP id bo20-v6mr5246163ejb.239.1542810447094; Wed, 21 Nov 2018 06:27:27 -0800 (PST) MIME-Version: 1.0 References: <1542736289-31338-1-git-send-email-longman@redhat.com> In-Reply-To: <1542736289-31338-1-git-send-email-longman@redhat.com> From: Michael Kerrisk Date: Wed, 21 Nov 2018 15:27:15 +0100 Message-ID: Subject: Re: [PATCH v4 0/5] cgroup: Introducing bypass mode To: longman@redhat.com Cc: Tejun Heo , lizefan@huawei.com, Johannes Weiner , Peter Zijlstra , Ingo Molnar , Jonathan Corbet , cgroups@vger.kernel.org, Linux Kernel , linux-doc , guro@fb.com, axboe@kernel.dk, Andrew Morton , dennis@kernel.org, shakeelb@google.com, Linux API , Michael Kerrisk Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [CC += linux-api@vger.kernel.org] Hi Waiman, Since this is a kernel-user-space API change, for all future iterations of this patch, please CC linux-api@. The kernel source file Documentation/SubmitChecklist notes that all Linux kernel patches that change userspace interfaces should be CCed to linux-api@vger.kernel.org, so that the various parties who are interested in API changes are informed. For further information, see https://www.kernel.org/doc/man-pages/linux-api-ml.html Thanks, Michael On Tue, Nov 20, 2018 at 8:45 PM Waiman Long wrote: > > 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 > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface", http://blog.man7.org/