Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Nikolay Borisov <nborisov@suse.com>
Cc: Josef Bacik <josef@toxicpanda.com>,
	kernel-team@fb.com, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 4/9] btrfs: rework btrfs_space_info_add_old_bytes
Date: Fri, 23 Aug 2019 14:30:44 +0200	[thread overview]
Message-ID: <20190823123044.GN2752@twin.jikos.cz> (raw)
In-Reply-To: <b3a697e5-016d-5c8c-f0c6-711e433ca18f@suse.com>

On Fri, Aug 23, 2019 at 10:48:35AM +0300, Nikolay Borisov wrote:
> 
> 
> On 22.08.19 г. 22:10 ч., Josef Bacik wrote:
> > If there are pending tickets and we are overcommitted we will simply
> > return free'd reservations to space_info->bytes_may_use if we cannot
> > overcommit any more.  This is problematic because we assume any free
> > space would have been added to the tickets, and so if we go from an
> > overcommitted state to not overcommitted we could have plenty of space
> > in our space_info but be unable to make progress on our tickets because
> > we only refill tickets from previous reservations.
> > 
> > Consider the following example.  We were allowed to overcommit to
> > space_info->total_bytes + 2mib.  Now we've allocated all of our chunks
> > and are no longer allowed to overcommit those extra 2mib.  Assume there
> > is a 3mib reservation we are now freeing.  Because we can no longer
> > overcommit we do not partially refill the ticket with the 3mib, instead
> > we subtract it from space_info->bytes_may_use.  Now the total reserved
> > space is 1mib less than total_bytes, meaning we have 1mib of space we
> > could reserve.  Now assume that our ticket is 2mib, and we only have
> > 1mib of space to reclaim, so we have a partial refilling to 1mib.  We
> > keep trying to flush and eventually give up and ENOSPC the ticket, when
> > there was the remaining 1mib left in the space_info for usage.
> 
> The wording of this paragraph makes it a bit hard to understand. How
> about something like:

I got lost there too. It's hard too keep track of what changes,
something a bit more strucutred could help understanding it.

Also the subject is too generic, I'd suggest "update overcommit logic
when refilling tickets" or something like that. Using 'rework' or
'revamp' in the subject applies to very few patches.

  reply	other threads:[~2019-08-23 12:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 19:10 [PATCH 0/9][v3] Rework reserve ticket handling Josef Bacik
2019-08-22 19:10 ` [PATCH 1/9] btrfs: do not allow reservations if we have pending tickets Josef Bacik
2019-08-23  7:33   ` Nikolay Borisov
2019-08-22 19:10 ` [PATCH 2/9] btrfs: roll tracepoint into btrfs_space_info_update helper Josef Bacik
2019-08-23 12:12   ` David Sterba
2019-08-22 19:10 ` [PATCH 3/9] btrfs: add space reservation tracepoint for reserved bytes Josef Bacik
2019-08-23 12:17   ` David Sterba
2019-08-22 19:10 ` [PATCH 4/9] btrfs: rework btrfs_space_info_add_old_bytes Josef Bacik
2019-08-23  7:48   ` Nikolay Borisov
2019-08-23 12:30     ` David Sterba [this message]
2019-08-28 15:15   ` [PATCH][v2] btrfs: stop partially refilling tickets when releasing space Josef Bacik
2019-08-22 19:10 ` [PATCH 5/9] btrfs: refactor the ticket wakeup code Josef Bacik
2019-08-22 19:10 ` [PATCH 6/9] btrfs: rework wake_all_tickets Josef Bacik
2019-08-23  8:17   ` Nikolay Borisov
2019-08-27 13:04     ` David Sterba
2019-08-28 15:12   ` [PATCH][v2] " Josef Bacik
2019-08-22 19:11 ` [PATCH 7/9] btrfs: fix may_commit_transaction to deal with no partial filling Josef Bacik
2019-08-23  8:18   ` Nikolay Borisov
2019-08-22 19:11 ` [PATCH 8/9] btrfs: remove orig_bytes from reserve_ticket Josef Bacik
2019-08-22 19:11 ` [PATCH 9/9] btrfs: rename btrfs_space_info_add_old_bytes Josef Bacik
2019-08-23  8:18   ` Nikolay Borisov
2019-08-23 12:55 ` [PATCH 0/9][v3] Rework reserve ticket handling David Sterba
2019-08-28 18:02   ` 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=20190823123044.GN2752@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox