Re: [PATCH] memcg: Add memory.pressure_level events

2013-02-13 Thread Greg Thelen
On Tue, Feb 12 2013, Anton Vorontsov wrote: > Hi Greg, > > Thanks for taking a look! > > On Tue, Feb 12, 2013 at 10:42:51PM -0800, Greg Thelen wrote: > [...] >> > +static bool vmpressure_event(struct vmpressure *vmpr, >> > + unsigned long s, unsigned long r) >> > +{ >> > +

Re: [PATCH] memcg: Add memory.pressure_level events

2013-02-13 Thread Kamezawa Hiroyuki
Hi, (2013/02/11 9:02), Anton Vorontsov wrote: diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index addb1f1..006ef58 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt @@ -40,6 +40,7 @@ Features: - soft limit - moving

Re: [PATCH] memcg: Add memory.pressure_level events

2013-02-13 Thread Kamezawa Hiroyuki
Hi, (2013/02/11 9:02), Anton Vorontsov wrote: diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index addb1f1..006ef58 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt @@ -40,6 +40,7 @@ Features: - soft limit - moving

Re: [PATCH] memcg: Add memory.pressure_level events

2013-02-13 Thread Greg Thelen
On Tue, Feb 12 2013, Anton Vorontsov wrote: Hi Greg, Thanks for taking a look! On Tue, Feb 12, 2013 at 10:42:51PM -0800, Greg Thelen wrote: [...] +static bool vmpressure_event(struct vmpressure *vmpr, + unsigned long s, unsigned long r) +{ + struct

Re: [PATCH] memcg: Add memory.pressure_level events

2013-02-12 Thread Glauber Costa
>>> +void __init enable_pressure_cgroup(void) >>> +{ >>> + WARN_ON(cgroup_add_cftypes(_cgroup_subsys, >>> + vmpressure_cgroup_files)); >>> +} >> >> There is no functionality discovery going on here, and this is >> conditional on nothing. Isn't it better then to just

Re: [PATCH] memcg: Add memory.pressure_level events

2013-02-12 Thread Greg Thelen
On Sun, Feb 10 2013, Anton Vorontsov wrote: > With this patch userland applications that want to maintain the > interactivity/memory allocation cost can use the new pressure level > notifications. The levels are defined like this: > > The "low" level means that the system is reclaiming memory for

Re: [PATCH] memcg: Add memory.pressure_level events

2013-02-12 Thread Anton Vorontsov
Hi Glauber, On Mon, Feb 11, 2013 at 02:17:06PM +0400, Glauber Costa wrote: [...] > > +static struct vmpressure *vmpressure_parent(struct vmpressure *vmpr) > > +{ > > + struct cgroup *cg = vmpr_to_css(vmpr)->cgroup->parent; > > + > > + if (!cg) > > + return NULL; > > + return

Re: [PATCH] memcg: Add memory.pressure_level events

2013-02-12 Thread Anton Vorontsov
Hi Greg, Thanks for taking a look! On Tue, Feb 12, 2013 at 10:42:51PM -0800, Greg Thelen wrote: [...] > > +static unsigned long vmpressure_calc_level(unsigned int win, > > + unsigned int s, unsigned int r) > > Should seems like the return type of this

Re: [PATCH] memcg: Add memory.pressure_level events

2013-02-12 Thread Anton Vorontsov
Hi Greg, Thanks for taking a look! On Tue, Feb 12, 2013 at 10:42:51PM -0800, Greg Thelen wrote: [...] +static unsigned long vmpressure_calc_level(unsigned int win, + unsigned int s, unsigned int r) Should seems like the return type of this function

Re: [PATCH] memcg: Add memory.pressure_level events

2013-02-12 Thread Anton Vorontsov
Hi Glauber, On Mon, Feb 11, 2013 at 02:17:06PM +0400, Glauber Costa wrote: [...] +static struct vmpressure *vmpressure_parent(struct vmpressure *vmpr) +{ + struct cgroup *cg = vmpr_to_css(vmpr)-cgroup-parent; + + if (!cg) + return NULL; + return cg_to_vmpr(cg); +}

Re: [PATCH] memcg: Add memory.pressure_level events

2013-02-12 Thread Greg Thelen
On Sun, Feb 10 2013, Anton Vorontsov wrote: With this patch userland applications that want to maintain the interactivity/memory allocation cost can use the new pressure level notifications. The levels are defined like this: The low level means that the system is reclaiming memory for new

Re: [PATCH] memcg: Add memory.pressure_level events

2013-02-12 Thread Glauber Costa
+void __init enable_pressure_cgroup(void) +{ + WARN_ON(cgroup_add_cftypes(mem_cgroup_subsys, + vmpressure_cgroup_files)); +} There is no functionality discovery going on here, and this is conditional on nothing. Isn't it better then to just add the register

Re: [PATCH] memcg: Add memory.pressure_level events

2013-02-11 Thread Glauber Costa
Hi Anton, > diff --git a/mm/vmpressure.c b/mm/vmpressure.c > new file mode 100644 > index 000..7922503 > +struct vmpressure_event { > + struct eventfd_ctx *efd; > + enum vmpressure_levels level; > + struct list_head node; > +}; > + > +static bool vmpressure_event(struct

Re: [PATCH] memcg: Add memory.pressure_level events

2013-02-11 Thread Glauber Costa
Hi Anton, diff --git a/mm/vmpressure.c b/mm/vmpressure.c new file mode 100644 index 000..7922503 +struct vmpressure_event { + struct eventfd_ctx *efd; + enum vmpressure_levels level; + struct list_head node; +}; + +static bool vmpressure_event(struct vmpressure *vmpr,

[PATCH] memcg: Add memory.pressure_level events

2013-02-10 Thread Anton Vorontsov
With this patch userland applications that want to maintain the interactivity/memory allocation cost can use the new pressure level notifications. The levels are defined like this: The "low" level means that the system is reclaiming memory for new allocations. Monitoring reclaiming activity might

[PATCH] memcg: Add memory.pressure_level events

2013-02-10 Thread Anton Vorontsov
With this patch userland applications that want to maintain the interactivity/memory allocation cost can use the new pressure level notifications. The levels are defined like this: The low level means that the system is reclaiming memory for new allocations. Monitoring reclaiming activity might