Re: [PATCH][BUGFIX] memcg: fix leak of accounting at failure path ofhugepage collapsing.

From: Minchan Kim
Date: Wed Feb 09 2011 - 21:49:25 EST


On Wed, Feb 9, 2011 at 4:23 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
> There was a big bug. Anyway, thank you for adding new bad_page for memcg.
> ==
>
> mem_cgroup_uncharge_page() should be called in all failure case
> after mem_cgroup_charge_newpage() is called in
> huge_memory.c::collapse_huge_page()
>
> Â[ 4209.076861] BUG: Bad page state in process khugepaged Âpfn:1e9800
> Â[ 4209.077601] page:ffffea0006b14000 count:0 mapcount:0 mapping: Â Â Â Â Â(null) index:0x2800
> Â[ 4209.078674] page flags: 0x40000000004000(head)
> Â[ 4209.079294] pc:ffff880214a30000 pc->flags:2146246697418756 pc->mem_cgroup:ffffc9000177a000
> Â[ 4209.082177] (/A)
> Â[ 4209.082500] Pid: 31, comm: khugepaged Not tainted 2.6.38-rc3-mm1 #1
> Â[ 4209.083412] Call Trace:
> Â[ 4209.083678] Â[<ffffffff810f4454>] ? bad_page+0xe4/0x140
> Â[ 4209.084240] Â[<ffffffff810f53e6>] ? free_pages_prepare+0xd6/0x120
> Â[ 4209.084837] Â[<ffffffff8155621d>] ? rwsem_down_failed_common+0xbd/0x150
> Â[ 4209.085509] Â[<ffffffff810f5462>] ? __free_pages_ok+0x32/0xe0
> Â[ 4209.086110] Â[<ffffffff810f552b>] ? free_compound_page+0x1b/0x20
> Â[ 4209.086699] Â[<ffffffff810fad6c>] ? __put_compound_page+0x1c/0x30
> Â[ 4209.087333] Â[<ffffffff810fae1d>] ? put_compound_page+0x4d/0x200
> Â[ 4209.087935] Â[<ffffffff810fb015>] ? put_page+0x45/0x50
> Â[ 4209.097361] Â[<ffffffff8113f779>] ? khugepaged+0x9e9/0x1430
> Â[ 4209.098364] Â[<ffffffff8107c870>] ? autoremove_wake_function+0x0/0x40
> Â[ 4209.099121] Â[<ffffffff8113ed90>] ? khugepaged+0x0/0x1430
> Â[ 4209.099780] Â[<ffffffff8107c236>] ? kthread+0x96/0xa0
> Â[ 4209.100452] Â[<ffffffff8100dda4>] ? kernel_thread_helper+0x4/0x10
> Â[ 4209.101214] Â[<ffffffff8107c1a0>] ? kthread+0x0/0xa0
> Â[ 4209.101842] Â[<ffffffff8100dda0>] ? kernel_thread_helper+0x0/0x10
>
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
Reviewed-by: Minchan Kim <minchan.kim@xxxxxxxxx>

--
Kind regards,
Minchan Kim
--
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/