lkml.org 
[lkml]   [2004]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: 2.6.3-mm3 sometimes freeze on "sync"
    Helge Hafting <helgehaf@aitel.hist.no> wrote:
    >
    > 2.6.3-mm3 (and 2.6.3-mm1) occationally freeze on "sync".

    yup. bug. This should fix.



    mm/page-writeback.c | 28 ++++++++++++----------------
    1 files changed, 12 insertions(+), 16 deletions(-)

    diff -puN mm/page-writeback.c~O_DIRECT-vs-buffered-fix-pdflush-hang-fix mm/page-writeback.c
    --- 25/mm/page-writeback.c~O_DIRECT-vs-buffered-fix-pdflush-hang-fix 2004-02-24 12:19:55.000000000 -0800
    +++ 25-akpm/mm/page-writeback.c 2004-02-24 12:19:55.000000000 -0800
    @@ -483,30 +483,26 @@ void __init page_writeback_init(void)
    int do_writepages(struct address_space *mapping, struct writeback_control *wbc)
    {
    int ret;
    - if (wbc->sync_mode == WB_SYNC_NONE) {
    - if (!down_read_trylock(&mapping->wb_rwsema))
    - /*
    - * SYNC writeback in progress
    - */
    - return 0;
    - } else {
    - /*
    - * Only allow 1 SYNC writeback at a time, to be able
    - * to wait for all i/o without worrying about racing
    - * WB_SYNC_NONE writers.
    - */
    +
    + /*
    + * Only allow 1 SYNC writeback at a time, to be able to wait for all
    + * I/O without worrying about racing WB_SYNC_NONE writers.
    + */
    + if (wbc->sync_mode == WB_SYNC_NONE)
    + down_read(&mapping->wb_rwsema);
    + else
    down_write(&mapping->wb_rwsema);
    - }

    if (mapping->a_ops->writepages)
    ret = mapping->a_ops->writepages(mapping, wbc);
    else
    ret = generic_writepages(mapping, wbc);
    - if (wbc->sync_mode == WB_SYNC_NONE) {
    +
    + if (wbc->sync_mode == WB_SYNC_NONE)
    up_read(&mapping->wb_rwsema);
    - } else {
    + else
    up_write(&mapping->wb_rwsema);
    - }
    +
    return ret;
    }

    _

    -
    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: 2005-03-22 14:01    [W:0.022 / U:0.628 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site