Re: [PATCH] memcg: fix swapcache charge from kernel thread context

From: Michal Hocko
Date: Mon May 19 2014 - 11:45:33 EST


On Mon 19-05-14 08:49:47, Johannes Weiner wrote:
> On Mon, May 19, 2014 at 10:27:56AM +0200, Michal Hocko wrote:
[...]
> > [1] - http://marc.info/?l=linux-mm&m=139463617808941&w=2
> >
> > Fixes: 03583f1a631c (3.15-rc1)
>
> Shouldn't this be the same format as other commit references?
>
> Fixes: 03583f1a631c ("memcg: remove unnecessary !mm check from try_get_mem_cgroup_from_mm()")

No idea, I just wanted to make clear to which kernel this applies to.
But other users seem to use the long version as above. So I will change
it.

> > Reported-and-tested-by: Stephan Kulow <coolo@xxxxxxxx>
> > Reported-by: Branimir Maksimovic <branimir.maksimovic@xxxxxxxxx>
> > Signed-off-by: Michal Hocko <mhocko@xxxxxxx>
> > ---
> > mm/memcontrol.c | 26 +++++++++++++-------------
> > 1 file changed, 13 insertions(+), 13 deletions(-)
> >
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 2cb81478d30c..2248a648a127 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -1061,9 +1061,17 @@ static struct mem_cgroup *get_mem_cgroup_from_mm(struct mm_struct *mm)
> >
> > rcu_read_lock();
> > do {
> > - memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
> > - if (unlikely(!memcg))
> > + /*
> > + * Page cache or loopback insertions can happen without an
> > + * actual mm context, e.g. during disk probing on boot
> > + */
>
> Please include the other usecases:
>
> /*
> * Page cache insertions can happen without an
> * actual mm context, e.g. during disk probing
> * on boot, loopback IO, acct() writes etc.
> */

OK.

> Otherwise,
> Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx>

Thanks!

---