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

2011-12-05 Thread Glauber Costa
On 12/04/2011 11:59 PM, KAMEZAWA Hiroyuki wrote: On Fri, 2 Dec 2011 15:46:46 -0200 Glauber Costa wrote: static void proto_seq_printf(struct seq_file *seq, struct proto *proto) { + struct mem_cgroup *memcg = mem_cgroup_from_task(current); + seq_printf(seq, "%-9s %4u %6d %

[Devel] Re: [PATCH v7 00/10] Request for Inclusion: per-cgroup tcp memory pressure

2011-12-05 Thread Glauber Costa
On 12/05/2011 12:06 AM, KAMEZAWA Hiroyuki wrote: On Fri, 2 Dec 2011 16:04:08 -0200 Glauber Costa wrote: On 11/30/2011 12:11 AM, KAMEZAWA Hiroyuki wrote: On Tue, 29 Nov 2011 21:56:51 -0200 Glauber Costa wrote: Hi, This patchset implements per-cgroup tcp memory pressure controls. It did no

[Devel] Re: [PATCH v7 10/10] Disable task moving when using kernel memory accounting

2011-12-05 Thread Glauber Costa
On 12/05/2011 12:18 AM, KAMEZAWA Hiroyuki wrote: On Fri, 2 Dec 2011 16:11:56 -0200 Glauber Costa wrote: On 11/30/2011 12:22 AM, KAMEZAWA Hiroyuki wrote: On Tue, 29 Nov 2011 21:57:01 -0200 Glauber Costa wrote: Since this code is still experimental, we are leaving the exact details of how t

[Devel] How to draw values for /proc/stat

2011-12-05 Thread Glauber Costa
Hi, Specially Peter and Paul, but all the others: As you can see in https://lkml.org/lkml/2011/12/4/178, and in my answer to that, there is a question - one I've asked before but without that much of an audience - of whether /proc files read from process living on cgroups should display globa

[Devel] Re: [PATCH v7 00/10] Request for Inclusion: per-cgroup tcp memory pressure

2011-12-05 Thread KAMEZAWA Hiroyuki
On Mon, 5 Dec 2011 07:09:51 -0200 Glauber Costa wrote: > On 12/05/2011 12:06 AM, KAMEZAWA Hiroyuki wrote: > > On Fri, 2 Dec 2011 16:04:08 -0200 > > Glauber Costa wrote: > > > >> On 11/30/2011 12:11 AM, KAMEZAWA Hiroyuki wrote: > >>> On Tue, 29 Nov 2011 21:56:51 -0200 > >>> Glauber Costa wrote:

[Devel] Re: [PATCH v7 00/10] Request for Inclusion: per-cgroup tcp memory pressure

2011-12-05 Thread Glauber Costa
On 12/05/2011 07:51 AM, KAMEZAWA Hiroyuki wrote: On Mon, 5 Dec 2011 07:09:51 -0200 Glauber Costa wrote: On 12/05/2011 12:06 AM, KAMEZAWA Hiroyuki wrote: On Fri, 2 Dec 2011 16:04:08 -0200 Glauber Costa wrote: On 11/30/2011 12:11 AM, KAMEZAWA Hiroyuki wrote: On Tue, 29 Nov 2011 21:56:51 -0

[Devel] [PATCH v8 0/9] per-cgroup tcp memory pressure controls

2011-12-05 Thread Glauber Costa
Hi, This is my new attempt to fix all the concerns that were raised during the last iteration. I should highlight: 1) proc information is kept intact. (although I kept the wrapper functions) it will be submitted as a follow up patch so it can get the attention it deserves 2) sockets now hol

[Devel] [PATCH v8 2/9] foundations of per-cgroup memory pressure controlling.

2011-12-05 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 v8 1/9] Basic kernel memory functionality for the Memory Controller

2011-12-05 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 v8 3/9] socket: initial cgroup code.

2011-12-05 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 v8 5/9] per-netns ipv4 sysctl_tcp_mem

2011-12-05 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 v8 6/9] tcp buffer limitation: per-cgroup limit

2011-12-05 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 v8 9/9] Display maximum tcp memory allocation in kmem cgroup

2011-12-05 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 v8 7/9] Display current tcp memory allocation in kmem cgroup

2011-12-05 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 Reviewed-by: Hiroyouki Kamezawa CC: David S. Miller CC: Eric W. Bieder

[Devel] [PATCH v8 8/9] Display current tcp failcnt in kmem cgroup

2011-12-05 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 v8 4/9] tcp memory pressure controls

2011-12-05 Thread Glauber Costa
This patch introduces memory pressure controls for the tcp protocol. It uses the generic socket memory pressure code introduced in earlier patches, and fills in the necessary data in cg_proto struct. Signed-off-by: Glauber Costa CC: KAMEZAWA Hiroyuki CC: Eric W. Biederman --- Documentation/cgr

[Devel] Re: How to draw values for /proc/stat

2011-12-05 Thread KAMEZAWA Hiroyuki
On Mon, 5 Dec 2011 07:32:33 -0200 Glauber Costa wrote: > Hi, > > Specially Peter and Paul, but all the others: > > As you can see in https://lkml.org/lkml/2011/12/4/178, and in my answer > to that, there is a question - one I've asked before but without that > much of an audience - of whether

[Devel] Re: [PATCH v7 10/10] Disable task moving when using kernel memory accounting

2011-12-05 Thread KAMEZAWA Hiroyuki
On Mon, 5 Dec 2011 07:18:37 -0200 Glauber Costa wrote: > On 12/05/2011 12:18 AM, KAMEZAWA Hiroyuki wrote: > > On Fri, 2 Dec 2011 16:11:56 -0200 > > Glauber Costa wrote: > > > >> On 11/30/2011 12:22 AM, KAMEZAWA Hiroyuki wrote: > >>> On Tue, 29 Nov 2011 21:57:01 -0200 > >>> Glauber Costa wrote:

[Devel] Re: How to draw values for /proc/stat

2011-12-05 Thread Glauber Costa
On 12/05/2011 10:05 PM, KAMEZAWA Hiroyuki wrote: On Mon, 5 Dec 2011 07:32:33 -0200 Glauber Costa wrote: Hi, Specially Peter and Paul, but all the others: As you can see in https://lkml.org/lkml/2011/12/4/178, and in my answer to that, there is a question - one I've asked before but without t

Re: [Devel] [PATCH 0/7] Profiling sleep times (v3)

2011-12-05 Thread Andrey Vagin
Hello Arnaldo, I found, that you commit patches for perf. Could you review this part? Arun Sharma said, that the second versions of patches works ok for him. (Arun is the first user of this functionality after me.) Thanks. On 11/28/2011 01:03 PM, Andrew Vagin wrote: Do you want to know where