• Kent Overstreet's avatar
    bcachefs: better journal pipelining · 916abefd
    Kent Overstreet authored
    Recently a severe performance regression was discovered, which bisected
    to
    
      a6548c8b bcachefs: Avoid flushing the journal in the discard path
    
    It turns out the old behaviour, which issued excessive journal flushes,
    worked around a performance issue where queueing delays would cause the
    journal to not be able to write quickly enough and stall.
    
    The journal flushes masked the issue because they periodically flushed
    the device write cache, reducing write latency for non flushes.
    
    This patch reworks the journalling code to allow more than one
    (non-flush) write to be in flight at a time. With this patch, doing 4k
    random writes and an iodepth of 128, we are now able to hit 560k iops to
    a Samsung 970 EVO Plus - previously, we were stuck in the ~200k range.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    916abefd
journal.c 38.6 KB