[lkml]   [2011]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] writeback: Don't wait for completion in writeback_inodes_sb_nr
    On Wed, Jun 29, 2011 at 06:57:14PM +0200, Jan Kara wrote:
    > > For sys_sync I'm pretty sure we could simply remove the
    > > writeback_inodes_sb call and get just as good if not better performance,
    > Actually, it won't with current code. Because WB_SYNC_ALL writeback
    > currently has the peculiarity that it looks like:
    > for all inodes {
    > write all inode data
    > wait for inode data
    > }
    > while to achieve good performance we actually need something like
    > for all inodes
    > write all inode data
    > for all inodes
    > wait for inode data
    > It makes a difference in an order of magnitude when there are lots of
    > smallish files - SLES had a bug like this so I know from user reports ;)

    I don't think that's true. The WB_SYNC_ALL writeback is done using
    sync_inodes_sb, which operates as:

    for all dirty inodes in bdi:
    if inode belongs to sb
    write all inode data

    for all inodes in sb:
    wait for inode data

    we still do that in a big for each sb loop, though.

    > You mean that sync(1) would actually write the data itself? It would
    > certainly make some things simpler but it has its problems as well - for
    > example sync racing with flusher thread writing back inodes can create
    > rather bad IO pattern...

    Only the second pass. The idea is that we first try to use the flusher
    threads for good I/O patterns, but if we can't get that to work only
    block the caller and not everyone. But that's just an idea so far,
    it would need serious benchmark. And despite what I claimed before
    we actually do the wait in the caller context already anyway, which
    already gives you the easy part of the above effect.

     \ /
      Last update: 2011-06-29 19:57    [W:0.020 / U:1.472 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site