All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Josef Bacik <josef@toxicpanda.com>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 4/5] btrfs: only check priority tickets for priority flushing
Date: Tue, 17 Mar 2020 14:55:41 +0200	[thread overview]
Message-ID: <e314aa12-f4dc-27c6-a355-ce2b6404786c@suse.com> (raw)
In-Reply-To: <20200313195809.141753-5-josef@toxicpanda.com>



On 13.03.20 г. 21:58 ч., Josef Bacik wrote:
> In debugging a generic/320 failure on ppc64, Nikolay noticed that
> sometimes we'd ENOSPC out with plenty of space to reclaim if we had
> committed the transaction.  He further discovered that this was because
> there was a priority ticket that was small enough to fit in the free
> space currently in the space_info.
> 
> Consider the following scenario.  There is no more space to reclaim in
> the fs without committing the transaction.  Assume there's 1mib of space
> free in the space info, but there are pending normal tickets with 2mib
> reservations.
> 
> Now a priority ticket comes in with a .5mib reservation.  Because we
> have normal tickets pending we add ourselves to the priority list,
> despite the fact that we could satisfy this reservation.
> 
> The flushing machinery now gets to the point where it wants to commit
> the transaction, but because there's a .5mib ticket on the priority list
> and we have 1mib of free space we assume the ticket will be granted
> soon, so we bail without committing the transaction.
> 
> Meanwhile the priority flushing does not commit the transaction, and
> eventually fails with an ENOSPC.  Then all other tickets are failed with
> ENOSPC because we were never able to actually commit the transaction.
> 
> The fix for this is we should have simply granted the priority flusher
> his reservation, because there was space to make the reservation.
> Priority flushers by definition take priority, so they are allowed to
> make their reservations before any previous normal tickets.  By not
> adding this priority ticket to the list the normal flushing mechanisms
> will then commit the transaction and everything will continue normally.
> 
> We still need to serialize ourselves with other priority tickets, so if
> there are any tickets on the priority list then we need to add ourselves
> to that list in order to maintain the serialization between priority
> tickets.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

  reply	other threads:[~2020-03-17 12:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13 19:58 [PATCH 0/5][v2] Deal with a few ENOSPC corner cases Josef Bacik
2020-03-13 19:58 ` [PATCH 1/5] btrfs: Improve global reserve stealing logic Josef Bacik
2020-03-17 12:46   ` Nikolay Borisov
2020-03-13 19:58 ` [PATCH 2/5] btrfs: allow us to use up to 90% of the global rsv for unlink Josef Bacik
2020-03-17 12:46   ` Nikolay Borisov
2020-03-13 19:58 ` [PATCH 3/5] btrfs: Account for trans_block_rsv in may_commit_transaction Josef Bacik
2020-03-13 19:58 ` [PATCH 4/5] btrfs: only check priority tickets for priority flushing Josef Bacik
2020-03-17 12:55   ` Nikolay Borisov [this message]
2020-03-13 19:58 ` [PATCH 5/5] btrfs: run btrfs_try_granting_tickets if a priority ticket fails Josef Bacik
2020-03-17 12:59   ` Nikolay Borisov
2020-03-17 15:46 ` [PATCH 0/5][v2] Deal with a few ENOSPC corner cases Nikolay Borisov
2020-03-25 15:50 ` David Sterba
2020-03-25 15:52   ` Nikolay Borisov
2020-03-25 18:33     ` David Sterba
2020-04-03 15:46 ` David Sterba
  -- strict thread matches above, loose matches on Subject: below --
2020-03-09 20:23 [PATCH 0/5] " Josef Bacik
2020-03-09 20:23 ` [PATCH 4/5] btrfs: only check priority tickets for priority flushing Josef Bacik
2020-03-10 10:30   ` 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=e314aa12-f4dc-27c6-a355-ce2b6404786c@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.