Skip to contentSkip to conversation

3.18.1 + latest bcache-dev

DISCUSSION Stephen R. van den Berg 6 participants 18 messages Dec 28, 2014 – Jan 8, 2015 bcache (block layer cache)

lore
Share & tools
lore
#0 lore raw

Now I tried this:
Combine 3.18.1 and rebase all the patches from bcache-dev onto that. But, in trying that, I get a consistent:

register_bcache() error opening /dev/sdb3: Invalid superblock: member info area missing

Anything I overlooked? The bcache-tools are straight from git too.

Signature · 1 line
Stephen.
#1 lore raw

Hi Stephen,

The bcache-dev branch has on-disk format changes that require a new bcache-tools. I'm not sure where Kent posts the source for that.

Quoted 13 lines · Stephen R. van den Berg

Now I tried this:
Combine 3.18.1 and rebase all the patches from bcache-dev onto that. But, in trying that, I get a consistent:

register_bcache() error opening /dev/sdb3: Invalid superblock: member info area missing

Anything I overlooked? The bcache-tools are straight from git too.
--
Stephen.
--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

Hi Slava,

Sounds like the kernel (using bcache-dev) is not able to handle the current format. If so, bcache-tools may help in "reformatting" bcache devices, but that's no solution for existing systems.

So is my understanding correct that there's no easy kernel upgrade path (to bcache-dev) ?

Rolf

Quoted 23 lines · Slava Pestov

Hi Stephen,

The bcache-dev branch has on-disk format changes that require a new bcache-tools. I'm not sure where Kent posts the source for that.

Quoted 6 lines · Stephen R. van den Berg

Now I tried this:
Combine 3.18.1 and rebase all the patches from bcache-dev onto that. But, in trying that, I get a consistent:

register_bcache() error opening /dev/sdb3: Invalid superblock: member info area missing

Quoted 7 lines

Anything I overlooked? The bcache-tools are straight from git too.
--
Stephen.
--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 8 lines · Rolf Fokkens

Hi Slava,

Sounds like the kernel (using bcache-dev) is not able to handle the current format. If so, bcache-tools may help in "reformatting" bcache devices, but that's no solution for existing systems.

So is my understanding correct that there's no easy kernel upgrade path (to bcache-dev) ?

Yes, correct. The on disk format changes in bcache-dev are just too deep to feasibly write backwards compat code, unfortunately.

And the on disk format is still in flux - for just a bit longer hopefully though, right now I'm working on a pretty major revamp that's getting close to done (self describing and packed metadata). This revamp is making the on disk format _much_ more flexible though, and cleaning up a lot of stuff at the same time.

#4 lore raw

Please let us know when this will be pushed to the kernel, do you have any thoughts on the planning of this?

As a bcache-tools packager for Fedora I think I should add some package dependencies which prevent users from accidentally upgrading to that (breaking) version in the future.

It may also affect other tools like util-linux: https://github.com/karelzak/util-linux/blob/master/libblkid/src/superblocks/bcache.c

Furthermore I think I should postpone integration of bcache in the Fedora installer until further notice: https://bugzilla.redhat.com/show_bug.cgi?id=1003208

Any information in advance is appreciated.

Rolf

Quoted 1 line · Kent Overstreet

Yes, correct. The on disk format changes in bcache-dev are just too deep to feasibly write backwards compat code, unfortunately. And the on disk format is still in flux - for just a bit longer hopefully though, right now I'm working on a pretty major revamp that's getting close to done (self describing and packed metadata). This revamp is making the on disk format _much_ more flexible though, and cleaning up a lot of stuff at the same time.

#5 lore raw
Quoted 6 lines · Rolf Fokkens

Please let us know when this will be pushed to the kernel, do you have any thoughts on the planning of this?

As a bcache-tools packager for Fedora I think I should add some package dependencies which prevent users from accidentally upgrading to that (breaking) version in the future.

The plan is to incrementally backport bug fixes and optimizations from bcache-dev to upstream for the foreseeable future.

The development branch is going through major changes to support dynamically adding/removing cache devices and storing data in the btree instead of using it as a cache, enabling usage without any backing devices. We're actively working on this code and doing a lot of stress testing of both the new stuff and backing device support. However, it's its too early to tell what the new features will look like by the time they're ready to go upstream, or what a transition plan will look like for existing installs.

I wish we had more time for upstreaming stuff, but I can assure you its not Kent's intent to just dump bcache-dev as one huge pull request :-)

Quoted 24 lines

