All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] net: Improve socket sharing between multiple cgroups
@ 2011-12-21 14:39 Neil Horman
  2011-12-21 14:39 ` [PATCH 1/4] net_prio/classid: add cgroup process ownership filter Neil Horman
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Neil Horman @ 2011-12-21 14:39 UTC (permalink / raw)
  To: netdev; +Cc: Neil Horman, Thomas Graf, David S. Miller

Currently, the network centric cgroups for priority and classification don't 
share resources properly.  Since socket priority and classification are
assigned based on the socket through which the data was sent, an anomaly arises
when multiple processes share a given socket.  As the priority index and class-id
are updated when a skb is sent at the top of the stack, but interrogated and
used at the bottom of the stack, multiple process living in separate cgroups but
sharing a socket can result in skbs being sent at multiple separate priorities
and classifications.  Aside from the user confusion this may cause, additional
problems can arise if the socket is tcp, and the fluctuation in class or
priority causes network re-ordering that results in serious performance
degradation.

The problem is further compounded by processes that use network resources
unknowingly.  For instance,the CIFS file system creates a network socket to a
cifs server in the context of whatever process is writing to that mount point,
and the same socket will subsequently be used by any other processes writing to
that mount.  This socket sharing will almost certainly lead to classification
and priority changes on a single data stream that will degrade file system
throughput.

This patch series is meant to solve the first of these two problems.  It changes
the way in which the priority and net_cls cgroup implementations migrate the
priority and class-id of the sockets each task owns.  specifically this series:

1) adds an cgroup owner pid field to the sock structure
2) assigns the pid of the creating process at the time of sock allocation
3) zeros the owning pid at the time of sk_common_release (to prevent future pid
aliasing
4) adds a cgroup_attach method to each cgroup subsystem which identifies sockets
owned by that task (based on matching the task pid and the pid provided in (2)
to update the priority and class-id appropriately.

This does not solve the anonymous socket use problem (I plan to address that in
a future patch series), but it does allow for a sockets priority and
classification to be controlled by a single pid for the purposes of cgroup
assignment.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Graf <tgraf@infradead.org>
CC: "David S. Miller" <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-12-21 16:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-21 14:39 [PATCH 0/4] net: Improve socket sharing between multiple cgroups Neil Horman
2011-12-21 14:39 ` [PATCH 1/4] net_prio/classid: add cgroup process ownership filter Neil Horman
2011-12-21 14:39 ` [PATCH 2/4] vfs: Export some file manipulation functions Neil Horman
2011-12-21 15:30   ` Christoph Hellwig
2011-12-21 16:42     ` Neil Horman
2011-12-21 14:39 ` [PATCH 3/4] net: use cgroup_attach method to migrate socket priotiy and classid Neil Horman
2011-12-21 15:40   ` Al Viro
2011-12-21 14:39 ` [PATCH 4/4] net: remove no-longer needed calls to sock_update_[classid|netprioix] Neil Horman

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.