diff mbox series

btrfs: don't arbitrarily slow down delalloc if we're committing

Message ID 801c5d3726d8370a7889118b5ecf15f30fb6b9bb.1695060918.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs: don't arbitrarily slow down delalloc if we're committing | expand

Commit Message

Josef Bacik Sept. 18, 2023, 6:15 p.m. UTC
We have a random schedule_timeout() if the current transaction is
committing, which seems to be a holdover from the original delalloc
reservation code.

Remove this, we have the proper flushing stuff, we shouldn't be hoping
for random timing things to make everything work.  This just induces
latency for no reason.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/delalloc-space.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

David Sterba Sept. 18, 2023, 9:22 p.m. UTC | #1
On Mon, Sep 18, 2023 at 02:15:33PM -0400, Josef Bacik wrote:
> We have a random schedule_timeout() if the current transaction is
> committing, which seems to be a holdover from the original delalloc
> reservation code.
> 
> Remove this, we have the proper flushing stuff, we shouldn't be hoping
> for random timing things to make everything work.  This just induces
> latency for no reason.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Added to misc-next, thanks.
diff mbox series

Patch

diff --git a/fs/btrfs/delalloc-space.c b/fs/btrfs/delalloc-space.c
index 427abaf608b8..0d105ed1b8de 100644
--- a/fs/btrfs/delalloc-space.c
+++ b/fs/btrfs/delalloc-space.c
@@ -322,9 +322,6 @@  int btrfs_delalloc_reserve_metadata(struct btrfs_inode *inode, u64 num_bytes,
 	} else {
 		if (current->journal_info)
 			flush = BTRFS_RESERVE_FLUSH_LIMIT;
-
-		if (btrfs_transaction_in_commit(fs_info))
-			schedule_timeout(1);
 	}
 
 	num_bytes = ALIGN(num_bytes, fs_info->sectorsize);