lkml.org 
[lkml]   [2012]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    SubjectRe: [RFC][PATCH 06/26] mm: Migrate misplaced page
    Date
    PZ> XXX: hnaz, dansmith saw some bad_page() reports when using memcg, I
    PZ> could not reproduce -- is there something funny with the mem_cgroup
    PZ> calls in the below patch?

    I think the problem stems from the final put_page() on the old page
    being called before the charge commit. I think something like the
    following should do the trick (and appears to work for me):

    diff --git a/mm/migrate.c b/mm/migrate.c
    index b7fa472..fd88f4b 100644
    --- a/mm/migrate.c
    +++ b/mm/migrate.c
    @@ -1590,7 +1590,6 @@ migrate_misplaced_page(struct page *page, struct mm_struct
    put_page(page); /* drop " " */

    unlock_page(page);
    - put_page(page); /* drop fault path ref & free */

    page = newpage;
    }
    @@ -1599,6 +1598,9 @@ out:
    if (!charge)
    mem_cgroup_end_migration(mcg, oldpage, newpage, !rc);

    + if (oldpage != page)
    + put_page(oldpage);
    +
    if (rc) {
    unlock_page(newpage);
    __free_page(newpage);

    --
    Dan Smith
    IBM Linux Technology Center


    \
     
     \ /
      Last update: 2012-04-03 19:35    [W:4.179 / U:0.488 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site