From: Nikolay Borisov <nborisov@suse.com>
To: Josef Bacik <josef@toxicpanda.com>,
linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH v2 02/11] btrfs: track ordered bytes instead of just dio ordered bytes
Date: Fri, 9 Oct 2020 10:25:01 +0300 [thread overview]
Message-ID: <6251a242-37ba-e836-e95c-340a045b53cc@suse.com> (raw)
In-Reply-To: <cf8c1d7231092a9fbe9128339739352d84448b8a.1602189832.git.josef@toxicpanda.com>
On 8.10.20 г. 23:48 ч., Josef Bacik wrote:
> We track dio_bytes because the shrink delalloc code needs to know if we
> have more DIO in flight than we have normal buffered IO. The reason for
> this is because we can't "flush" DIO, we have to just wait on the
> ordered extents to finish.
>
> However this is true of all ordered extents. If we have more ordered
> space outstanding than dirty pages we should be waiting on ordered
> extents. We already are ok on this front technically, because we always
> do a FLUSH_DELALLOC_WAIT loop, but I want to use the ordered counter in
> the preemptive flushing code as well, so change this to count all
> ordered bytes instead of just DIO ordered bytes.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
<snip>
> --- a/fs/btrfs/space-info.c
> +++ b/fs/btrfs/space-info.c
> @@ -489,7 +489,7 @@ static void shrink_delalloc(struct btrfs_fs_info *fs_info,
> {
> struct btrfs_trans_handle *trans;
> u64 delalloc_bytes;
> - u64 dio_bytes;
> + u64 ordered_bytes;
> u64 items;
> long time_left;
> int loops;
> @@ -513,8 +513,8 @@ static void shrink_delalloc(struct btrfs_fs_info *fs_info,
>
> delalloc_bytes = percpu_counter_sum_positive(
> &fs_info->delalloc_bytes);
> - dio_bytes = percpu_counter_sum_positive(&fs_info->dio_bytes);
> - if (delalloc_bytes == 0 && dio_bytes == 0) {
> + ordered_bytes = percpu_counter_sum_positive(&fs_info->ordered_bytes);
> + if (delalloc_bytes == 0 && ordered_bytes == 0) {
> if (trans)
> return;
> if (wait_ordered)
Does it make sense to wait for ordered even if wait_ordered is true and
ordered_bytes is 0 ? Perhaps this condition can be simplified to just :
if (delalloc_bytes == 0 && ordered_bytes == 0) return;
<snip>
next prev parent reply other threads:[~2020-10-09 7:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-08 20:48 [PATCH v2 00/11] Improve preemptive ENOSPC flushing Josef Bacik
2020-10-08 20:48 ` [PATCH v2 01/11] btrfs: add a trace point for reserve tickets Josef Bacik
2020-10-09 7:20 ` Nikolay Borisov
2020-10-08 20:48 ` [PATCH v2 02/11] btrfs: track ordered bytes instead of just dio ordered bytes Josef Bacik
2020-10-09 7:25 ` Nikolay Borisov [this message]
2020-10-08 20:48 ` [PATCH v2 03/11] btrfs: introduce a FORCE_COMMIT_TRANS flush operation Josef Bacik
2020-10-08 20:48 ` [PATCH v2 04/11] btrfs: improve preemptive background space flushing Josef Bacik
2020-10-08 20:48 ` [PATCH v2 05/11] btrfs: rename need_do_async_reclaim Josef Bacik
2020-10-08 20:48 ` [PATCH v2 06/11] btrfs: check reclaim_size in need_preemptive_reclaim Josef Bacik
2020-10-08 20:48 ` [PATCH v2 07/11] btrfs: rework btrfs_calc_reclaim_metadata_size Josef Bacik
2020-10-09 9:53 ` Nikolay Borisov
2020-10-08 20:48 ` [PATCH v2 08/11] btrfs: simplify the logic in need_preemptive_flushing Josef Bacik
2020-10-08 20:48 ` [PATCH v2 09/11] btrfs: implement space clamping for preemptive flushing Josef Bacik
2020-10-09 12:22 ` Nikolay Borisov
2020-10-08 20:48 ` [PATCH v2 10/11] btrfs: adjust the flush trace point to include the source Josef Bacik
2020-10-08 20:48 ` [PATCH v2 11/11] btrfs: add a trace class for dumping the current ENOSPC state Josef Bacik
2020-10-09 9:50 ` Nikolay Borisov
2020-10-09 10:39 ` [PATCH v2 00/11] Improve preemptive ENOSPC flushing Nikolay Borisov
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=6251a242-37ba-e836-e95c-340a045b53cc@suse.com \
--to=nborisov@suse.com \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
/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.