mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Daniel Vacek <neelx@suse.com>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: index buffer_tree using node size
Date: Mon, 12 May 2025 22:20:54 +0200	[thread overview]
Message-ID: <20250512202054.GX9140@twin.jikos.cz> (raw)
In-Reply-To: <20250512172321.3004779-1-neelx@suse.com>

On Mon, May 12, 2025 at 07:23:20PM +0200, Daniel Vacek wrote:
> So far we are deriving the buffer tree index using the sector size. But each
> extent buffer covers multiple sectors. This makes the buffer tree rather sparse.
> 
> For example the typical and quite common configuration uses sector size of 4KiB
> and node size of 16KiB. In this case it means the buffer tree is using up to
> the maximum of 25% of it's slots. Or in other words at least 75% of the tree
> slots are wasted as never used.
> 
> We can score significant memory savings on the required tree nodes by indexing
> the tree using the node size instead. As a result far less slots are wasted
> and the tree can now use up to all 100% of it's slots this way.

This looks interesting. Is there a way to get xarray stats? I don't see
anything in the public API, e.g. depth, fanout, slack per level. For
debugging purposes we can put it to sysfs or as syslog message,
eventually as non-debugging output to commit_stats.

  reply	other threads:[~2025-05-12 20:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-12 17:23 Daniel Vacek
2025-05-12 20:20 ` David Sterba [this message]
2025-05-13  7:56   ` Daniel Vacek
2025-05-13  8:08     ` Daniel Vacek
2025-05-13 17:10     ` David Sterba
2025-05-14  9:55       ` Daniel Vacek
2025-05-12 22:44 ` Qu Wenruo
2025-05-13  8:05   ` Daniel Vacek
2025-05-13  8:10     ` Qu Wenruo
2025-05-13 10:12 ` Filipe Manana
2025-05-13 14:37   ` Daniel Vacek
2025-06-06 17:28 ` David Sterba
2025-06-12  8:34   ` Daniel Vacek
2025-06-12  8:47 ` [PATCH v2] " Daniel Vacek
2025-06-20 12:57   ` David Sterba
2025-06-23 14:04     ` Daniel Vacek
2025-06-23 14:25       ` David Sterba
2025-07-04 16:09         ` Daniel Vacek

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=20250512202054.GX9140@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neelx@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

all inboxes | Powered by JetHome®