• Linus Torvalds's avatar
    writeback: plug writeback in wb_writeback() and writeback_inodes_wb() · 505a666e
    Linus Torvalds authored
    We had to revert the pluggin in writeback_sb_inodes() because the
    wb->list_lock is held, but we could easily plug at a higher level before
    taking that lock, and unplug after releasing it.  This does that.
    
    Chris will run performance numbers, just to verify that this approach is
    comparable to the alternative (we could just drop and re-take the lock
    around the blk_finish_plug() rather than these two commits.
    
    I'd have preferred waiting for actual performance numbers before picking
    one approach over the other, but I don't want to release rc1 with the
    known "sleeping function called from invalid context" issue, so I'll
    pick this cleanup version for now.  But if the numbers show that we
    really want to plug just at the writeback_sb_inodes() level, and we
    should just play ugly games with the spinlock, we'll switch to that.
    
    Cc: Chris Mason <[email protected]>
    Cc: Josef Bacik <[email protected]>
    Cc: Dave Chinner <[email protected]>
    Cc: Neil Brown <[email protected]>
    Cc: Jan Kara <[email protected]>
    Cc: Christoph Hellwig <[email protected]>
    Signed-off-by: default avatarLinus Torvalds <[email protected]>
    505a666e
fs-writeback.c 66.6 KB