Re: + memcg-remove-refcnt-from-page_cgroup.patch added to -mm tree

From: KAMEZAWA Hiroyuki
Date: Tue May 20 2008 - 02:31:07 EST


hi, I found a bug in this patch. (A fix is attached below.)

On Thu, 15 May 2008 19:53:17 -0700
akpm@xxxxxxxxxxxxxxxxxxxx wrote:

> +/* remove redundant charge if migration failed*/
> void mem_cgroup_end_migration(struct page *newpage)
> {
> - mem_cgroup_uncharge_page(newpage);
> + /* At success, page->mapping is not NULL */
> + if (newpage->mapping)
> + __mem_cgroup_uncharge_common(newpage,
> + MEM_CGROUP_CHARGE_TYPE_FORCE);
> }
>

Should be if (!newpage->mapping). Maybe a typo in restructuring...

Sorry.
-Kame
==
This rollback should be done at failure.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>

---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: mm-2.6.26-rc2-mm1/mm/memcontrol.c
===================================================================
--- mm-2.6.26-rc2-mm1.orig/mm/memcontrol.c
+++ mm-2.6.26-rc2-mm1/mm/memcontrol.c
@@ -760,8 +760,8 @@ int mem_cgroup_prepare_migration(struct
/* remove redundant charge if migration failed*/
void mem_cgroup_end_migration(struct page *newpage)
{
- /* At success, page->mapping is not NULL */
- if (newpage->mapping)
+ /* At success, page->mapping is not NULL and nothing to do. */
+ if (!newpage->mapping)
__mem_cgroup_uncharge_common(newpage,
MEM_CGROUP_CHARGE_TYPE_FORCE);
}

--
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/