]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: only ignore delalloc if delalloc is much smaller than ordered
authorJosef Bacik <josef@toxicpanda.com>
Wed, 28 Apr 2021 17:38:47 +0000 (13:38 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jun 2021 13:19:04 +0000 (15:19 +0200)
commit7920b7f4926a57394a0a3d2e83acc664f7eb527d
treec40cfc5673f4d8483e30d5ce8ab532238a33a20c
parent6f3b5f977b9cff79ae73cc284f114265a93d4a0d
btrfs: only ignore delalloc if delalloc is much smaller than ordered

While testing heavy delalloc workloads I noticed that sometimes we'd
just stop preemptively flushing when we had loads of delalloc available
to flush.  This is because we skip preemptive flushing if delalloc <=
ordered.  However if we start with say 4gib of delalloc, and we flush
2gib of that, we'll stop flushing there, when we still have 2gib of
delalloc to flush.

Instead adjust the ordered bytes down by half, this way if 2/3 of our
outstanding delalloc reservations are tied up by ordered extents we
don't bother preemptive flushing, as we're getting close to the state
where we need to wait on ordered extents.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/space-info.c