aboutsummaryrefslogtreecommitdiffstats
path: root/net/socket.c
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 /net/socket.c
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 'net/socket.c')
-rw-r--r--net/socket.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/socket.c b/net/socket.c
index 0452dca4cd24..dfe5b66c97e0 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -398,7 +398,7 @@ int sock_map_fd(struct socket *sock, int flags)
398} 398}
399EXPORT_SYMBOL(sock_map_fd); 399EXPORT_SYMBOL(sock_map_fd);
400 400
401static struct socket *sock_from_file(struct file *file, int *err) 401struct socket *sock_from_file(struct file *file, int *err)
402{ 402{
403 if (file->f_op == &socket_file_ops) 403 if (file->f_op == &socket_file_ops)
404 return file->private_data; /* set in sock_map_fd */ 404 return file->private_data; /* set in sock_map_fd */
@@ -406,6 +406,7 @@ static struct socket *sock_from_file(struct file *file, int *err)
406 *err = -ENOTSOCK; 406 *err = -ENOTSOCK;
407 return NULL; 407 return NULL;
408} 408}
409EXPORT_SYMBOL(sock_from_file);
409 410
410/** 411/**
411 * sockfd_lookup - Go from a file number to its socket slot 412 * sockfd_lookup - Go from a file number to its socket slot
@@ -554,8 +555,6 @@ static inline int __sock_sendmsg_nosec(struct kiocb *iocb, struct socket *sock,
554 555
555 sock_update_classid(sock->sk); 556 sock_update_classid(sock->sk);
556 557
557 sock_update_netprioidx(sock->sk);
558
559 si->sock = sock; 558 si->sock = sock;
560 si->scm = NULL; 559 si->scm = NULL;
561 si->msg = msg; 560 si->msg = msg;