]> git.baikalelectronics.ru Git - kernel.git/commit
net: netprio_cgroup: rework update socket logic
authorJohn Fastabend <john.r.fastabend@intel.com>
Fri, 20 Jul 2012 10:39:25 +0000 (10:39 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 22 Jul 2012 19:44:01 +0000 (12:44 -0700)
commit90b1d6679d30af5b0e16ca06b22c7407e0e97d9f
treedb759dfccc6c09196773d0cc1ec260a7a4e9db07
parent2b75cd6fcd7e619f53bfd80cc6bb4da45a8b6c39
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.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/net.h
include/net/netprio_cgroup.h
net/core/netprio_cgroup.c
net/core/sock.c
net/socket.c