It may also affect other tools like util-linux:
https://github.com/karelzak/util-linux/blob/master/libblkid/src/superblocks/bcache.c

Furthermore I think I should postpone integration of bcache in the Fedora installer until further notice:
https://bugzilla.redhat.com/show_bug.cgi?id=1003208

Any information in advance is appreciated.

Rolf

Quoted 8 lines · Kent Overstreet

Yes, correct. The on disk format changes in bcache-dev are just too deep to feasibly write backwards compat code, unfortunately. And the on disk format is still in flux - for just a bit longer hopefully though, right now I'm working on a pretty major revamp that's getting close to done (self describing and packed metadata). This revamp is making the on disk format _much_ more flexible though, and cleaning up a lot of stuff at the same time.

#14 lore raw
In reply to Kent Overstreet
Quoted 5 lines · Kent Overstreet

Yes, correct. The on disk format changes in bcache-dev are just too deep to feasibly write backwards compat code, unfortunately.

And the on disk format is still in flux - for just a bit longer hopefully though, right now I'm working on a pretty major revamp that's getting close to

Any chance we could get a git url of the bcache-tools-in-flux as well?

Signature · 1 line
Stephen.
#15 lore raw
Quoted 8 lines · Stephen R. van den Berg
Quoted 5 lines · Kent Overstreet

Yes, correct. The on disk format changes in bcache-dev are just too deep to feasibly write backwards compat code, unfortunately.

And the on disk format is still in flux - for just a bit longer hopefully though, right now I'm working on a pretty major revamp that's getting close to

Any chance we could get a git url of the bcache-tools-in-flux as well?

Yeah, I just pushed the current (very much WIP) stuff to the bcache-dev branch under the main bcache-tools repo

#16 lore raw
Quoted 5 lines · Kent Overstreet
Quoted 3 lines · Stephen R. van den Berg
Quoted 2 lines · Kent Overstreet

Yes, correct. The on disk format changes in bcache-dev are just too deep to feasibly write backwards compat code, unfortunately.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

And the on disk format is still in flux - for just a bit longer hopefully though, right now I'm working on a pretty major revamp that's getting close to

Any chance we could get a git url of the bcache-tools-in-flux as well?

Yeah, I just pushed the current (very much WIP) stuff to the bcache-dev branch under the main bcache-tools repo

Maybe I'm not looking in the right spot, but I do not see that branch. What is the main bcache-tools repo?

Signature · 1 line
Stephen.
#17 lore raw

http://evilpiepirate.org/git/bcache-tools.git

Quoted 18 lines · Stephen R. van den Berg
Quoted 5 lines · Kent Overstreet
Quoted 3 lines · Stephen R. van den Berg
Quoted 2 lines · Kent Overstreet

Yes, correct. The on disk format changes in bcache-dev are just too deep to feasibly write backwards compat code, unfortunately.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

And the on disk format is still in flux - for just a bit longer hopefully though, right now I'm working on a pretty major revamp that's getting close to

Any chance we could get a git url of the bcache-tools-in-flux as well?

Yeah, I just pushed the current (very much WIP) stuff to the bcache-dev branch under the main bcache-tools repo

Maybe I'm not looking in the right spot, but I do not see that branch. What is the main bcache-tools repo?
--
Stephen.

#6 lore raw
In reply to Slava Pestov
Quoted 1 line · Slava Pestov

The plan is to incrementally backport bug fixes and optimizations from bcache-dev to upstream for the foreseeable future.

I assume (hope) this won't break bcache w.r.t. the current block device layout?

Quoted 1 line

The development branch is going through major changes to support dynamically adding/removing cache devices

Sound nices, that creates great flexibility. Does this also introduce the option of storing mirrored writeback data, while storing single copy read (cached) data (when having multiple SSD's as a cache)?

Quoted 1 line

and storing data in the btree instead of using it as a cache, enabling usage without any backing devices.

The needs some explanation. I assume you mean it operates as writeback bache that never flushes. If that's correct, I can only imagine it's useful when initially using it. And in that case seems a kind of a time bomb, because when it's "full" (and there's still no backing device)... what happens then?

Quoted 1 line

We're actively working on this code and doing a lot of stress testing of both the new stuff and backing device support. However, it's its too early to tell what the new features will look like by the time they're ready to go upstream, or what a transition plan will look like for existing installs. I wish we had more time for upstreaming stuff, but I can assure you its not Kent's intent to just dump bcache-dev as one huge pull request :-)

As an ethousiastic bcache user myself I would be very happy if there's a transition plan! :-)

