[Devel] [PATCH 1/6] SUNRPC: split cache creation and PipeFS registration

2011-11-25 Thread Stanislav Kinsbursky
This precursor patch splits SUNRPC cache creation and PipeFS registartion. It's required for latter split of NFS DNS resolver cache creation per network namespace context and PipeFS registration/unregistration on MOUNT/UMOUNT events. Signed-off-by: Stanislav Kinsbursky --- fs/nfs/cache_lib.c

[Devel] [PATCH 2/6] NFS: split cache creation and PipeFS registration

2011-11-25 Thread Stanislav Kinsbursky
This precursor patch splits NFS cache creation and PipeFS registartion. It's required for latter split of NFS DNS resolver cache creation per network namespace context and PipeFS registration/unregistration on MOUNT/UMOUNT events. Signed-off-by: Stanislav Kinsbursky --- fs/nfs/cache_lib.c |

[Devel] [PATCH 0/6] NFS: create DNS resolver cache per network namespace

2011-11-25 Thread Stanislav Kinsbursky
This patch set was created in context of clone of git branch: git://git.linux-nfs.org/projects/trondmy/nfs-2.6.git. tag: v3.1 This patch set depends on previous patch sets titled: 1) "SUNRPC: initial part of making pipefs work in net ns" 2) "SUNPRC: cleanup PipeFS for network-namespace-aware users

[Devel] [PATCH 3/6] NFS: handle NFS caches dentries by network namespace aware routines

2011-11-25 Thread Stanislav Kinsbursky
This patch makes NFS caches PipeFS dentries allocated and destroyed in network namespace context by PipeFS network namespace aware routines. Signed-off-by: Stanislav Kinsbursky --- fs/nfs/cache_lib.c | 44 +++- fs/nfs/cache_lib.h |4 ++-- fs/nfs

[Devel] [PATCH 5/6] NFS: DNS resolver PipeFS notifier introduced

2011-11-25 Thread Stanislav Kinsbursky
This patch subscribes DNS resolver caches to RPC pipefs notifications. Notifier is registering on NFS module load. This notifier callback is responsible for creation/destruction of PipeFS DNS resolver cache directory. Note that no locking required in notifier callback because PipeFS superblock poin

[Devel] [PATCH 6/6] NFS: remove RPC PipeFS mount point references from NFS cache routines

2011-11-25 Thread Stanislav Kinsbursky
This is a cleanup patch. We don't need this reference anymore, because DNS resolver cache now creates it's dentries in per-net operations and on PipeFS mount/umount notification. Note that nfs_cache_register_net() now returns 0 instead of -ENOENT in case of PiepFS superblock absence. This is ok, Dn

[Devel] [PATCH 4/6] NFS: DNS resolver cache per network namespace context introduced

2011-11-25 Thread Stanislav Kinsbursky
This patch implements DNS resolver cache creation and registration for each alive network namespace context. This was done by registering NFS per-net operations, responsible for DNS cache allocation/register and unregister/destructioning instead of initialization and destruction of static "nfs_dns_

[Devel] [PATCH v6 00/10] Request for inclusion: per-cgroup tcp memory pressure controls

2011-11-25 Thread Glauber Costa
Hi Dave, I hope the following series is in an acceptable state: I modified the tests in __sk_mem_schedule() in a way that we should still leave the function pretty soon under no pressure conditions. Also, I managed to remove almost everything tcp related from memcontrol.c: the only thing left i

[Devel] [PATCH v6 03/10] socket: initial cgroup code.

2011-11-25 Thread Glauber Costa
The goal of this work is to move the memory pressure tcp controls to a cgroup, instead of just relying on global conditions. To avoid excessive overhead in the network fast paths, the code that accounts allocated memory to a cgroup is hidden inside a static_branch(). This branch is patched out unt

[Devel] [PATCH v6 02/10] foundations of per-cgroup memory pressure controlling.

2011-11-25 Thread Glauber Costa
This patch replaces all uses of struct sock fields' memory_pressure, memory_allocated, sockets_allocated, and sysctl_mem to acessor macros. Those macros can either receive a socket argument, or a mem_cgroup argument, depending on the context they live in. Since we're only doing a macro wrapping he

[Devel] [PATCH v6 01/10] Basic kernel memory functionality for the Memory Controller

2011-11-25 Thread Glauber Costa
This patch lays down the foundation for the kernel memory component of the Memory Controller. As of today, I am only laying down the following files: * memory.independent_kmem_limit * memory.kmem.limit_in_bytes (currently ignored) * memory.kmem.usage_in_bytes (always zero) Signed-off-by: Glau

[Devel] [PATCH v6 05/10] per-netns ipv4 sysctl_tcp_mem

2011-11-25 Thread Glauber Costa
This patch allows each namespace to independently set up its levels for tcp memory pressure thresholds. This patch alone does not buy much: we need to make this values per group of process somehow. This is achieved in the patches that follows in this patchset. Signed-off-by: Glauber Costa CC: KAM

[Devel] [PATCH v6 06/10] tcp buffer limitation: per-cgroup limit

2011-11-25 Thread Glauber Costa
This patch uses the "tcp.limit_in_bytes" field of the kmem_cgroup to effectively control the amount of kernel memory pinned by a cgroup. This value is ignored in the root cgroup, and in all others, caps the value specified by the admin in the net namespaces' view of tcp_sysctl_mem. If namespaces

[Devel] [PATCH v6 08/10] Display current tcp failcnt in kmem cgroup

2011-11-25 Thread Glauber Costa
This patch introduces kmem.tcp.failcnt file, living in the kmem_cgroup filesystem. Following the pattern in the other memcg resources, this files keeps a counter of how many times allocation failed due to limits being hit in this cgroup. The root cgroup will always show a failcnt of 0. Signed-off-

[Devel] [PATCH v6 07/10] Display current tcp memory allocation in kmem cgroup

2011-11-25 Thread Glauber Costa
This patch introduces kmem.tcp.usage_in_bytes file, living in the kmem_cgroup filesystem. It is a simple read-only file that displays the amount of kernel memory currently consumed by the cgroup. Signed-off-by: Glauber Costa CC: David S. Miller CC: Hiroyouki Kamezawa CC: Eric W. Biederman ---

[Devel] [PATCH v6 09/10] Display maximum tcp memory allocation in kmem cgroup

2011-11-25 Thread Glauber Costa
This patch introduces kmem.tcp.max_usage_in_bytes file, living in the kmem_cgroup filesystem. The root cgroup will display a value equal to RESOURCE_MAX. This is to avoid introducing any locking schemes in the network paths when cgroups are not being actively used. All others, will see the maximum

[Devel] [PATCH v6 10/10] Disable task moving when using kernel memory accounting

2011-11-25 Thread Glauber Costa
Since this code is still experimental, we are leaving the exact details of how to move tasks between cgroups when kernel memory accounting is used as future work. For now, we simply disallow movement if there are any pending accounted memory. Signed-off-by: Glauber Costa CC: Hiroyouki Kamezawa

[Devel] [PATCH v6 04/10] Account tcp memory as kernel memory

2011-11-25 Thread Glauber Costa
Now that we account and control tcp memory buffers memory for pressure controlling purposes, display this information as part of the normal memcg files and other usages. Signed-off-by: Glauber Costa CC: KAMEZAWA Hiroyuki CC: Eric W. Biederman --- include/linux/memcontrol.h |3 ++ include/n