Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-23 Thread Glauber Costa
>>> Perhaps we're just trying to take a conservative initial implementation >>> which is consistent with user visible pages. >>> >> >> The way I see it, is not about being conservative, but rather about my >> physical safety. It is quite easy and natural to assume that "all >> modifications to

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-23 Thread Glauber Costa
Perhaps we're just trying to take a conservative initial implementation which is consistent with user visible pages. The way I see it, is not about being conservative, but rather about my physical safety. It is quite easy and natural to assume that all modifications to page cgroup are done

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-22 Thread Greg Thelen
On Wed, Aug 22 2012, Glauber Costa wrote: > On 08/22/2012 01:50 AM, Greg Thelen wrote: >> On Thu, Aug 09 2012, Glauber Costa wrote: >> >>> This patch introduces infrastructure for tracking kernel memory pages to >>> a given memcg. This will happen whenever the caller includes the flag >>>

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-22 Thread Glauber Costa
On 08/22/2012 01:50 AM, Greg Thelen wrote: > On Thu, Aug 09 2012, Glauber Costa wrote: > >> This patch introduces infrastructure for tracking kernel memory pages to >> a given memcg. This will happen whenever the caller includes the flag >> __GFP_KMEMCG flag, and the task belong to a memcg other

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-22 Thread Glauber Costa
On 08/22/2012 01:50 AM, Greg Thelen wrote: On Thu, Aug 09 2012, Glauber Costa wrote: This patch introduces infrastructure for tracking kernel memory pages to a given memcg. This will happen whenever the caller includes the flag __GFP_KMEMCG flag, and the task belong to a memcg other than the

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-22 Thread Greg Thelen
On Wed, Aug 22 2012, Glauber Costa wrote: On 08/22/2012 01:50 AM, Greg Thelen wrote: On Thu, Aug 09 2012, Glauber Costa wrote: This patch introduces infrastructure for tracking kernel memory pages to a given memcg. This will happen whenever the caller includes the flag __GFP_KMEMCG flag,

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-21 Thread Greg Thelen
On Thu, Aug 09 2012, Glauber Costa wrote: > This patch introduces infrastructure for tracking kernel memory pages to > a given memcg. This will happen whenever the caller includes the flag > __GFP_KMEMCG flag, and the task belong to a memcg other than the root. > > In memcontrol.h those functions

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-21 Thread Greg Thelen
On Thu, Aug 09 2012, Glauber Costa wrote: This patch introduces infrastructure for tracking kernel memory pages to a given memcg. This will happen whenever the caller includes the flag __GFP_KMEMCG flag, and the task belong to a memcg other than the root. In memcontrol.h those functions are

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-20 Thread Glauber Costa
On 08/20/2012 05:36 PM, Kamezawa Hiroyuki wrote: > (2012/08/16 2:00), Glauber Costa wrote: >> On 08/15/2012 08:38 PM, Greg Thelen wrote: >>> On Wed, Aug 15 2012, Glauber Costa wrote: >>> On 08/14/2012 10:58 PM, Greg Thelen wrote: > On Mon, Aug 13 2012, Glauber Costa wrote: > >

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-20 Thread Kamezawa Hiroyuki
(2012/08/16 2:00), Glauber Costa wrote: On 08/15/2012 08:38 PM, Greg Thelen wrote: On Wed, Aug 15 2012, Glauber Costa wrote: On 08/14/2012 10:58 PM, Greg Thelen wrote: On Mon, Aug 13 2012, Glauber Costa wrote: + WARN_ON(mem_cgroup_is_root(memcg)); + size = (1 << order) <<

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-20 Thread Kamezawa Hiroyuki
(2012/08/16 2:00), Glauber Costa wrote: On 08/15/2012 08:38 PM, Greg Thelen wrote: On Wed, Aug 15 2012, Glauber Costa wrote: On 08/14/2012 10:58 PM, Greg Thelen wrote: On Mon, Aug 13 2012, Glauber Costa wrote: + WARN_ON(mem_cgroup_is_root(memcg)); + size = (1 order)

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-20 Thread Glauber Costa
On 08/20/2012 05:36 PM, Kamezawa Hiroyuki wrote: (2012/08/16 2:00), Glauber Costa wrote: On 08/15/2012 08:38 PM, Greg Thelen wrote: On Wed, Aug 15 2012, Glauber Costa wrote: On 08/14/2012 10:58 PM, Greg Thelen wrote: On Mon, Aug 13 2012, Glauber Costa wrote: +

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-17 Thread Glauber Costa
On 08/17/2012 06:36 AM, Kamezawa Hiroyuki wrote: > I just want to see the same logic used in mem_cgroup_uncharge_common(). > Hmm, at setting pc->mem_cgroup, the things happens in >set pc->mem_cgroup >set Used bit > order. If you clear pc->mem_cgroup >unset Used bit >clear

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-17 Thread Glauber Costa
On 08/17/2012 06:36 AM, Kamezawa Hiroyuki wrote: I just want to see the same logic used in mem_cgroup_uncharge_common(). Hmm, at setting pc-mem_cgroup, the things happens in set pc-mem_cgroup set Used bit order. If you clear pc-mem_cgroup unset Used bit clear pc-mem_cgroup

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-16 Thread Kamezawa Hiroyuki
(2012/08/13 17:28), Glauber Costa wrote: + * Needs to be called after memcg_kmem_new_page, regardless of success or + * failure of the allocation. if @page is NULL, this function will revert the + * charges. Otherwise, it will commit the memcg given by @handle to the + *

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-16 Thread Glauber Costa
On 08/16/2012 07:05 PM, Michal Hocko wrote: > On Thu 16-08-12 13:57:07, Glauber Costa wrote: >> On 08/16/2012 01:53 PM, Michal Hocko wrote: >>> On Wed 15-08-12 18:27:45, Glauber Costa wrote: >> >> I see now, you seem to be right. > > No I am not because it seems that I am

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-16 Thread Michal Hocko
On Thu 16-08-12 13:57:07, Glauber Costa wrote: > On 08/16/2012 01:53 PM, Michal Hocko wrote: > > On Wed 15-08-12 18:27:45, Glauber Costa wrote: > >> > > I see now, you seem to be right. > >>> > >>> No I am not because it seems that I am really blind these days... > >>> We were doing this

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-16 Thread Glauber Costa
On 08/16/2012 01:53 PM, Michal Hocko wrote: > On Wed 15-08-12 18:27:45, Glauber Costa wrote: >> I see now, you seem to be right. >>> >>> No I am not because it seems that I am really blind these days... >>> We were doing this in mem_cgroup_do_charge for ages: >>> if (!(gfp_mask &

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-16 Thread Michal Hocko
On Wed 15-08-12 18:27:45, Glauber Costa wrote: > > >> > >> I see now, you seem to be right. > > > > No I am not because it seems that I am really blind these days... > > We were doing this in mem_cgroup_do_charge for ages: > > if (!(gfp_mask & __GFP_WAIT)) > > return

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-16 Thread Glauber Costa
On 08/16/2012 07:37 AM, Greg Thelen wrote: > On Wed, Aug 15 2012, Glauber Costa wrote: > >> On 08/15/2012 09:12 PM, Greg Thelen wrote: >>> On Wed, Aug 15 2012, Glauber Costa wrote: >>> On 08/15/2012 08:38 PM, Greg Thelen wrote: > On Wed, Aug 15 2012, Glauber Costa wrote: > >> On

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-16 Thread Glauber Costa
On 08/16/2012 07:37 AM, Greg Thelen wrote: On Wed, Aug 15 2012, Glauber Costa wrote: On 08/15/2012 09:12 PM, Greg Thelen wrote: On Wed, Aug 15 2012, Glauber Costa wrote: On 08/15/2012 08:38 PM, Greg Thelen wrote: On Wed, Aug 15 2012, Glauber Costa wrote: On 08/14/2012 10:58 PM, Greg

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-16 Thread Michal Hocko
On Wed 15-08-12 18:27:45, Glauber Costa wrote: I see now, you seem to be right. No I am not because it seems that I am really blind these days... We were doing this in mem_cgroup_do_charge for ages: if (!(gfp_mask __GFP_WAIT)) return CHARGE_WOULDBLOCK;

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-16 Thread Glauber Costa
On 08/16/2012 01:53 PM, Michal Hocko wrote: On Wed 15-08-12 18:27:45, Glauber Costa wrote: I see now, you seem to be right. No I am not because it seems that I am really blind these days... We were doing this in mem_cgroup_do_charge for ages: if (!(gfp_mask __GFP_WAIT))

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-16 Thread Michal Hocko
On Thu 16-08-12 13:57:07, Glauber Costa wrote: On 08/16/2012 01:53 PM, Michal Hocko wrote: On Wed 15-08-12 18:27:45, Glauber Costa wrote: I see now, you seem to be right. No I am not because it seems that I am really blind these days... We were doing this in mem_cgroup_do_charge for

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-16 Thread Glauber Costa
On 08/16/2012 07:05 PM, Michal Hocko wrote: On Thu 16-08-12 13:57:07, Glauber Costa wrote: On 08/16/2012 01:53 PM, Michal Hocko wrote: On Wed 15-08-12 18:27:45, Glauber Costa wrote: I see now, you seem to be right. No I am not because it seems that I am really blind these days... We were

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-16 Thread Kamezawa Hiroyuki
(2012/08/13 17:28), Glauber Costa wrote: + * Needs to be called after memcg_kmem_new_page, regardless of success or + * failure of the allocation. if @page is NULL, this function will revert the + * charges. Otherwise, it will commit the memcg given by @handle to the + * corresponding

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Greg Thelen
On Wed, Aug 15 2012, Glauber Costa wrote: > On 08/15/2012 09:12 PM, Greg Thelen wrote: >> On Wed, Aug 15 2012, Glauber Costa wrote: >> >>> On 08/15/2012 08:38 PM, Greg Thelen wrote: On Wed, Aug 15 2012, Glauber Costa wrote: > On 08/14/2012 10:58 PM, Greg Thelen wrote: >> On

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Glauber Costa
On 08/15/2012 09:12 PM, Greg Thelen wrote: > On Wed, Aug 15 2012, Glauber Costa wrote: > >> On 08/15/2012 08:38 PM, Greg Thelen wrote: >>> On Wed, Aug 15 2012, Glauber Costa wrote: >>> On 08/14/2012 10:58 PM, Greg Thelen wrote: > On Mon, Aug 13 2012, Glauber Costa wrote: > >

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Greg Thelen
On Wed, Aug 15 2012, Glauber Costa wrote: > On 08/15/2012 08:38 PM, Greg Thelen wrote: >> On Wed, Aug 15 2012, Glauber Costa wrote: >> >>> On 08/14/2012 10:58 PM, Greg Thelen wrote: On Mon, Aug 13 2012, Glauber Costa wrote: + WARN_ON(mem_cgroup_is_root(memcg)); +

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Glauber Costa
On 08/15/2012 08:38 PM, Greg Thelen wrote: > On Wed, Aug 15 2012, Glauber Costa wrote: > >> On 08/14/2012 10:58 PM, Greg Thelen wrote: >>> On Mon, Aug 13 2012, Glauber Costa wrote: >>> >>> + WARN_ON(mem_cgroup_is_root(memcg)); >>> + size = (1 << order) << PAGE_SHIFT; >>> +

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Greg Thelen
On Wed, Aug 15 2012, Glauber Costa wrote: > On 08/14/2012 10:58 PM, Greg Thelen wrote: >> On Mon, Aug 13 2012, Glauber Costa wrote: >> >> +WARN_ON(mem_cgroup_is_root(memcg)); >> +size = (1 << order) << PAGE_SHIFT; >> +memcg_uncharge_kmem(memcg, size); >> +

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Glauber Costa
>> >> I see now, you seem to be right. > > No I am not because it seems that I am really blind these days... > We were doing this in mem_cgroup_do_charge for ages: > if (!(gfp_mask & __GFP_WAIT)) > return CHARGE_WOULDBLOCK; > > /me goes to hide and get with further

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Michal Hocko
On Wed 15-08-12 18:01:51, Glauber Costa wrote: > On 08/15/2012 05:09 PM, Michal Hocko wrote: > > On Wed 15-08-12 13:42:24, Glauber Costa wrote: > > [...] > + > +ret = 0; > + > +if (!memcg) > +return ret; > + > +_memcg =

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Glauber Costa
On 08/15/2012 05:09 PM, Michal Hocko wrote: > On Wed 15-08-12 13:42:24, Glauber Costa wrote: > [...] + + ret = 0; + + if (!memcg) + return ret; + + _memcg = memcg; + ret = __mem_cgroup_try_charge(NULL, gfp, delta / PAGE_SIZE, +

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Michal Hocko
On Wed 15-08-12 13:42:24, Glauber Costa wrote: [...] > >> + > >> + ret = 0; > >> + > >> + if (!memcg) > >> + return ret; > >> + > >> + _memcg = memcg; > >> + ret = __mem_cgroup_try_charge(NULL, gfp, delta / PAGE_SIZE, > >> + &_memcg, may_oom); > > > > This is really dangerous

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Glauber Costa
On 08/15/2012 01:42 PM, Glauber Costa wrote: >> Also, as I >> > have mentioned in the other email in this thread. Why should we reclaim >> > just because of kernel allocation when we are not reclaiming any of it >> > because shrink_slab is ignored in the memcg reclaim. > > Don't get too

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Glauber Costa
>> + * memcg_kmem_new_page: verify if a new kmem allocation is allowed. >> + * @gfp: the gfp allocation flags. >> + * @handle: a pointer to the memcg this was charged against. >> + * @order: allocation order. >> + * >> + * returns true if the memcg where the current task belongs can hold this >>

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Glauber Costa
On 08/14/2012 10:58 PM, Greg Thelen wrote: > On Mon, Aug 13 2012, Glauber Costa wrote: > > + WARN_ON(mem_cgroup_is_root(memcg)); > + size = (1 << order) << PAGE_SHIFT; > + memcg_uncharge_kmem(memcg, size); > + mem_cgroup_put(memcg); >>> Why do we need ref-counting here ? kmem

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Glauber Costa
On 08/14/2012 10:58 PM, Greg Thelen wrote: On Mon, Aug 13 2012, Glauber Costa wrote: + WARN_ON(mem_cgroup_is_root(memcg)); + size = (1 order) PAGE_SHIFT; + memcg_uncharge_kmem(memcg, size); + mem_cgroup_put(memcg); Why do we need ref-counting here ? kmem res_counter cannot work as

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Glauber Costa
+ * memcg_kmem_new_page: verify if a new kmem allocation is allowed. + * @gfp: the gfp allocation flags. + * @handle: a pointer to the memcg this was charged against. + * @order: allocation order. + * + * returns true if the memcg where the current task belongs can hold this + *

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Glauber Costa
On 08/15/2012 01:42 PM, Glauber Costa wrote: Also, as I have mentioned in the other email in this thread. Why should we reclaim just because of kernel allocation when we are not reclaiming any of it because shrink_slab is ignored in the memcg reclaim. Don't get too distracted by the fact

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Michal Hocko
On Wed 15-08-12 13:42:24, Glauber Costa wrote: [...] + + ret = 0; + + if (!memcg) + return ret; + + _memcg = memcg; + ret = __mem_cgroup_try_charge(NULL, gfp, delta / PAGE_SIZE, + _memcg, may_oom); This is really dangerous because atomic allocation which

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Glauber Costa
On 08/15/2012 05:09 PM, Michal Hocko wrote: On Wed 15-08-12 13:42:24, Glauber Costa wrote: [...] + + ret = 0; + + if (!memcg) + return ret; + + _memcg = memcg; + ret = __mem_cgroup_try_charge(NULL, gfp, delta / PAGE_SIZE, + _memcg, may_oom); This is really dangerous

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Michal Hocko
On Wed 15-08-12 18:01:51, Glauber Costa wrote: On 08/15/2012 05:09 PM, Michal Hocko wrote: On Wed 15-08-12 13:42:24, Glauber Costa wrote: [...] + +ret = 0; + +if (!memcg) +return ret; + +_memcg = memcg; +ret =

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Glauber Costa
I see now, you seem to be right. No I am not because it seems that I am really blind these days... We were doing this in mem_cgroup_do_charge for ages: if (!(gfp_mask __GFP_WAIT)) return CHARGE_WOULDBLOCK; /me goes to hide and get with further feedback with a

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Greg Thelen
On Wed, Aug 15 2012, Glauber Costa wrote: On 08/14/2012 10:58 PM, Greg Thelen wrote: On Mon, Aug 13 2012, Glauber Costa wrote: +WARN_ON(mem_cgroup_is_root(memcg)); +size = (1 order) PAGE_SHIFT; +memcg_uncharge_kmem(memcg, size); +mem_cgroup_put(memcg);

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Glauber Costa
On 08/15/2012 08:38 PM, Greg Thelen wrote: On Wed, Aug 15 2012, Glauber Costa wrote: On 08/14/2012 10:58 PM, Greg Thelen wrote: On Mon, Aug 13 2012, Glauber Costa wrote: + WARN_ON(mem_cgroup_is_root(memcg)); + size = (1 order) PAGE_SHIFT; + memcg_uncharge_kmem(memcg,

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Greg Thelen
On Wed, Aug 15 2012, Glauber Costa wrote: On 08/15/2012 08:38 PM, Greg Thelen wrote: On Wed, Aug 15 2012, Glauber Costa wrote: On 08/14/2012 10:58 PM, Greg Thelen wrote: On Mon, Aug 13 2012, Glauber Costa wrote: + WARN_ON(mem_cgroup_is_root(memcg)); + size = (1 order)

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Glauber Costa
On 08/15/2012 09:12 PM, Greg Thelen wrote: On Wed, Aug 15 2012, Glauber Costa wrote: On 08/15/2012 08:38 PM, Greg Thelen wrote: On Wed, Aug 15 2012, Glauber Costa wrote: On 08/14/2012 10:58 PM, Greg Thelen wrote: On Mon, Aug 13 2012, Glauber Costa wrote: +

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-15 Thread Greg Thelen
On Wed, Aug 15 2012, Glauber Costa wrote: On 08/15/2012 09:12 PM, Greg Thelen wrote: On Wed, Aug 15 2012, Glauber Costa wrote: On 08/15/2012 08:38 PM, Greg Thelen wrote: On Wed, Aug 15 2012, Glauber Costa wrote: On 08/14/2012 10:58 PM, Greg Thelen wrote: On Mon, Aug 13 2012, Glauber

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-14 Thread Greg Thelen
On Mon, Aug 13 2012, Glauber Costa wrote: >>> > + WARN_ON(mem_cgroup_is_root(memcg)); >>> > + size = (1 << order) << PAGE_SHIFT; >>> > + memcg_uncharge_kmem(memcg, size); >>> > + mem_cgroup_put(memcg); >> Why do we need ref-counting here ? kmem res_counter cannot work as >> reference ? > This is

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-14 Thread Michal Hocko
On Thu 09-08-12 17:01:14, Glauber Costa wrote: > This patch introduces infrastructure for tracking kernel memory pages to > a given memcg. This will happen whenever the caller includes the flag > __GFP_KMEMCG flag, and the task belong to a memcg other than the root. > > In memcontrol.h those

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-14 Thread Glauber Costa
On 08/10/2012 09:27 PM, Kamezawa Hiroyuki wrote: >> +bool __memcg_kmem_new_page(gfp_t gfp, void *_handle, int order) >> > +{ >> > + struct mem_cgroup *memcg; >> > + struct mem_cgroup **handle = (struct mem_cgroup **)_handle; >> > + bool ret = true; >> > + size_t size; >> > + struct

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-14 Thread Glauber Costa
On 08/10/2012 09:27 PM, Kamezawa Hiroyuki wrote: +bool __memcg_kmem_new_page(gfp_t gfp, void *_handle, int order) +{ + struct mem_cgroup *memcg; + struct mem_cgroup **handle = (struct mem_cgroup **)_handle; + bool ret = true; + size_t size; + struct task_struct *p; + +

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-14 Thread Michal Hocko
On Thu 09-08-12 17:01:14, Glauber Costa wrote: This patch introduces infrastructure for tracking kernel memory pages to a given memcg. This will happen whenever the caller includes the flag __GFP_KMEMCG flag, and the task belong to a memcg other than the root. In memcontrol.h those functions

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-14 Thread Greg Thelen
On Mon, Aug 13 2012, Glauber Costa wrote: + WARN_ON(mem_cgroup_is_root(memcg)); + size = (1 order) PAGE_SHIFT; + memcg_uncharge_kmem(memcg, size); + mem_cgroup_put(memcg); Why do we need ref-counting here ? kmem res_counter cannot work as reference ? This is of course the pair of the

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-13 Thread Greg Thelen
On Mon, Aug 13 2012, Glauber Costa wrote: >> >> Here's the dmesg splat. >> > > Do you always get this report in the same way? > I managed to get a softirq inconsistency like yours, but the complaint > goes for a different lock. Yes, I repeatedly get the same dmesg splat below. Once I your

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-13 Thread Glauber Costa
> > Here's the dmesg splat. > Do you always get this report in the same way? I managed to get a softirq inconsistency like yours, but the complaint goes for a different lock. > [ 335.550398] = > [ 335.554739] [ INFO: inconsistent lock state ] > [ 335.559091]

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-13 Thread Glauber Costa
>> > + * Needs to be called after memcg_kmem_new_page, regardless of success or >> > + * failure of the allocation. if @page is NULL, this function will revert >> > the >> > + * charges. Otherwise, it will commit the memcg given by @handle to the >> > + * corresponding page_cgroup. >> > + */ >> >

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-13 Thread Glauber Costa
On 08/11/2012 09:11 AM, Greg Thelen wrote: > On Thu, Aug 09 2012, Glauber Costa wrote: > >> This patch introduces infrastructure for tracking kernel memory pages to >> a given memcg. This will happen whenever the caller includes the flag >> __GFP_KMEMCG flag, and the task belong to a memcg other

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-13 Thread Glauber Costa
On 08/11/2012 09:11 AM, Greg Thelen wrote: On Thu, Aug 09 2012, Glauber Costa wrote: This patch introduces infrastructure for tracking kernel memory pages to a given memcg. This will happen whenever the caller includes the flag __GFP_KMEMCG flag, and the task belong to a memcg other than the

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-13 Thread Glauber Costa
+ * Needs to be called after memcg_kmem_new_page, regardless of success or + * failure of the allocation. if @page is NULL, this function will revert the + * charges. Otherwise, it will commit the memcg given by @handle to the + * corresponding page_cgroup. + */ +static

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-13 Thread Glauber Costa
Here's the dmesg splat. Do you always get this report in the same way? I managed to get a softirq inconsistency like yours, but the complaint goes for a different lock. [ 335.550398] = [ 335.554739] [ INFO: inconsistent lock state ] [ 335.559091]

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-13 Thread Greg Thelen
On Mon, Aug 13 2012, Glauber Costa wrote: Here's the dmesg splat. Do you always get this report in the same way? I managed to get a softirq inconsistency like yours, but the complaint goes for a different lock. Yes, I repeatedly get the same dmesg splat below. Once I your 'execute the

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-10 Thread Greg Thelen
On Thu, Aug 09 2012, Glauber Costa wrote: > This patch introduces infrastructure for tracking kernel memory pages to > a given memcg. This will happen whenever the caller includes the flag > __GFP_KMEMCG flag, and the task belong to a memcg other than the root. > > In memcontrol.h those functions

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-10 Thread Kamezawa Hiroyuki
(2012/08/09 22:01), Glauber Costa wrote: > This patch introduces infrastructure for tracking kernel memory pages to > a given memcg. This will happen whenever the caller includes the flag > __GFP_KMEMCG flag, and the task belong to a memcg other than the root. > > In memcontrol.h those functions

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-10 Thread Kamezawa Hiroyuki
(2012/08/09 22:01), Glauber Costa wrote: This patch introduces infrastructure for tracking kernel memory pages to a given memcg. This will happen whenever the caller includes the flag __GFP_KMEMCG flag, and the task belong to a memcg other than the root. In memcontrol.h those functions are

Re: [PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-10 Thread Greg Thelen
On Thu, Aug 09 2012, Glauber Costa wrote: This patch introduces infrastructure for tracking kernel memory pages to a given memcg. This will happen whenever the caller includes the flag __GFP_KMEMCG flag, and the task belong to a memcg other than the root. In memcontrol.h those functions are

[PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-09 Thread Glauber Costa
This patch introduces infrastructure for tracking kernel memory pages to a given memcg. This will happen whenever the caller includes the flag __GFP_KMEMCG flag, and the task belong to a memcg other than the root. In memcontrol.h those functions are wrapped in inline accessors. The idea is to

[PATCH v2 06/11] memcg: kmem controller infrastructure

2012-08-09 Thread Glauber Costa
This patch introduces infrastructure for tracking kernel memory pages to a given memcg. This will happen whenever the caller includes the flag __GFP_KMEMCG flag, and the task belong to a memcg other than the root. In memcontrol.h those functions are wrapped in inline accessors. The idea is to