All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH v4 07/12] btrfs: check reclaim_size in need_preemptive_reclaim
Date: Tue, 26 Jan 2021 16:24:31 -0500	[thread overview]
Message-ID: <90d587ce068421771a24ab819969de3e498dce61.1611695838.git.josef@toxicpanda.com> (raw)
In-Reply-To: <cover.1611695838.git.josef@toxicpanda.com>

If we're flushing space for tickets then we have
space_info->reclaim_size set and we do not need to do background
reclaim.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/space-info.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
index e68cd73b4222..c3c586b33b4b 100644
--- a/fs/btrfs/space-info.c
+++ b/fs/btrfs/space-info.c
@@ -812,6 +812,13 @@ static bool need_preemptive_reclaim(struct btrfs_fs_info *fs_info,
 	if ((space_info->bytes_used + space_info->bytes_reserved) >= thresh)
 		return 0;
 
+	/*
+	 * We have tickets queued, bail so we don't compete with the async
+	 * flushers.
+	 */
+	if (space_info->reclaim_size)
+		return 0;
+
 	if (!btrfs_calc_reclaim_metadata_size(fs_info, space_info))
 		return 0;
 
-- 
2.26.2


  parent reply	other threads:[~2021-01-26 23:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 21:24 [PATCH v4 00/12] Improve preemptive ENOSPC flushing Josef Bacik
2021-01-26 21:24 ` [PATCH v4 01/12] btrfs: make flush_space take a enum btrfs_flush_state instead of int Josef Bacik
2021-01-26 21:24 ` [PATCH v4 02/12] btrfs: add a trace point for reserve tickets Josef Bacik
2021-01-26 21:24 ` [PATCH v4 03/12] btrfs: track ordered bytes instead of just dio ordered bytes Josef Bacik
2021-01-26 21:24 ` [PATCH v4 04/12] btrfs: introduce a FORCE_COMMIT_TRANS flush operation Josef Bacik
2021-01-26 21:24 ` [PATCH v4 05/12] btrfs: improve preemptive background space flushing Josef Bacik
2021-01-26 21:24 ` [PATCH v4 06/12] btrfs: rename need_do_async_reclaim Josef Bacik
2021-01-26 21:24 ` Josef Bacik [this message]
2021-01-26 21:24 ` [PATCH v4 08/12] btrfs: rework btrfs_calc_reclaim_metadata_size Josef Bacik
2021-01-26 21:24 ` [PATCH v4 09/12] btrfs: simplify the logic in need_preemptive_flushing Josef Bacik
2021-01-26 21:24 ` [PATCH v4 10/12] btrfs: implement space clamping for preemptive flushing Josef Bacik
2021-01-26 21:24 ` [PATCH v4 11/12] btrfs: adjust the flush trace point to include the source Josef Bacik
2021-01-26 21:24 ` [PATCH v4 12/12] btrfs: add a trace class for dumping the current ENOSPC state Josef Bacik
2021-01-27 15:03 ` [PATCH v4 00/12] Improve preemptive ENOSPC flushing David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=90d587ce068421771a24ab819969de3e498dce61.1611695838.git.josef@toxicpanda.com \
    --to=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.