public inbox for linux-bcachefs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Webb <chris@arachsys.com>
To: Kent Overstreet <kent.overstreet@gmail.com>
Cc: linux-bcachefs@vger.kernel.org
Subject: Re: Metadata usage following device add
Date: Sun, 24 Oct 2021 22:36:23 +0100	[thread overview]
Message-ID: <20211024213623.GJ11670@arachsys.com> (raw)
In-Reply-To: <YXWML9QLQKCsRgdh@moria.home.lan>

Kent Overstreet <kent.overstreet@gmail.com> writes:

> Good catch! I completely forgot about that comment and didn't think to
> fix it that way, the last time I was looking at that I was looking at the
> device accounting code in buckets.c. I've just pushed a fix, can you tell
> me if you see anything I missed?

Thanks! I've played with it and tried everything I can think of to break it,
but I didn't find a way to get it out of sync or inconsistent.

> This is a good opportunity to talk about the disk space accounting code.

That was a really interesting write-up of your planned transition to move
the accounting into btree keys, thanks! Makes a lot of sense as you describe
it. (I saw you mention hitting 1M snapshots on a filesystem the other day,
which is good motivation for a scalable place to put accounting info!)

I need to spend a bit of time reading the code and getting a better sense of
how the allocation system more generally works. It's still one of the more
mysterious bits of the filesystem to me.

Am I right that in the current implementation, buckets only get discarded
when the allocator thread is woken because we've run out of free buckets for
a new allocation and need to reclaim - so they're discarded and quickly
reused? I wonder if waking the allocator thread periodically (or from a
userspace ioctl?) to reclaim and discard buckets earlier might be better for
SSD health, kind of like a fancy version of a manual fstrim on ext4?

Best wishes,

Chris.


      reply	other threads:[~2021-10-24 21:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-24 11:15 Metadata usage following device add Chris Webb
2021-10-24 16:39 ` Kent Overstreet
2021-10-24 21:36   ` Chris Webb [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=20211024213623.GJ11670@arachsys.com \
    --to=chris@arachsys.com \
    --cc=kent.overstreet@gmail.com \
    --cc=linux-bcachefs@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