From: Nikolay Borisov <nborisov@suse.com>
To: Josef Bacik <josef@toxicpanda.com>,
linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 00/24][v3] Convert data reservations to the ticketing infrastructure
Date: Tue, 4 Feb 2020 11:48:41 +0200 [thread overview]
Message-ID: <8dee9e37-4d3f-9a1d-01e0-e7ef367ae5f7@suse.com> (raw)
In-Reply-To: <20200203204951.517751-1-josef@toxicpanda.com>
On 3.02.20 г. 22:49 ч., Josef Bacik wrote:
> v2->v3:
> - added a comment patch for the flushing states for data.
> - I forgot to add cancel_work_sync() for the new async data flusher thread.
> - Cleaned up a few of Nikolay's nits.
>
> v1->v2:
> - dropped the RFC
> - realized that I mis-translated the transaction commit logic from the old way
> to the new way, so I've reworked a bunch of patches to clearly pull that
> behavior into the generic flushing code. I've then cleaned it up later to
> make it easy to bisect down to behavior changes.
> - Cleaned up the priority flushing, there's no need for an explicit state array.
> - Removed the CHUNK_FORCE_ALLOC from the normal flushing as well, simply keep
> the logic of allocating chunks until we've made our reservation or we are
> full, then fall back on the normal flushing mechanism.
>
> -------------- Original email --------------
> Nikolay reported a problem where we'd occasionally fail generic/371. This test
> has two tasks running in a loop, one that fallocate and rm's, and one that
> pwrite's and rm's. There is enough space for both of these files to exist at
> one time, but sometimes the pwrite would fail.
>
> It would fail because we do not serialize data reseravtions. If one task is
> stuck doing the reclaim work, and another task comes in and steals it's
> reservation enough times, we'll give up and return ENOSPC. We validated this by
> adding a printk to the data reservation path to tell us that it was succeeding
> at making a reservation while another task was flushing.
>
> To solve this problem I've converted data reservations over to the ticketing
> system that metadata uses. There are some cleanups and some fixes that have to
> come before we could do that. The following are simply cleanups
>
> [PATCH 01/20] btrfs: change nr to u64 in btrfs_start_delalloc_roots
> [PATCH 02/20] btrfs: remove orig from shrink_delalloc
> [PATCH 03/20] btrfs: handle U64_MAX for shrink_delalloc
>
> The following are fixes that are needed to handle data space infos properly.
>
> [PATCH 04/20] btrfs: make shrink_delalloc take space_info as an arg
> [PATCH 05/20] btrfs: make ALLOC_CHUNK use the space info flags
> [PATCH 06/20] btrfs: call btrfs_try_granting_tickets when freeing
> [PATCH 07/20] btrfs: call btrfs_try_granting_tickets when unpinning
> [PATCH 08/20] btrfs: call btrfs_try_granting_tickets when reserving
> [PATCH 09/20] btrfs: use the btrfs_space_info_free_bytes_may_use
>
> I then converted the data reservation path over to the ticketing infrastructure,
> but I did it in a way that mirrored exactly what we currently have. The idea is
> that I want to be able to bisect regressions that happen from behavior change,
> and doing that would be hard if I just had a single patch doing the whole
> conversion at once. So the following patches are only moving code around
> logically, but preserve the same behavior as before
>
> [PATCH 10/20] btrfs: add flushing states for handling data
> [PATCH 11/20] btrfs: add btrfs_reserve_data_bytes and use it
> [PATCH 12/20] btrfs: use ticketing for data space reservations
>
> And then the following patches were changing the behavior of how we flush space
> for data reservations.
>
> [PATCH 13/20] btrfs: run delayed iputs before committing the
> [PATCH 14/20] btrfs: flush delayed refs when trying to reserve data
> [PATCH 15/20] btrfs: serialize data reservations if we are flushing
> [PATCH 16/20] btrfs: rework chunk allocate for data reservations
> [PATCH 17/20] btrfs: drop the commit_cycles stuff for data
>
> And then a cleanup now that the data reservation code is the same as the
> metadata reservation code.
>
> [PATCH 18/20] btrfs: use the same helper for data and metadata
>
> Finally a patch to change the flushing from direct to asynchronous, mirroring
> what we do for metadata for better latency.
>
> [PATCH 19/20] btrfs: do async reclaim for data reservations
>
> And then a final cleanup now that we're where we want to be with the data
> reservation path.
>
> [PATCH 20/20] btrfs: kill the priority_reclaim_space helper
>
> I've marked this as an RFC because I've only tested this with generic/371. I'm
> starting my overnight runs of xfstests now and will likely find regressions, but
> I'd like to get review started so this can get merged ASAP. Thanks,
>
> Josef
>
>
For the whole series:
Tested-by: Nikolay Borisov <nborisov@suse.com>
There are no regressions in xfstest, fixes generic/371 and also the
tests that exhibited performance problems in v1 are now fixed (as of v2).
prev parent reply other threads:[~2020-02-04 9:48 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-03 20:49 [PATCH 00/24][v3] Convert data reservations to the ticketing infrastructure Josef Bacik
2020-02-03 20:49 ` [PATCH 01/24] btrfs: change nr to u64 in btrfs_start_delalloc_roots Josef Bacik
2020-02-04 7:40 ` Nikolay Borisov
2020-02-03 20:49 ` [PATCH 02/24] btrfs: remove orig from shrink_delalloc Josef Bacik
2020-02-03 20:49 ` [PATCH 03/24] btrfs: handle U64_MAX for shrink_delalloc Josef Bacik
2020-02-03 20:49 ` [PATCH 04/24] btrfs: make shrink_delalloc take space_info as an arg Josef Bacik
2020-02-03 20:49 ` [PATCH 05/24] btrfs: make ALLOC_CHUNK use the space info flags Josef Bacik
2020-02-03 20:49 ` [PATCH 06/24] btrfs: call btrfs_try_granting_tickets when freeing reserved bytes Josef Bacik
2020-02-03 20:49 ` [PATCH 07/24] btrfs: call btrfs_try_granting_tickets when unpinning anything Josef Bacik
2020-02-03 20:49 ` [PATCH 08/24] btrfs: call btrfs_try_granting_tickets when reserving space Josef Bacik
2020-02-03 20:49 ` [PATCH 09/24] btrfs: use the btrfs_space_info_free_bytes_may_use helper for delalloc Josef Bacik
2020-02-03 20:49 ` [PATCH 10/24] btrfs: use btrfs_start_delalloc_roots in shrink_delalloc Josef Bacik
2020-02-03 20:49 ` [PATCH 11/24] btrfs: check tickets after waiting on ordered extents Josef Bacik
2020-02-03 20:49 ` [PATCH 12/24] btrfs: add flushing states for handling data reservations Josef Bacik
2020-02-03 20:49 ` [PATCH 13/24] btrfs: add the data transaction commit logic into may_commit_transaction Josef Bacik
2020-02-03 20:49 ` [PATCH 14/24] btrfs: add btrfs_reserve_data_bytes and use it Josef Bacik
2020-02-03 20:49 ` [PATCH 15/24] btrfs: use ticketing for data space reservations Josef Bacik
2020-02-03 20:49 ` [PATCH 16/24] btrfs: serialize data reservations if we are flushing Josef Bacik
2020-02-03 20:49 ` [PATCH 17/24] btrfs: use the same helper for data and metadata reservations Josef Bacik
2020-02-03 20:49 ` [PATCH 18/24] btrfs: drop the commit_cycles stuff for data reservations Josef Bacik
2020-02-04 7:39 ` Nikolay Borisov
2020-02-03 20:49 ` [PATCH 19/24] btrfs: don't pass bytes_needed to may_commit_transaction Josef Bacik
2020-02-04 7:42 ` Nikolay Borisov
2020-02-03 20:49 ` [PATCH 20/24] btrfs: don't force commit if we are data Josef Bacik
2020-02-04 7:43 ` Nikolay Borisov
2020-02-03 20:49 ` [PATCH 21/24] btrfs: run delayed iputs before committing the transaction for data Josef Bacik
2020-02-04 7:43 ` Nikolay Borisov
2020-02-03 20:49 ` [PATCH 22/24] btrfs: flush delayed refs when trying to reserve data space Josef Bacik
2020-02-03 20:49 ` [PATCH 23/24] btrfs: do async reclaim for data reservations Josef Bacik
2020-02-03 20:49 ` [PATCH 24/24] btrfs: add a comment explaining the data flush steps Josef Bacik
2020-02-04 9:47 ` Nikolay Borisov
2020-02-04 16:16 ` Josef Bacik
2020-02-04 9:48 ` Nikolay Borisov [this message]
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=8dee9e37-4d3f-9a1d-01e0-e7ef367ae5f7@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox