1 |
Rich Freeman <rich0@g.o> schrieb: |
2 |
|
3 |
> On Sat, Jun 21, 2014 at 3:24 PM, Kai Krakow <hurikhan77@×××××.com> wrote: |
4 |
>> And while we are at it, I'd also like to mention bcache. Tho, conversion |
5 |
>> is not straight forward. However, I'm going to try that soon for my |
6 |
>> spinning rust btrfs. |
7 |
> |
8 |
> I contemplated that, but I'd really like to see btrfs support |
9 |
> something more native. Bcache is way too low-level for me and strikes |
10 |
> me as inefficient as a result. Plus, since it sits UNDER btrfs you'd |
11 |
> probably lose all the fancy volume management features. |
12 |
|
13 |
I don't see where you could lose the volume management features. You just |
14 |
add device on top of the bcache device after you initialized the raw device |
15 |
with a bcache superblock and attached it. The rest works the same, just that |
16 |
you use bcacheX instead of sdX devices. |
17 |
|
18 |
Bcache is a general approach and it seems to work very well for that |
19 |
already. There are hot data tracking patches and proposals to support adding |
20 |
a cache device to the btrfs pool and let btrfs migrate data back and forth |
21 |
between each. That would be native. But it still would lack the advanced |
22 |
features ZFS implements to make use of such caching devices, implementing |
23 |
even different strategies for ZIL, ARC, and L2ARC. That's the gap bcache |
24 |
tries to jump. |
25 |
|
26 |
> ZFS has ssd caching as part of the actual filesystem, and that seems |
27 |
> MUCH cleaner. |
28 |
|
29 |
Yes, it is much more mature in that regard. Comparing with ZFS, bcache is a |
30 |
lot like ZIL, while hot data relocation in btrfs would be a lot like L2ARC. |
31 |
ARC is a special purpose RAM cache separate from the VFS caches which has |
32 |
special knowledge about ZFS structures to keep performance high. Some |
33 |
filesystems implement something similar by keeping tree structures |
34 |
completely in RAM. I think, both bcache and hot data tracking take parts of |
35 |
the work that ARC does for ZFS - note that "hot data tracking" is a generic |
36 |
VFS interface, while "hot data relocation" is something from btrfs. Both |
37 |
work together but it is not there yet. |
38 |
|
39 |
From that point of view, I don't think something like ZIL should be |
40 |
implemented in btrfs itself but as a generic approach like bcache so every |
41 |
component in Linux can make use of it. Hot data relocation OTOH is |
42 |
interesting from another point of view and may become part of future btrfs |
43 |
as it benefits from knowledge about the filesystem itself, using a generic |
44 |
interface like "hot data tracking" in VFS - so other components can make use |
45 |
of that, too. |
46 |
|
47 |
A ZIL-like cache and hot data relocation could probably solve a lot of |
48 |
fragmentation issues (especially a ZIL-like cache), so I hope work for that |
49 |
will get pushed a little more soon. |
50 |
|
51 |
Having to prepare devices for bcache is kind of a show-stopper because it is |
52 |
no drop-in component that way. But OTOH I like that approach better than dm- |
53 |
cache because it protects from using the backing device without going |
54 |
through the caching layer which could otherwise severely damage your data, |
55 |
and you get along with fewer devices and don't need to size a meta device |
56 |
(which probably needs to grow later if you add devices, I don't know). |
57 |
|
58 |
-- |
59 |
Replies to list only preferred. |