diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2012-10-25 04:16:59 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-10-26 03:40:51 -0400 |
commit | 6a328d8c6f03501657ad580f6f98bf9a42583ff7 (patch) | |
tree | e2740717dd3233a1078872e48a7b159e71e6102b /drivers/net/tun.c | |
parent | fd9a08a7b83074e34c13c6340f673f7a51f53489 (diff) | |
download | op-kernel-dev-6a328d8c6f03501657ad580f6f98bf9a42583ff7.zip op-kernel-dev-6a328d8c6f03501657ad580f6f98bf9a42583ff7.tar.gz |
cgroup: net_cls: Rework update socket logic
The cgroup logic part of net_cls is very similar as the one in
net_prio. Let's stream line the net_cls logic with the net_prio one.
The net_prio update logic was changed by following commit (note there
were some changes necessary later on)
commit 406a3c638ce8b17d9704052c07955490f732c2b8
Author: John Fastabend <john.r.fastabend@intel.com>
Date: Fri Jul 20 10:39:25 2012 +0000
net: netprio_cgroup: rework update socket logic
Instead of updating the sk_cgrp_prioidx struct field on every send
this only updates the field when a task is moved via cgroup
infrastructure.
This allows sockets that may be used by a kernel worker thread
to be managed. For example in the iscsi case today a user can
put iscsid in a netprio cgroup and control traffic will be sent
with the correct sk_cgrp_prioidx value set but as soon as data
is sent the kernel worker thread isssues a send and sk_cgrp_prioidx
is updated with the kernel worker threads value which is the
default case.
It seems more correct to only update the field when the user
explicitly sets it via control group infrastructure. This allows
the users to manage sockets that may be used with other threads.
Since classid is now updated when the task is moved between the
cgroups, we don't have to call sock_update_classid() from various
places to ensure we always using the latest classid value.
[v2: Use iterate_fd() instead of open coding]
Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Cc: Li Zefan <lizefan@huawei.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Joe Perches <joe@perches.com>
Cc: John Fastabend <john.r.fastabend@intel.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Stanislav Kinsbursky <skinsbursky@parallels.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: <netdev@vger.kernel.org>
Cc: <cgroups@vger.kernel.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r-- | drivers/net/tun.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index e4858b2..3157519 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -68,7 +68,6 @@ #include <net/netns/generic.h> #include <net/rtnetlink.h> #include <net/sock.h> -#include <net/cls_cgroup.h> #include <asm/uaccess.h> @@ -587,8 +586,6 @@ static struct sk_buff *tun_alloc_skb(struct tun_struct *tun, struct sk_buff *skb; int err; - sock_update_classid(sk, current); - /* Under a page? Don't bother with paged skb. */ if (prepad + len < PAGE_SIZE || !linear) linear = len; |