Thread (32 messages) 32 messages, 8 authors, 2021-12-19

RE: [RFC][V8][PATCH 0/5] btrfs: allocation_hint mode

From: Paul Jones <hidden>
Date: 2021-12-16 02:30:57

-----Original Message-----
From: Josef Bacik <josef@toxicpanda.com>
Sent: Thursday, 16 December 2021 12:58 AM
To: kreijack@inwind.it
Cc: Zygo Blaxell <redacted>; David Sterba
[off-list ref]; Sinnamohideen Shafeeq [off-list ref];
Paul Jones [off-list ref]; linux-btrfs@vger.kernel.org
Subject: Re: [RFC][V8][PATCH 0/5] btrfs: allocation_hint mode

On Tue, Dec 14, 2021 at 09:41:21PM +0100, Goffredo Baroncelli wrote:
quoted
On 12/14/21 21:34, Josef Bacik wrote:
quoted
On Tue, Dec 14, 2021 at 03:04:32PM -0500, Zygo Blaxell wrote:
quoted
On Tue, Dec 14, 2021 at 08:03:45PM +0100, Goffredo Baroncelli wrote:
quoted
quoted
I don't have a strong preference for either sysfs or ioctl, nor am
I opposed to simply implementing both.  I'll let someone who does
have such a preference make their case.
I think echo'ing a name into sysfs is better than bits for sure.
However I want the ability to set the device properties via a
btrfs-progs command offline so I can setup the storage and then
mount the file system.  I want

1) The sysfs interface so you can change things on the fly.  This stays
    persistent of course, so the way it works is perfect.

2) The btrfs-progs command sets it on offline devices.  If you point it at a
    live mounted fs it can simply use the sysfs thing to do it live.
#2 is currently not implemented. However I think that we should do.

The problem is that we need to update both:

- the superblock		(simple)
- the dev_item item		(not so simple...)

What about using only bits from the superblock to store this property ?
I'm looking at the patches and you only are updating the dev_item, am I
missing something for the super block?

For offline all you would need to do is do the normal open_ctree,
btrfs_search_slot to the item and update the device item type, that's
straightforward.

For online if you use btrfs prop you can see if the fs is mounted and just find
the sysfs file to modify and do it that way.

But this also brings up another point, we're going to want a compat bit for
this.  It doesn't make the fs unusable for old kernels, so just a normal
BTRFS_FS_COMPAT_<whatever> flag is fine.  If the setting gets set you set
the compat flag.
I don't think that is necessary - I've remounted my filesystems a few times with an unpatched kernel, and all that happens is new blocks get allocated without any hints - I like that simplicity and compatibility. As long as it's mentioned in the docs I think it's fine.

Having a balance filter that only rebalances wrongly allocated blocks would be a nice addition though.


Paul.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help