lkml.org 
[lkml]   [2006]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH] mm: fix page_mkclean_one
    Date
    > I think what might be happening is that pdflush writes them out fine,
    > however we don't trap writes by the application _during_ that writeout.

    Yeah. I believe that more exactly it happens if the very last
    write to the page causes a writeback (due to dirty balancing)
    while another writeback for the page is already happening.

    As usual in these cases, I have zero proof.

    > It's something that will only occur with writeback and MAP_SHARED
    > writable access to the file pages.

    It's the do_wp_page -> balance_dirty_pages -> generic_writepages
    path for sure. Maybe it's enough to change

    if (wbc->sync_mode != WB_SYNC_NONE)
    wait_on_page_writeback(page);

    if (PageWriteback(page) ||
    !clear_page_dirty_for_io(page)) {
    unlock_page(page);
    continue;
    }

    to

    if (wbc->sync_mode != WB_SYNC_NONE)
    wait_on_page_writeback(page);

    if (PageWriteback(page)) {
    redirty_page_for_writepage(wbc, page);
    unlock_page(page);
    continue;
    }

    if (!clear_page_dirty_for_io(page)) {
    unlock_page(page);
    continue;
    }

    or something along those lines. Completely untested of course :-)


    Segher

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-12-29 03:57    [W:4.038 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site