Re: [PATCH] memcg: clean up migration

From: Daisuke Nishimura
Date: Sun Feb 27 2011 - 21:46:02 EST


> >> @@ -678,13 +675,11 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
> >> Â Â Â }
> >>
> >> Â Â Â /* charge against new page */
> >> - Â Â charge = mem_cgroup_prepare_migration(page, newpage, &mem, GFP_KERNEL);
> >> - Â Â if (charge == -ENOMEM) {
> >> - Â Â Â Â Â Â rc = -ENOMEM;
> >> + Â Â rc = mem_cgroup_prepare_migration(page, newpage, &mem, GFP_KERNEL);
> >> + Â Â if (rc)
> >> Â Â Â Â Â Â Â goto unlock;
> >> - Â Â }
> >> - Â Â BUG_ON(charge);
> >>
> >> + Â Â rc = -EAGAIN;
> >> Â Â Â if (PageWriteback(page)) {
> >> Â Â Â Â Â Â Â if (!force || !sync)
> >> Â Â Â Â Â Â Â Â Â Â Â goto uncharge;
> > How about
> >
> > Â Â Â Âif (mem_cgroup_prepare_migration(..)) {
> > Â Â Â Â Â Â Â Ârc = -ENOMEM;
> > Â Â Â Â Â Â Â Âgoto unlock;
> > Â Â Â Â}
> >
> > ?
> >
> > Re-setting "rc" to -EAGAIN is not necessary in this case.
> > "if (mem_cgroup_...)" is commonly used in many places.
> >
> It works now but Johannes doesn't like it and me, either.
> It makes unnecessary dependency which mem_cgroup_preparre_migration
> can't propagate error to migrate_pages.
> Although we don't need it, I want to remove such unnecessary dependency.
>
I see.
Thank you for your explanation.

Daisuke Nishimura.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/