aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/netprio_cgroup.h
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2012-07-20 06:39:25 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-22 15:44:01 -0400
commit406a3c638ce8b17d9704052c07955490f732c2b8 (patch)
treedb759dfccc6c09196773d0cc1ec260a7a4e9db07 /include/net/netprio_cgroup.h
parent0690899b4d4501b3505be069b9a687e68ccbe15b (diff)
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>
Diffstat (limited to 'include/net/netprio_cgroup.h')
-rw-r--r--include/net/netprio_cgroup.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index d58fdec4759..2719dec6b5a 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -35,7 +35,7 @@ struct cgroup_netprio_state {
35extern int net_prio_subsys_id; 35extern int net_prio_subsys_id;
36#endif 36#endif
37 37
38extern void sock_update_netprioidx(struct sock *sk); 38extern void sock_update_netprioidx(struct sock *sk, struct task_struct *task);
39 39
40#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP) 40#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP)
41 41
@@ -82,7 +82,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
82#endif /* CONFIG_NETPRIO_CGROUP */ 82#endif /* CONFIG_NETPRIO_CGROUP */
83 83
84#else 84#else
85#define sock_update_netprioidx(sk) 85#define sock_update_netprioidx(sk, task)
86#endif 86#endif
87 87
88#endif /* _NET_CLS_CGROUP_H */ 88#endif /* _NET_CLS_CGROUP_H */