From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: daniel.wagner-98C5kh4wR6ohFhg+JK9F0w@public.gmane.org,
srivatsa.bhat-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org,
john.r.fastabend-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org
Cc: lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCHSET cgroup/for-3.8] netprio_cgroup: implement hierarchy support
Date: Fri, 16 Nov 2012 11:20:16 -0800 [thread overview]
Message-ID: <1353093624-22608-1-git-send-email-tj@kernel.org> (raw)
Hello, guys.
This patchset implements hierarchy support for netprio_cgroup.
netprio_cgroup along with netcls_cgroup is a rather weird in that it
really isn't about resource control. It just hitches on cgroup as a
convenient mechanism to do stuff to groups of tasks. The hierarchy
support reflects such nature. There's no limit being imposed from
ancestors. It simply propagates configuration downwards until there's
a node with its own config. IOW, any given cgroup inherits priorities
from its parent for all netdevs which it doesn't have its own config
for.
As a parent isn't affected by child inheriting its config, the
hierarchy implementation is pretty simple. It's enough to inherit
config from ->css_online() and propagate new config downwards from
write_priomap(). As each node needs to know which config is its local
one and which is inherited, an extra config array is added -
netprio_map->aux[]. It's a separate array to avoid disturbing spatial
locality of ->priomap[]. While it currently contains single one-bit
flag, I still made it a struct so that adding more configuration
(e.g. max_prio) is easy.
Note that this does change userland-visible behavior. Now, nesting is
allowed and cgroups at the first level inherit priorities from the
root cgroup. I can't think of any better way than just biting the
bullet here. :(
0001-cgroup-add-cgroup-id.patch
0002-netprio-simplify-write_priomap.patch
0003-netprio_cgroup-shorten-variable-names-in-extend_netd.patch
0004-netprio_cgroup-reimplement-priomap-expansion.patch
0005-netprio_cgroup-use-cgroup-id-instead-of-cgroup_netpr.patch
0006-netprio_cgroup-implement-netprio-_set-_prio-helpers.patch
0007-netprio_cgroup-keep-track-of-whether-prio-is-set-or-.patch
0008-netprio_cgroup-implement-hierarchy-support.patch
0001 adds cgroup->id. This will eventually replace css_id.
0002-0006 are prep patches.
0007 implements is_local flag which tracks whether a cgroup has its
own config or should inherit from its parent.
0008 implements hierarchy support.
This patchset is on top of
cgroup/for-3.8 ef9fe980c6 ("cgroup_freezer: implement proper hierarchy support")
+ [1] "[PATCHSET cgroup/for-3.8] cgroup: allow ->post_create() to fail"
+ [2] "[PATCH 1/2] cgroup: s/CGRP_CLONE_CHILDREN/CGRP_CPUSET_CLONE_CHILDREN/"
"[PATCH 2/2] cgroup, cpuset: remove cgroup_subsys->post_clone()"
and available in the following git branch.
git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-netprio_cgroup-hierarchy
diffstat follows.
Documentation/cgroups/net_prio.txt | 21 +-
include/linux/cgroup.h | 2
include/net/netprio_cgroup.h | 21 +-
kernel/cgroup.c | 15 +
net/core/netprio_cgroup.c | 376 +++++++++++++++++++++++--------------
5 files changed, 284 insertions(+), 151 deletions(-)
Thanks.
--
tejun
[1] http://thread.gmane.org/gmane.linux.kernel.cgroups/5047
[2] http://thread.gmane.org/gmane.linux.kernel/1393151
WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj@kernel.org>
To: daniel.wagner@bmw-carit.de, srivatsa.bhat@linux.vnet.ibm.com,
john.r.fastabend@intel.com, nhorman@tuxdriver.com
Cc: lizefan@huawei.com, containers@lists.linux-foundation.org,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCHSET cgroup/for-3.8] netprio_cgroup: implement hierarchy support
Date: Fri, 16 Nov 2012 11:20:16 -0800 [thread overview]
Message-ID: <1353093624-22608-1-git-send-email-tj@kernel.org> (raw)
Hello, guys.
This patchset implements hierarchy support for netprio_cgroup.
netprio_cgroup along with netcls_cgroup is a rather weird in that it
really isn't about resource control. It just hitches on cgroup as a
convenient mechanism to do stuff to groups of tasks. The hierarchy
support reflects such nature. There's no limit being imposed from
ancestors. It simply propagates configuration downwards until there's
a node with its own config. IOW, any given cgroup inherits priorities
from its parent for all netdevs which it doesn't have its own config
for.
As a parent isn't affected by child inheriting its config, the
hierarchy implementation is pretty simple. It's enough to inherit
config from ->css_online() and propagate new config downwards from
write_priomap(). As each node needs to know which config is its local
one and which is inherited, an extra config array is added -
netprio_map->aux[]. It's a separate array to avoid disturbing spatial
locality of ->priomap[]. While it currently contains single one-bit
flag, I still made it a struct so that adding more configuration
(e.g. max_prio) is easy.
Note that this does change userland-visible behavior. Now, nesting is
allowed and cgroups at the first level inherit priorities from the
root cgroup. I can't think of any better way than just biting the
bullet here. :(
0001-cgroup-add-cgroup-id.patch
0002-netprio-simplify-write_priomap.patch
0003-netprio_cgroup-shorten-variable-names-in-extend_netd.patch
0004-netprio_cgroup-reimplement-priomap-expansion.patch
0005-netprio_cgroup-use-cgroup-id-instead-of-cgroup_netpr.patch
0006-netprio_cgroup-implement-netprio-_set-_prio-helpers.patch
0007-netprio_cgroup-keep-track-of-whether-prio-is-set-or-.patch
0008-netprio_cgroup-implement-hierarchy-support.patch
0001 adds cgroup->id. This will eventually replace css_id.
0002-0006 are prep patches.
0007 implements is_local flag which tracks whether a cgroup has its
own config or should inherit from its parent.
0008 implements hierarchy support.
This patchset is on top of
cgroup/for-3.8 ef9fe980c6 ("cgroup_freezer: implement proper hierarchy support")
+ [1] "[PATCHSET cgroup/for-3.8] cgroup: allow ->post_create() to fail"
+ [2] "[PATCH 1/2] cgroup: s/CGRP_CLONE_CHILDREN/CGRP_CPUSET_CLONE_CHILDREN/"
"[PATCH 2/2] cgroup, cpuset: remove cgroup_subsys->post_clone()"
and available in the following git branch.
git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-netprio_cgroup-hierarchy
diffstat follows.
Documentation/cgroups/net_prio.txt | 21 +-
include/linux/cgroup.h | 2
include/net/netprio_cgroup.h | 21 +-
kernel/cgroup.c | 15 +
net/core/netprio_cgroup.c | 376 +++++++++++++++++++++++--------------
5 files changed, 284 insertions(+), 151 deletions(-)
Thanks.
--
tejun
[1] http://thread.gmane.org/gmane.linux.kernel.cgroups/5047
[2] http://thread.gmane.org/gmane.linux.kernel/1393151
next reply other threads:[~2012-11-16 19:20 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-16 19:20 Tejun Heo [this message]
2012-11-16 19:20 ` [PATCHSET cgroup/for-3.8] netprio_cgroup: implement hierarchy support Tejun Heo
2012-11-16 19:20 ` [PATCH 7/8] netprio_cgroup: keep track of whether prio is set or not Tejun Heo
[not found] ` <1353093624-22608-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2012-11-16 19:20 ` [PATCH 1/8] cgroup: add cgroup->id Tejun Heo
2012-11-16 19:20 ` Tejun Heo
[not found] ` <1353093624-22608-2-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2012-11-19 9:03 ` Li Zefan
2012-11-19 9:03 ` Li Zefan
2012-11-19 9:03 ` Li Zefan
[not found] ` <50A9F5F3.3050907-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2012-11-19 17:05 ` Tejun Heo
2012-11-19 17:05 ` Tejun Heo
2012-11-20 4:34 ` Kamezawa Hiroyuki
2012-11-20 4:34 ` Kamezawa Hiroyuki
[not found] ` <50AB086E.70901-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2012-11-20 5:31 ` Tejun Heo
2012-11-20 5:31 ` Tejun Heo
2012-11-20 5:31 ` Tejun Heo
[not found] ` <20121120053112.GE25790-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2012-11-20 7:05 ` Kamezawa Hiroyuki
2012-11-20 7:05 ` Kamezawa Hiroyuki
[not found] ` <50AB2BCF.2050204-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2012-11-20 7:08 ` Tejun Heo
2012-11-20 7:08 ` Tejun Heo
2012-11-20 7:08 ` Tejun Heo
[not found] ` <20121120070851.GG25790-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2012-11-20 7:11 ` Kamezawa Hiroyuki
2012-11-20 7:11 ` Kamezawa Hiroyuki
2012-11-20 8:20 ` Glauber Costa
2012-11-20 8:20 ` Glauber Costa
2012-11-20 8:20 ` Glauber Costa
2012-11-16 19:20 ` [PATCH 2/8] netprio: simplify write_priomap() Tejun Heo
2012-11-16 19:20 ` Tejun Heo
2012-11-16 19:20 ` [PATCH 3/8] netprio_cgroup: shorten variable names in extend_netdev_table() Tejun Heo
2012-11-16 19:20 ` Tejun Heo
2012-11-16 19:20 ` [PATCH 4/8] netprio_cgroup: reimplement priomap expansion Tejun Heo
2012-11-16 19:20 ` Tejun Heo
2012-11-16 19:20 ` [PATCH 5/8] netprio_cgroup: use cgroup->id instead of cgroup_netprio_state->prioidx Tejun Heo
2012-11-16 19:20 ` Tejun Heo
2012-11-16 19:20 ` [PATCH 6/8] netprio_cgroup: implement netprio[_set]_prio() helpers Tejun Heo
2012-11-16 19:20 ` Tejun Heo
2012-11-16 19:20 ` [PATCH 7/8] netprio_cgroup: keep track of whether prio is set or not Tejun Heo
2012-11-16 19:20 ` [PATCH 8/8] netprio_cgroup: implement hierarchy support Tejun Heo
2012-11-16 19:20 ` Tejun Heo
2012-11-16 19:20 ` Tejun Heo
2012-11-19 13:25 ` [PATCHSET cgroup/for-3.8] " Neil Horman
2012-11-19 13:25 ` Neil Horman
2012-11-19 19:25 ` Daniel Wagner
2012-11-19 19:25 ` Daniel Wagner
[not found] ` <50AA87BD.1040106-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-11-19 19:54 ` Daniel Wagner
2012-11-19 19:54 ` Daniel Wagner
2012-11-19 19:54 ` Daniel Wagner
2012-11-19 19:25 ` Daniel Wagner
-- strict thread matches above, loose matches on Subject: below --
2012-11-16 19:20 Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1353093624-22608-1-git-send-email-tj@kernel.org \
--to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=daniel.wagner-98C5kh4wR6ohFhg+JK9F0w@public.gmane.org \
--cc=john.r.fastabend-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org \
--cc=srivatsa.bhat-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.