lkml.org 
[lkml]   [2010]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][BUGFIX][PATCH] memcg: fix underflow of mapped_file stat
On Wed, 14 Apr 2010 10:03:08 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:

> > > @@ -2563,6 +2565,15 @@ void mem_cgroup_end_migration(struct mem
> > > */
> > > if (ctype == MEM_CGROUP_CHARGE_TYPE_MAPPED)
> > > mem_cgroup_uncharge_page(target);
> > > + else {
> > > + /*
> > > + * When a migrated file cache is remapped, it's not charged.
> > > + * Verify it. Because we're under lock_page(), there are
> > > + * no race with uncharge.
> > > + */
> > > + if (page_mapped(target))
> > > + mem_cgroup_update_file_mapped(mem, target, 1);
> > > + }
> > We cannot rely on page lock, because when we succeeded in page migration,
> > "target" = "newpage" has already unlocked in move_to_new_page(). So the "target"
> > can be removed from the radix-tree theoretically(it's not related to this
> > underflow problem, though).
> > Shouldn't we call lock_page(target) and check "if (!target->mapping)" to handle
> > this case(maybe in another patch) ?
> >
> Sounds reasonable. I think about that.
>

Ah, PageCgroupUsed() is already checked under lock_page_cgroup(). It's enough.

Thanks,
-Kame




\
 
 \ /
  Last update: 2010-04-14 03:47    [W:0.151 / U:2.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site