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



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/



Relevant Pages

  • Re: 2.6.27-rc5-mm1
    ... See the `hot-fixes' directory for any important updates to this patchset. ... If you hit a bug in -mm and it is not obvious which patch caused it, ... ALSA fix ...
    (Linux-Kernel)
  • 2.6.27-rc1-mm1
    ... See the `hot-fixes' directory for any important updates to this patchset. ... If you hit a bug in -mm and it is not obvious which patch caused it, ... CIFS fix ...
    (Linux-Kernel)
  • Re: thoughts on kernel security issues
    ... having two independent patches that fix them is STILL better. ... Take it from me - I've been reviewing patches for _way_ too long. ... have a clue ("try reverting that one patch") or you can do things like ... Which is why lots of small patches usually have _different_ bug behaviour ...
    (Linux-Kernel)
  • 2.6.22-rc4-mm2
    ... trees were repulled, several bad patches were dropped, a few were fixed. ... If you hit a bug in -mm and it is not obvious which patch caused it, ... wireless sparse fix ...
    (Linux-Kernel)
  • 2.6.17-rc4-mm3
    ... If you hit a bug in -mm and it is not obvious which patch caused it, ... Driver tree updates ... Fix reject in git-nfs.patch. ...
    (Linux-Kernel)