[lkml]   [2008]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    SubjectRe: [PATCH][RFC] fix kernel BUG at mm/migrate.c:719! in 2.6.26-rc5-mm3
    On Tue, 17 Jun 2008 16:35:01 +0900
    Daisuke Nishimura <> wrote:

    > This patch also fixes a race between migrate_entry_wait and
    > page_freeze_refs in migrate_page_move_mapping.
    Ok, let's fix one by one. please add your Signed-off-by if ok.

    This is a fix for page migration under speculative page lookup protocol.
    In speculative page cache lookup protocol, page_count(page) is set to 0
    while radix-tree midification is going on, truncation, migration, etc...

    While page migration, a page fault to page under migration should wait
    unlock_page() and migration_entry_wait() waits for the page from its
    pte entry. It does get_page() -> wait_on_page_locked() -> put_page() now.

    In page migration, page_freeze_refs() -> page_unfreeze_refs() is called.

    Here, page_unfreeze_refs() expects page_count(page) == 0 and panics
    if page_count(page) != 0. To avoid this, we shouldn't touch page_count()
    if it is zero. This patch uses page_cache_get_speculative() to avoid
    the panic.

    From: Daisuke Nishimura <>
    Signed-off-by: KAMEZAWA Hiroyuki <>
    mm/migrate.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    Index: test-2.6.26-rc5-mm3/mm/migrate.c
    --- test-2.6.26-rc5-mm3.orig/mm/migrate.c
    +++ test-2.6.26-rc5-mm3/mm/migrate.c
    @@ -243,7 +243,8 @@ void migration_entry_wait(struct mm_stru

    page = migration_entry_to_page(entry);

    - get_page(page);
    + if (!page_cache_get_speculative())
    + goto out;
    pte_unmap_unlock(ptep, ptl);

     \ /
      Last update: 2008-06-18 03:11    [W:0.022 / U:0.828 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site