Out of curiosity, will the backing device layout in general change, or will specifically the superblock change? If it's 'only' the superblock (and not it's size) I can imagine a feasable migration.

Rolf

#7 lore raw
Quoted 7 lines · Rolf Fokkens
Quoted 3 lines · Slava Pestov

The plan is to incrementally backport bug fixes and optimizations from bcache-dev to upstream for the foreseeable future.

I assume (hope) this won't break bcache w.r.t. the current block device layout?

Correct.

Slava

#8 lore raw
In reply to Rolf Fokkens
Quoted 10 lines · Rolf Fokkens
Quoted 2 lines · Slava Pestov

The plan is to incrementally backport bug fixes and optimizations from bcache-dev to upstream for the foreseeable future.

I assume (hope) this won't break bcache w.r.t. the current block device layout?

Quoted 2 lines

The development branch is going through major changes to support dynamically adding/removing cache devices

Sound nices, that creates great flexibility. Does this also introduce the option of storing mirrored writeback data, while storing single copy read (cached) data (when having multiple SSD's as a cache)?

Yup, and a lot more.

Quoted 6 lines
Quoted 2 lines

and storing data in the btree instead of using it as a cache, enabling usage without any backing devices.

The needs some explanation. I assume you mean it operates as writeback bache that never flushes. If that's correct, I can only imagine it's useful when initially using it. And in that case seems a kind of a time bomb, because when it's "full" (and there's still no backing device)... what happens then?

What Slava is alluding to is that bcache is becoming a full posix filesystem - I was actually demoing it... nearly a year ago, I think. With eventual feature parity with btrfs and much, much better performance.

None of the existing functionality is going away either, it'll just be faster and more robust.

Quoted 9 lines
Quoted 7 lines

We're actively working on this code and doing a lot of stress testing of both the new stuff and backing device support. However, it's its too early to tell what the new features will look like by the time they're ready to go upstream, or what a transition plan will look like for existing installs. I wish we had more time for upstreaming stuff, but I can assure you its not Kent's intent to just dump bcache-dev as one huge pull request :-)

As an ethousiastic bcache user myself I would be very happy if there's a transition plan! :-)

The exact transition plan is really up in the air, but for just caching backing devices you'll always be able to detach the cache set, reformat the cache set while using your backing device in passthrough mode, and then reattach.

#9 lore raw

Hi Kent,

Quoted 17 lines · Kent Overstreet
Quoted 10 lines · Rolf Fokkens
Quoted 2 lines · Slava Pestov

The plan is to incrementally backport bug fixes and optimizations from bcache-dev to upstream for the foreseeable future.

I assume (hope) this won't break bcache w.r.t. the current block device layout?

Quoted 2 lines

The development branch is going through major changes to support dynamically adding/removing cache devices

Sound nices, that creates great flexibility. Does this also introduce the option of storing mirrored writeback data, while storing single copy read (cached) data (when having multiple SSD's as a cache)?

Yup, and a lot more.

Quoted 2 lines
Quoted 2 lines

and storing data in the btree instead of using it as a cache, enabling usage without any backing devices.

Quoted 9 lines
Quoted 4 lines

The needs some explanation. I assume you mean it operates as writeback bache that never flushes. If that's correct, I can only imagine it's useful when initially using it. And in that case seems a kind of a time bomb, because when it's "full" (and there's still no backing device)... what happens then?

What Slava is alluding to is that bcache is becoming a full posix filesystem - I was actually demoing it... nearly a year ago, I think. With eventual feature parity with btrfs and much, much better performance.

btrfs use COW b-tree shadowing to support snapshots and clones, what approach will this new bcache FS use to support those features?

And will this new FS continue to use 2MB buckets without random writes in them? if that's the case, when this new FS is used on SSDs only, I guess FS GC has to be turned on for all buckets to reclaim free space. Since a lot of SSDs use parallel writes, some use compression, it's not possible to align one logical 2MB bucket at FS level to one single physical NAND block, then GC will be performed twice for one dirty bucket at different levels, so SSD life will be cut in half in the worst case?

Quoted 13 lines

None of the existing functionality is going away either, it'll just be faster and more robust.

Quoted 9 lines
Quoted 7 lines

We're actively working on this code and doing a lot of stress testing of both the new stuff and backing device support. However, it's its too early to tell what the new features will look like by the time they're ready to go upstream, or what a transition plan will look like for existing installs. I wish we had more time for upstreaming stuff, but I can assure you its not Kent's intent to just dump bcache-dev as one huge pull request :-)

As an ethousiastic bcache user myself I would be very happy if there's a transition plan! :-)

Quoted 7 lines

The exact transition plan is really up in the air, but for just caching backing devices you'll always be able to detach the cache set, reformat the cache set while using your backing device in passthrough mode, and then reattach. --
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Jianjian

#11 lore raw
In reply to Rolf Fokkens
Quoted 5 lines · Rolf Fokkens
Quoted 2 lines · Slava Pestov

The plan is to incrementally backport bug fixes and optimizations from bcache-dev to upstream for the foreseeable future.

As an ethousiastic bcache user myself I would be very happy if there's a transition plan! :-)

Would it make sense to call this bcache2 and merge both into the linux tree once bcache2 is stable enough for broader testing?

To the extent possible, you could reuse common code paths and simplify the backporting of bug fixes into the existing stable branch.

-Eric

Quoted 10 lines

Out of curiosity, will the backing device layout in general change, or will specifically the superblock change? If it's 'only' the superblock (and not it's size) I can imagine a feasable migration.

Rolf
--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#10 lore raw
In reply to Jianjian Huo
Quoted 25 lines · Jianjian Huo

Hi Kent,

Quoted 22 lines · Kent Overstreet
Quoted 10 lines · Rolf Fokkens
Quoted 2 lines · Slava Pestov

The plan is to incrementally backport bug fixes and optimizations from bcache-dev to upstream for the foreseeable future.

I assume (hope) this won't break bcache w.r.t. the current block device layout?

Quoted 2 lines

The development branch is going through major changes to support dynamically adding/removing cache devices

Sound nices, that creates great flexibility. Does this also introduce the option of storing mirrored writeback data, while storing single copy read (cached) data (when having multiple SSD's as a cache)?

Yup, and a lot more.

Quoted 6 lines
Quoted 2 lines

and storing data in the btree instead of using it as a cache, enabling usage without any backing devices.

The needs some explanation. I assume you mean it operates as writeback bache that never flushes. If that's correct, I can only imagine it's useful when initially using it. And in that case seems a kind of a time bomb, because when it's "full" (and there's still no backing device)... what happens then?

Quoted 7 lines
Quoted 4 lines

What Slava is alluding to is that bcache is becoming a full posix filesystem - I was actually demoing it... nearly a year ago, I think. With eventual feature parity with btrfs and much, much better performance.

btrfs use COW b-tree shadowing to support snapshots and clones, what approach will this new bcache FS use to support those features?

bcache has always been COW for data, and it supports copy offload (i.e. btrfs reflink) today via just multiple extents pointing to the same data.

I'll write up the plan for snapshots at some point, it's quite different from the btrfs approach.

Quoted 8 lines

And will this new FS continue to use 2MB buckets without random writes in them? if that's the case, when this new FS is used on SSDs only, I guess FS GC has to be turned on for all buckets to reclaim free space. Since a lot of SSDs use parallel writes, some use compression, it's not possible to align one logical 2MB bucket at FS level to one single physical NAND block, then GC will be performed twice for one dirty bucket at different levels, so SSD life will be cut in half in the worst case?

Yeah that is a potential issue, for SSDs what we really want is to get raw access to flash and have bcache be the FTL. Even if that doesn't happen there are things we can do to mitigate though, suffice it to say this issue has been discussed a lot :)

#12 lore raw
In reply to Eric Wheeler
Quoted 10 lines · Eric Wheeler
Quoted 5 lines · Rolf Fokkens
Quoted 2 lines · Slava Pestov

The plan is to incrementally backport bug fixes and optimizations from bcache-dev to upstream for the foreseeable future.

As an ethousiastic bcache user myself I would be very happy if there's a transition plan! :-)

Would it make sense to call this bcache2 and merge both into the linux tree once bcache2 is stable enough for broader testing?

Yeah that might be what happens.

Quoted 2 lines

To the extent possible, you could reuse common code paths and simplify the backporting of bug fixes into the existing stable branch.

Code reuse is problematic because struct bkey itself changes, a lot of the code that's factored out as a library now depends on the specific layout of struct bkey :/

Gonna try and backport as much as possible that doesn't require changing the on disk format when I have time, though.

#13 lore raw
Quoted 3 lines · Kent Overstreet
Quoted 1 line · Eric Wheeler

Would it make sense to call this bcache2 and merge both into the linux tree once bcache2 is stable enough for broader testing?

Yeah that might be what happens.

I would be very much in favour if this approach. The (temporary) availability of both bcache and bcache2 gives users not only time to test it, but to migrate as well.