staging: writeboost: Add dm-writeboost
Subsystems (2)
PATCH v2 1/1 staging: writeboost: Add dm-writeboost
This patch adds dm-writeboost to staging tree.
dm-writeboost is a log-structured SSD-caching driver. It caches data in log-structured way on the cache device so that the performance is maximized.
The merit of putting this driver in staging tree is to make it possible to get more feedback from users and polish the codes.
--- MAINTAINERS | 6 + drivers/staging/Kconfig | 2 + drivers/staging/Makefile | 1 + drivers/staging/writeboost/Kconfig | 6 + drivers/staging/writeboost/Makefile | 6 + drivers/staging/writeboost/README.txt | 228 +++ drivers/staging/writeboost/TODO | 52 + drivers/staging/writeboost/dm-writeboost-daemon.c | 537 ++++++ drivers/staging/writeboost/dm-writeboost-daemon.h | 39 + .../staging/writeboost/dm-writeboost-metadata.c | 1862 ++++++++++++++++++++ .../staging/writeboost/dm-writeboost-metadata.h | 52 + drivers/staging/writeboost/dm-writeboost-target.c | 1770 +++++++++++++++++++ drivers/staging/writeboost/dm-writeboost.h | 586 ++++++ 13 files changed, 5147 insertions(+) create mode 100644 drivers/staging/writeboost/Kconfig create mode 100644 drivers/staging/writeboost/Makefile create mode 100644 drivers/staging/writeboost/README.txt create mode 100644 drivers/staging/writeboost/TODO create mode 100644 drivers/staging/writeboost/dm-writeboost-daemon.c create mode 100644 drivers/staging/writeboost/dm-writeboost-daemon.h create mode 100644 drivers/staging/writeboost/dm-writeboost-metadata.c create mode 100644 drivers/staging/writeboost/dm-writeboost-metadata.h create mode 100644 drivers/staging/writeboost/dm-writeboost-target.c create mode 100644 drivers/staging/writeboost/dm-writeboost.h
MAINTAINERS +6 -0
@@ -8983,6 +8983,12 @@ M: Arnaud Patard <[email protected]> S: Odd Fixes F: drivers/staging/xgifb/ +STAGING - LOG STRUCTURED CACHING +M: Akira Hayakawa <[email protected]> +S: Maintained +L: [email protected] +F: drivers/staging/writeboost + STARFIRE/DURALAN NETWORK DRIVER M: Ion Badulescu <[email protected]> S: Odd Fixes
drivers/staging/Kconfig +2 -0
@@ -108,4 +108,6 @@ source "drivers/staging/skein/Kconfig" source "drivers/staging/unisys/Kconfig" +source "drivers/staging/writeboost/Kconfig" + endif # STAGING
drivers/staging/Makefile +1 -0
@@ -46,3 +46,4 @@ obj-$(CONFIG_MTD_SPINAND_MT29F) += mt29f_spinand/ obj-$(CONFIG_GS_FPGABOOT) += gs_fpgaboot/ obj-$(CONFIG_CRYPTO_SKEIN) += skein/ obj-$(CONFIG_UNISYSSPAR) += unisys/ +obj-$(CONFIG_DM_WRITEBOOST) += writeboost/
drivers/staging/writeboost/Kconfig new file +6 -0
@@ -0,0 +1,6 @@ +config DM_WRITEBOOST + tristate "Writeboost target" + depends on BLK_DEV_DM + default n + ---help--- + Cache target optimised for streaming writes.
drivers/staging/writeboost/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +dm-writeboost-objs := \ + dm-writeboost-target.o \ + dm-writeboost-metadata.o \ + dm-writeboost-daemon.o + +obj-$(CONFIG_DM_WRITEBOOST) += dm-writeboost.o
drivers/staging/writeboost/README.txt new file +228 -0
228 lines not on this page · raw message
drivers/staging/writeboost/TODO new file +52 -0
52 lines not on this page · raw message
drivers/staging/writeboost/dm-writeboost-daemon.c new file +537 -0
537 lines not on this page · raw message
drivers/staging/writeboost/dm-writeboost-daemon.h new file +39 -0
@@ -0,0 +1,39 @@ +/* +* Copyright (C) 2012-2014 Akira Hayakawa <[email protected]> +* +* This file is released under the GPL. +*/ + +#ifndef DM_WRITEBOOST_DAEMON_H +#define DM_WRITEBOOST_DAEMON_H + +/*----------------------------------------------------------------*/ + +void flush_proc (struct work_struct *); +void wait_for_flushing (struct wb_device *,u64 id); + +/*----------------------------------------------------------------*/ + +void queue_barrier_io (struct wb_device *,struct bio *); +void flush_barrier_ios (struct work_struct *); + +/*----------------------------------------------------------------*/ + +int writeback_proc (void *); +void wait_for_writeback (struct wb_device *,u64 id); + +/*----------------------------------------------------------------*/ + +int modulator_proc (void *); + +/*----------------------------------------------------------------*/ + +int sync_proc (void *); + +/*----------------------------------------------------------------*/ + +int recorder_proc (void *); + +/*----------------------------------------------------------------*/ + +#endif
drivers/staging/writeboost/dm-writeboost-metadata.c new file +1862 -0
1,862 lines not on this page · raw message
drivers/staging/writeboost/dm-writeboost-metadata.h new file +52 -0
52 lines not on this page · raw message
drivers/staging/writeboost/dm-writeboost-target.c new file +1770 -0
196 lines not on this page · raw message
drivers/staging/writeboost/dm-writeboost.h new file +586 -0
586 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.8.5.5
Part of the diff is not shown here. View the raw message.
Quoted 11 lines · Akira Hayakawa
This patch adds dm-writeboost to staging tree.
dm-writeboost is a log-structured SSD-caching driver. It caches data in log-structured way on the cache device so that the performance is maximized.
The merit of putting this driver in staging tree is to make it possible to get more feedback from users and polish the codes.
Signed-off-by Akira Hayakawa <[email protected]>
Joe Thornber Nacked this from going into staging based on his further review of the code. On the basis that you should _not_ be copying all pages associated with each bio into an in-core buffer. Have you addressed that fundamental problem?
But taking a step back: Why do you think going into staging actually helps you? Anyone who is willing to test this code should be able to apply a patch to their kernel. Having to feed changes to Greg to deliver updates to any early consumers of this _EXPERIMENTAL_ target seems misplaced when you consider that Joe has detailed important fixes, capabilties and tools that need addressing before anyone should trust their production data to dm-writeboost.
I think you're completely missing that you are pushing _hard_ for this target to go upstream before it is actually ready. In doing so you're so hung up on that "upstream" milestone that you cannot appreciate the reluctance that Joe and I have given the quantity of code you're pushing -- especially when coupled with the limited utility of dm-writeboost in comparison with full featured upstream drivers like dm-cache and bcache.
As for this v2, you didn't detail what you changed (I can obviously apply v1 and then v2 to see the difference but a brief summary would be helpful in general when you revise a patch)
But one inline comment:
drivers/staging/writeboost/TODO line 3
Quoted 9 lines
drivers/staging/writeboost/TODO new file +3
-0@@ -0,0 +1,52 @@ +TODO: + +- Get the GitExtract test so it's performance is similar to raw spindle.
No, the whole point of a write cache is to improve performance. You should be trying to surpass the performance of the raw spindle.
Mike,
Below is my comments against Joe's previous comments:
1. Writeboost shouldn't split the bio into 4KB chunks. No. It is necessary.
I know WALB (https://github.com/starpos/walb) logs data without splitting but the data structure becomes complicated. If you read my code carefully, you will notice that splitting helps the design simplicity and performance.
2. Writeboost has to avoid copying of data to in-core buffer. No. It is also necessary.
Think about partial write (smaller than 4KB).
Also, think about it's incoming I/O amount is even smaller than the memory throughput. So, it won't affect the performance and it's actually not (see the fio performance).
I will also copy data when I implement read-caching that will be surely criticized by you or Joe eventually.
As for the way of discussing,
it's NOT fair to discuss based on technically not meaningful data that is measured on VM in this case. It's violence, not discussion. I am really amazed by you two suddenly "unstably" turning into nacking within a day.
I showed you a data that Writeboost already surpasses the spindle but you ignored it is also unfair. Did you think I cheated? With read-caching, Writeboost can be more performant for sure.
My conclusion at this point is I don't like to change these two fundamental design decision. If you want to nack without knowing how important these things, it's fairly OK because device-mapper is your castle. But in that case, I can't (not won't) persuade you and
sadly, retrieve from not only upstreaming *forever*.
I think you don't even try to understand the importance of Writeboost. Although this guy really understand it (https://github.com/yongseokoh/dm-src).
The SSD-caching should be log-structured.
- Akira
Quoted 54 lines · Mike Snitzer
Quoted 11 lines · Akira Hayakawa
This patch adds dm-writeboost to staging tree.
dm-writeboost is a log-structured SSD-caching driver. It caches data in log-structured way on the cache device so that the performance is maximized.
The merit of putting this driver in staging tree is to make it possible to get more feedback from users and polish the codes.
Signed-off-by Akira Hayakawa <[email protected]>Joe Thornber Nacked this from going into staging based on his further review of the code. On the basis that you should _not_ be copying all pages associated with each bio into an in-core buffer. Have you addressed that fundamental problem?
But taking a step back: Why do you think going into staging actually helps you? Anyone who is willing to test this code should be able to apply a patch to their kernel. Having to feed changes to Greg to deliver updates to any early consumers of this _EXPERIMENTAL_ target seems misplaced when you consider that Joe has detailed important fixes, capabilties and tools that need addressing before anyone should trust their production data to dm-writeboost.
I think you're completely missing that you are pushing _hard_ for this target to go upstream before it is actually ready. In doing so you're so hung up on that "upstream" milestone that you cannot appreciate the reluctance that Joe and I have given the quantity of code you're pushing -- especially when coupled with the limited utility of dm-writeboost in comparison with full featured upstream drivers like dm-cache and bcache.
As for this v2, you didn't detail what you changed (I can obviously apply v1 and then v2 to see the difference but a brief summary would be helpful in general when you revise a patch)
But one inline comment:
drivers/staging/writeboost/TODO line 3
Quoted 9 lines
drivers/staging/writeboost/TODO new file +3
-0@@ -0,0 +1,52 @@ +TODO: + +- Get the GitExtract test so it's performance is similar to raw spindle.No, the whole point of a write cache is to improve performance. You should be trying to surpass the performance of the raw spindle.
Quoted 6 lines · Akira Hayakawa
1. Writeboost shouldn't split the bio into 4KB chunks. No. It is necessary.
I know WALB (https://github.com/starpos/walb) logs data without splitting but the data structure becomes complicated. If you read my code carefully, you will notice that splitting helps the design simplicity and performance.
This is the first time I see someone claiming that reducing the request size improves performance. I don't know any SSD model for which splitting requests improves performance.
Additionally, since bio's are split by dm-writeboost, this makes me wonder how atomic writes will ever be supported ? Atomic writes are being standardized by the T10 SCSI committee. I don't think the Linux block layer already supports atomic writes today but I expect support for atomic writes to be added to the block layer sooner or later. See e.g. http://www.t10.org/doc13.htm / SBC-4 SPC-5 Atomic writes and reads for the latest draft specification.
Bart.
Quoted 1 line · Bart Van Assche
This is the first time I see someone claiming that reducing the request size improves performance. I don't know any SSD model for which splitting requests improves performance.
Writeboost batches number of writes into a log (that is 512KB large) and submits to SSD which maximizes the throughput and the lifetime of the SSD.
I think you fairly misunderstand how Writeboost works.
- Akira
Quoted 2 lines · Akira Hayakawa
Writeboost batches number of writes into a log (that is 512KB large) and submits to SSD which maximizes the throughput and the lifetime of the SSD.
Does this mean that dm-writeboost is similar to btier ? If so, this makes me wonder which of these two subsystems would be the best candidate for upstream inclusion. As far as I know btier doesn't split bio's. The source code of btier can be downloaded from http://sourceforge.net/projects/tier/.
Bart.
Quoted 5 lines · Bart Van Assche
Quoted 2 lines · Akira Hayakawa
Writeboost batches number of writes into a log (that is 512KB large) and submits to SSD which maximizes the throughput and the lifetime of the SSD.
Does this mean that dm-writeboost is similar to btier ? If so, this makes me wonder which of these two subsystems would be the best candidate for upstream inclusion. As far as I know btier doesn't split bio's. The source code of btier can be downloaded from http://sourceforge.net/projects/tier/.
No, Btier is a caching (tiering actually but there is little difference) software like bcache or dm-cache, which are are open source software reimplementations of things like LSI CacheCade.
OTOH dm-writeboost is an open source software reimplementation of a BBWC (battery backed write cache) of disk controllers.
For this reason dm-writeboost was unique in its class and no doubt it could be blazing fast (untested by me) if correctly implemented, orders of magnitude faster than caching softwares, and I was looking forward to see dm-writeboost into the kernel.
But me too I think that dm-writeboost really needs not to split BIOs (whoever thinks differently has probably never looked at perf while a very fast raid system was writing data), and as much as possible not perform memcopy, and would need to detect and skip sequential I/O (adding logic to still be safe on sync + power loss) and use writethrough for that which I think it also doesn't do. These are absolute requirements for high performance storage systems in the 2-20 gigabytes per second range. If Akira doesn't see the need to not perform memcpy or not split BIOs or not skip sequential I/O it is most certainly because he hasn't tried to build a high performance storage system. Unfortunately I think that high performance storage systems are indeed the main market for writeboost, so that's why these things are needed.
Another important missing feature is way to decommission writeboost or put it into writethrough mode, so to be able to snapshot the underlying device. This is totally needed in an industrial-grade production system.
OTOH read caching would have been useless for writeboost btw imho, and hence counterproductive. Layer dm-cache or bcache on top of writeboost if you need that.
S.
Those are nice features to have. But, for those make_request virtual block drivers, I don't think there is a way to get rid of bio splitting totally. For example, underlying devices have their own io limits, you have to split bio in order to follow those limits. OTOH, reducing splitting as much as possible definitely will save CPU cycles and improve throughput.
-Jianjian
Quoted 55 lines · Spelic
Quoted 8 lines · Bart Van Assche
Quoted 4 lines · Akira Hayakawa
Writeboost batches number of writes into a log (that is 512KB large) and submits to SSD
which maximizes the throughput and the lifetime of the SSD.Quoted 4 lines
Does this mean that dm-writeboost is similar to btier ? If so, this makes me wonder which of these two subsystems would be the best candidate for upstream inclusion. As far as I know btier doesn't split bio's. The source code of btier can be downloaded from http://sourceforge.net/projects/tier/.
No, Btier is a caching (tiering actually but there is little difference) software like bcache or dm-cache, which are are open source software reimplementations of things like LSI CacheCade.
OTOH dm-writeboost is an open source software reimplementation of a BBWC (battery backed write cache) of disk controllers.
For this reason dm-writeboost was unique in its class and no doubt it could be blazing fast (untested by me) if correctly implemented, orders of magnitude faster than caching softwares, and I was looking forward to see dm-writeboost into the kernel.
But me too I think that dm-writeboost really needs not to split BIOs (whoever thinks differently has probably never looked at perf while a very fast raid system was writing data), and as much as possible not perform memcopy, and would need to detect and skip sequential I/O (adding logic to still be safe on sync + power loss) and use writethrough for that which I think it also doesn't do. These are absolute requirements for high performance storage systems in the 2-20 gigabytes per second range. If Akira doesn't see the need to not perform memcpy or not split BIOs or not skip sequential I/O it is most certainly because he hasn't tried to build a high performance storage system. Unfortunately I think that high performance storage systems are indeed the main market for writeboost, so that's why these things are needed.
Another important missing feature is way to decommission writeboost or put it into writethrough mode, so to be able to snapshot the underlying device. This is totally needed in an industrial-grade production system.
OTOH read caching would have been useless for writeboost btw imho, and hence counterproductive. Layer dm-cache or bcache on top of writeboost if you need that.
S.
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
Quoted 1 line · Akira Hayakawa
The SSD-caching should be log-structured.
No argument there, and this is why I've supported you with dm-writeboost over the last couple of years.
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
- Joe
Quoted 8 lines
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
These decisions are made based on measurement. They are not naive. I am a man who dislikes performance optimization without measurement. As a result, I regard things brought by the simplicity much important than what's from other design decisions possible.
About the CPU consumption,
the average CPU consumption while performing random write fio with consumer level SSD is only 3% or so,
which is 5 times efficient than bcache per iops.
With RAM-backed cache device, it reaches about 1.5GB/sec throughput. Even in this case the CPU consumption is only 12%.
Please see this post,
http://www.redhat.com/archives/dm-devel/2014-February/msg00000.html
I don't think the CPU consumption is small enough to ignore.
About the memory consumption,
you seem to misunderstand the fact.
The rambufs are not dynamically allocated but statically. The default amount is 8MB and this is usually not to argue.
Quoted 5 lines
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
Some people deploy Writeboost in their daily use.
The sound of "log-structured" seems to easily attract storage guys' attention. If this driver is merged into upstream, I think it gains many audience and thus feedback.
When my driver was introduced by Phoronix before, it actually drew attentions. They must wait for Writeboost become available in upstream.
http://www.phoronix.com/scan.php?page=news_item&px=MTQ1Mjg
Quoted 3 lines
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
If you read the code further, you will find how simple the mechanism is. Not to mention the code itself is.
- Akira
Quoted 27 lines · Joe Thornber
Quoted 1 line · Akira Hayakawa
The SSD-caching should be log-structured.
No argument there, and this is why I've supported you with dm-writeboost over the last couple of years.
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
- Joe
If I understand it correctly, the whole idea indeed is very simple, the consumer/provider and circular buffer model. use SSD as a circular write buffer, write flush thread stores incoming writes to this buffer sequentially as provider, and writeback thread write those data logs sequentially into backing device as consumer.
If writeboost can do that without any random writes, then probably it can save SSD/FTL of doing a lot of dirty jobs, and utilize the faster sequential read/write performance from SSD. That'll be awesome. However, I saw every data log segment in its design has meta data header, like dirty_bits, so I guess writeboost has to randomly write those data headers of stored data logs in SSD; also, splitting all bio into 4KB will hurt its ability to get max raw SSD throughput, modern NAND Flash has pages much bigger than 4KB; so overall I think the actual benefits writeboost gets from this design will be discounted.
The good thing is that it seems writeboost doesn't use garbage collection to clean old invalid logs, this will avoid the double garage collection effect other caching module has, which essentially both caching module and internal SSD will perform garbage collections twice.
And one question, how long will be data logs replay time during init, if SSD is almost full of dirty data logs?
Jianjian
Quoted 84 lines · Akira Hayakawa
Quoted 8 lines
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
These decisions are made based on measurement. They are not naive. I am a man who dislikes performance optimization without measurement. As a result, I regard things brought by the simplicity much important than what's from other design decisions possible.
About the CPU consumption,
the average CPU consumption while performing random write fio with consumer level SSD is only 3% or so,
which is 5 times efficient than bcache per iops.With RAM-backed cache device, it reaches about 1.5GB/sec throughput. Even in this case the CPU consumption is only 12%.
Please see this post,
http://www.redhat.com/archives/dm-devel/2014-February/msg00000.htmlI don't think the CPU consumption is small enough to ignore.
About the memory consumption,
you seem to misunderstand the fact.
The rambufs are not dynamically allocated but statically. The default amount is 8MB and this is usually not to argue.Quoted 5 lines
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
Some people deploy Writeboost in their daily use.
The sound of "log-structured" seems to easily attract storage guys' attention. If this driver is merged into upstream, I think it gains many audience and thus feedback.
When my driver was introduced by Phoronix before, it actually drew attentions. They must wait for Writeboost become available in upstream.
http://www.phoronix.com/scan.php?page=news_item&px=MTQ1MjgQuoted 3 lines
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
If you read the code further, you will find how simple the mechanism is. Not to mention the code itself is.
- Akira
Quoted 19 lines · Joe Thornber
Quoted 1 line · Akira Hayakawa
The SSD-caching should be log-structured.
No argument there, and this is why I've supported you with dm-writeboost over the last couple of years.
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
Quoted 8 lines
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
- Joe
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
Hi,
Jianjian, You really get a point at the fundamental design.
Quoted 6 lines
If I understand it correctly, the whole idea indeed is very simple, the consumer/provider and circular buffer model. use SSD as a circular write buffer, write flush thread stores incoming writes to this buffer sequentially as provider, and writeback thread write those data logs sequentially into backing device as consumer.
Quoted 9 lines
If writeboost can do that without any random writes, then probably it can save SSD/FTL of doing a lot of dirty jobs, and utilize the faster sequential read/write performance from SSD. That'll be awesome. However, I saw every data log segment in its design has meta data header, like
dirty_bits, so I guess writeboost has to randomly write those data headers of stored data logs in SSD; also, splitting all bio into 4KB will hurt its ability to get max raw SSD throughput, modern NAND Flash has pages much bigger than 4KB; so overall I think the actual benefits writeboost gets from this design will be discounted.
You understand *almost* correctly.
Writeboost has two circular buffers, not one; RAM buffers and SSD. The incoming bio is split into 4KB chunks at the virtual make_request and are NOT directly remapped to the SSD.
As you mentioned, if I designed so, many update on the metadata happens. That's really bad since SSD is very bad at small update.
Actually, the 4KB bio is first stored in RAM buffer, which is 512KB large. There are (512-4)/4=127 4KB bio data stored in the RAM buffer and 4KB metadata section at the head is made after that.
The RAM buffer is now called "log" and as you mentioned, flushed to the SSD as 512KB sequential write. This definitely maximizes throughput and lifetime.
Unfortunately, this is not always the case because of barrier request handlings. But, when the writes is really heavy (e.g. massive dirty page writeback), Writeboost works as above.
Quoted 5 lines
The good thing is that it seems writeboost doesn't use garbage collection to clean old invalid logs, this will avoid the double garage collection effect other caching module has, which essentially both caching module and internal SSD will perform garbage collections twice.
Yes. And I believe SSDs can remove wear-leveling if I used it as fairly sequential. Am I right? Indeed, Writeboost is really SSD frinedly.
Quoted 2 lines
And one question, how long will be data logs replay time during init, if SSD is almost full of dirty data logs?
Sorry, I don't have a data now but it's slow as you may imagine. I will measure the time on later.
The major reason is, it needs to read full 512KB segment to calculate checksum to know if the log isn't half written.
(Read 500GB SSD that performs 500MB/sec seqread spends 1000secs)
I think making the procedure done in parallel to exploit the full internal parallelism inside SSD may improve performance but it's just the matter of coefficient down from 1 to 1/n. Definitely, Writeboost isn't fit for a machine that needs reboot frequently (e.g. desktop).
There is a way to reduce the init time. We can dump "what is the latest log written back" on the superblock. This can skip readings that aren't essential.
The corresponding code is replay_log_on_cache() function. Please read if you are interested.
Thanks,
- Akira
Quoted 118 lines · Jianjian Huo
If I understand it correctly, the whole idea indeed is very simple, the consumer/provider and circular buffer model. use SSD as a circular write buffer, write flush thread stores incoming writes to this buffer sequentially as provider, and writeback thread write those data logs sequentially into backing device as consumer.
If writeboost can do that without any random writes, then probably it can save SSD/FTL of doing a lot of dirty jobs, and utilize the faster sequential read/write performance from SSD. That'll be awesome. However, I saw every data log segment in its design has meta data header, like
dirty_bits, so I guess writeboost has to randomly write those data headers of stored data logs in SSD; also, splitting all bio into 4KB will hurt its ability to get max raw SSD throughput, modern NAND Flash has pages much bigger than 4KB; so overall I think the actual benefits writeboost gets from this design will be discounted.The good thing is that it seems writeboost doesn't use garbage collection to clean old invalid logs, this will avoid the double garage collection effect other caching module has, which essentially both caching module and internal SSD will perform garbage collections twice.
And one question, how long will be data logs replay time during init, if SSD is almost full of dirty data logs?
Jianjian
Quoted 77 lines · Akira Hayakawa
Quoted 8 lines
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
These decisions are made based on measurement. They are not naive. I am a man who dislikes performance optimization without measurement. As a result, I regard things brought by the simplicity much important than what's from other design decisions possible.
About the CPU consumption,
the average CPU consumption while performing random write fio with consumer level SSD is only 3% or so,
which is 5 times efficient than bcache per iops.With RAM-backed cache device, it reaches about 1.5GB/sec throughput. Even in this case the CPU consumption is only 12%.
Please see this post,
http://www.redhat.com/archives/dm-devel/2014-February/msg00000.htmlI don't think the CPU consumption is small enough to ignore.
About the memory consumption,
you seem to misunderstand the fact.
The rambufs are not dynamically allocated but statically. The default amount is 8MB and this is usually not to argue.Quoted 5 lines
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
Some people deploy Writeboost in their daily use.
The sound of "log-structured" seems to easily attract storage guys' attention. If this driver is merged into upstream, I think it gains many audience and thus feedback.
When my driver was introduced by Phoronix before, it actually drew attentions. They must wait for Writeboost become available in upstream.
http://www.phoronix.com/scan.php?page=news_item&px=MTQ1MjgQuoted 3 lines
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
If you read the code further, you will find how simple the mechanism is. Not to mention the code itself is.
- Akira
Quoted 25 lines · Joe Thornber
Quoted 1 line · Akira Hayakawa
The SSD-caching should be log-structured.
No argument there, and this is why I've supported you with dm-writeboost over the last couple of years.
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
Quoted 7 lines
Quoted 2 lines
- Joe
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
Hi,
Quoted 3 lines
The major reason is, it needs to read full 512KB segment to calculate checksum to know if the log isn't half written.
(Read 500GB SSD that performs 500MB/sec seqread spends 1000secs)
I've just measured how long the cache resuming is.
I use 2GB SSD for the cache device.
512KB seqread over the cache device:
8.252sec (242MB/sec)
Resume when all caches are dirty:
10.339sec
Typically, if you use 128GB SSD it will be 5-10 minutes.
As I predicted, resuming time is close to seqread.
In other words, it's fully IO-bound.
(If you read the code you will notice that it first searchs for the
oldest log as the starting point. It's 4KB metadata reads but spends to some extent. The other 2 sec is thought to be spent by this)
- Akira
Quoted 188 lines · Akira Hayakawa
Hi,
Jianjian, You really get a point at the fundamental design.
Quoted 6 lines
If I understand it correctly, the whole idea indeed is very simple, the consumer/provider and circular buffer model. use SSD as a circular write buffer, write flush thread stores incoming writes to this buffer sequentially as provider, and writeback thread write those data logs sequentially into backing device as consumer.
Quoted 9 lines
If writeboost can do that without any random writes, then probably it can save SSD/FTL of doing a lot of dirty jobs, and utilize the faster sequential read/write performance from SSD. That'll be awesome. However, I saw every data log segment in its design has meta data header, like
dirty_bits, so I guess writeboost has to randomly write those data headers of stored data logs in SSD; also, splitting all bio into 4KB will hurt its ability to get max raw SSD throughput, modern NAND Flash has pages much bigger than 4KB; so overall I think the actual benefits writeboost gets from this design will be discounted.You understand *almost* correctly.
Writeboost has two circular buffers, not one; RAM buffers and SSD. The incoming bio is split into 4KB chunks at the virtual
make_requestand are NOT directly remapped to the SSD.
As you mentioned, if I designed so, many update on the metadata happens. That's really bad since SSD is very bad at small update.Actually, the 4KB bio is first stored in RAM buffer, which is 512KB large. There are (512-4)/4=127 4KB bio data stored in the RAM buffer and 4KB metadata section at the head is made after that.
The RAM buffer is now called "log" and as you mentioned, flushed to the SSD as 512KB sequential write. This definitely maximizes throughput and lifetime.
Unfortunately, this is not always the case because of barrier request handlings. But, when the writes is really heavy (e.g. massive dirty page writeback), Writeboost works as above.
Quoted 5 lines
The good thing is that it seems writeboost doesn't use garbage collection to clean old invalid logs, this will avoid the double garage collection effect other caching module has, which essentially both caching module and internal SSD will perform garbage collections twice.
Yes. And I believe SSDs can remove wear-leveling if I used it as fairly sequential. Am I right? Indeed, Writeboost is really SSD frinedly.
Quoted 2 lines
And one question, how long will be data logs replay time during init, if SSD is almost full of dirty data logs?
Sorry, I don't have a data now but it's slow as you may imagine. I will measure the time on later.
The major reason is, it needs to read full 512KB segment to calculate checksum to know if the log isn't half written.
(Read 500GB SSD that performs 500MB/sec seqread spends 1000secs)
I think making the procedure done in parallel to exploit the full internal parallelism inside SSD may improve performance but it's just the matter of coefficient down from 1 to 1/n. Definitely, Writeboost isn't fit for a machine that needs reboot frequently (e.g. desktop).There is a way to reduce the init time. We can dump "what is the latest log written back" on the superblock. This can skip readings that aren't essential.
The corresponding code is
replay_log_on_cache()function. Please read if you are interested.Thanks,
- Akira
Quoted 118 lines · Jianjian Huo
If I understand it correctly, the whole idea indeed is very simple, the consumer/provider and circular buffer model. use SSD as a circular write buffer, write flush thread stores incoming writes to this buffer sequentially as provider, and writeback thread write those data logs sequentially into backing device as consumer.
If writeboost can do that without any random writes, then probably it can save SSD/FTL of doing a lot of dirty jobs, and utilize the faster sequential read/write performance from SSD. That'll be awesome. However, I saw every data log segment in its design has meta data header, like
dirty_bits, so I guess writeboost has to randomly write those data headers of stored data logs in SSD; also, splitting all bio into 4KB will hurt its ability to get max raw SSD throughput, modern NAND Flash has pages much bigger than 4KB; so overall I think the actual benefits writeboost gets from this design will be discounted.The good thing is that it seems writeboost doesn't use garbage collection to clean old invalid logs, this will avoid the double garage collection effect other caching module has, which essentially both caching module and internal SSD will perform garbage collections twice.
And one question, how long will be data logs replay time during init, if SSD is almost full of dirty data logs?
Jianjian
Quoted 77 lines · Akira Hayakawa
Quoted 8 lines
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
These decisions are made based on measurement. They are not naive. I am a man who dislikes performance optimization without measurement. As a result, I regard things brought by the simplicity much important than what's from other design decisions possible.
About the CPU consumption,
the average CPU consumption while performing random write fio with consumer level SSD is only 3% or so,
which is 5 times efficient than bcache per iops.With RAM-backed cache device, it reaches about 1.5GB/sec throughput. Even in this case the CPU consumption is only 12%.
Please see this post,
http://www.redhat.com/archives/dm-devel/2014-February/msg00000.htmlI don't think the CPU consumption is small enough to ignore.
About the memory consumption,
you seem to misunderstand the fact.
The rambufs are not dynamically allocated but statically. The default amount is 8MB and this is usually not to argue.Quoted 5 lines
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
Some people deploy Writeboost in their daily use.
The sound of "log-structured" seems to easily attract storage guys' attention. If this driver is merged into upstream, I think it gains many audience and thus feedback.
When my driver was introduced by Phoronix before, it actually drew attentions. They must wait for Writeboost become available in upstream.
http://www.phoronix.com/scan.php?page=news_item&px=MTQ1MjgQuoted 3 lines
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
If you read the code further, you will find how simple the mechanism is. Not to mention the code itself is.
- Akira
Quoted 25 lines · Joe Thornber
Quoted 1 line · Akira Hayakawa
The SSD-caching should be log-structured.
No argument there, and this is why I've supported you with dm-writeboost over the last couple of years.
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
Quoted 7 lines
Quoted 2 lines
- Joe
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
Quoted 31 lines · Akira Hayakawa
Hi,
Jianjian, You really get a point at the fundamental design.
Quoted 6 lines
If I understand it correctly, the whole idea indeed is very simple, the consumer/provider and circular buffer model. use SSD as a circular write buffer, write flush thread stores incoming writes to this buffer sequentially as provider, and writeback thread write those data logs sequentially into backing device as consumer.
Quoted 9 lines
If writeboost can do that without any random writes, then probably it can save SSD/FTL of doing a lot of dirty jobs, and utilize the faster sequential read/write performance from SSD. That'll be awesome. However, I saw every data log segment in its design has meta data header, like
dirty_bits, so I guess writeboost has to randomly write those data headers of stored data logs in SSD; also, splitting all bio into 4KB will hurt its ability to get max raw SSD throughput, modern NAND Flash has pages much bigger than 4KB; so overall I think the actual benefits writeboost gets from this design will be discounted.You understand *almost* correctly.
Writeboost has two circular buffers, not one; RAM buffers and SSD. The incoming bio is split into 4KB chunks at the virtual
make_requestand are NOT directly remapped to the SSD.
As you mentioned, if I designed so, many update on the metadata happens. That's really bad since SSD is very bad at small update.Actually, the 4KB bio is first stored in RAM buffer, which is 512KB large. There are (512-4)/4=127 4KB bio data stored in the RAM buffer and 4KB metadata section at the head is made after that.
Quoted 7 lines
The RAM buffer is now called "log" and as you mentioned, flushed to the SSD as 512KB sequential write. This definitely maximizes throughput and lifetime.
Unfortunately, this is not always the case because of barrier request handlings. But, when the writes is really heavy (e.g. massive dirty page writeback), Writeboost works as above.
How about invalidating previous writes on same sector address? if first write is stored in one 512KB log in SSD, later when user write the same address, will writeboost invalid old write by updating meta data header in place in that 512KB log? and other meta data like superblock, will writeboost will update them in place? if writeboost has those frequent random in-place updates, probably those benefits except utilizing the faster sequential writes will be much discounted.
Quoted 8 lines
Quoted 5 lines
The good thing is that it seems writeboost doesn't use garbage collection to clean old invalid logs, this will avoid the double garage collection effect other caching module has, which essentially both caching module and internal SSD will perform garbage collections twice.
Yes. And I believe SSDs can remove wear-leveling if I used it as fairly sequential. Am I right? Indeed, Writeboost is really SSD frinedly.
Even if writeboost write everything sequentially, probably SSD won't be able to recognize that and do its own wear-leveling whatsoever. It will be easier, since there is no need to move cold data, etc.
Generally, SSDs vary a lot, IMHO, one certain optimization technique may work for certain model, but may not work for others, since they internal NAND Flash management algorithms can be very different.
Quoted 142 lines
Quoted 2 lines
And one question, how long will be data logs replay time during init, if SSD is almost full of dirty data logs?
Sorry, I don't have a data now but it's slow as you may imagine. I will measure the time on later.
The major reason is, it needs to read full 512KB segment to calculate checksum to know if the log isn't half written.
(Read 500GB SSD that performs 500MB/sec seqread spends 1000secs)
I think making the procedure done in parallel to exploit the full internal parallelism inside SSD may improve performance but it's just the matter of coefficient down from 1 to 1/n. Definitely, Writeboost isn't fit for a machine that needs reboot frequently (e.g. desktop).There is a way to reduce the init time. We can dump "what is the latest log written back" on the superblock. This can skip readings that aren't essential.
The corresponding code is
replay_log_on_cache()function. Please read if you are interested.Thanks,
- Akira
Quoted 118 lines · Jianjian Huo
If I understand it correctly, the whole idea indeed is very simple, the consumer/provider and circular buffer model. use SSD as a circular write buffer, write flush thread stores incoming writes to this buffer sequentially as provider, and writeback thread write those data logs sequentially into backing device as consumer.
If writeboost can do that without any random writes, then probably it can save SSD/FTL of doing a lot of dirty jobs, and utilize the faster sequential read/write performance from SSD. That'll be awesome. However, I saw every data log segment in its design has meta data header, like
dirty_bits, so I guess writeboost has to randomly write those data headers of stored data logs in SSD; also, splitting all bio into 4KB will hurt its ability to get max raw SSD throughput, modern NAND Flash has pages much bigger than 4KB; so overall I think the actual benefits writeboost gets from this design will be discounted.The good thing is that it seems writeboost doesn't use garbage collection to clean old invalid logs, this will avoid the double garage collection effect other caching module has, which essentially both caching module and internal SSD will perform garbage collections twice.
And one question, how long will be data logs replay time during init, if SSD is almost full of dirty data logs?
Jianjian
Quoted 77 lines · Akira Hayakawa
Quoted 8 lines
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
These decisions are made based on measurement. They are not naive. I am a man who dislikes performance optimization without measurement. As a result, I regard things brought by the simplicity much important than what's from other design decisions possible.
About the CPU consumption,
the average CPU consumption while performing random write fio with consumer level SSD is only 3% or so,
which is 5 times efficient than bcache per iops.With RAM-backed cache device, it reaches about 1.5GB/sec throughput. Even in this case the CPU consumption is only 12%.
Please see this post,
http://www.redhat.com/archives/dm-devel/2014-February/msg00000.htmlI don't think the CPU consumption is small enough to ignore.
About the memory consumption,
you seem to misunderstand the fact.
The rambufs are not dynamically allocated but statically. The default amount is 8MB and this is usually not to argue.Quoted 5 lines
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
Some people deploy Writeboost in their daily use.
The sound of "log-structured" seems to easily attract storage guys' attention. If this driver is merged into upstream, I think it gains many audience and thus feedback.
When my driver was introduced by Phoronix before, it actually drew attentions. They must wait for Writeboost become available in upstream.
http://www.phoronix.com/scan.php?page=news_item&px=MTQ1MjgQuoted 3 lines
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
If you read the code further, you will find how simple the mechanism is. Not to mention the code itself is.
- Akira
Quoted 25 lines · Joe Thornber
Quoted 1 line · Akira Hayakawa
The SSD-caching should be log-structured.
No argument there, and this is why I've supported you with dm-writeboost over the last couple of years.
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
Quoted 7 lines
Quoted 2 lines
- Joe
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
Jianjian,
Quoted 7 lines
How about invalidating previous writes on same sector address? if first write is stored in one 512KB log in SSD, later when user write the same address, will writeboost invalid old write by updating meta data header in place in that 512KB log? and other meta data like superblock, will writeboost will update them in place? if writeboost has those frequent random in-place updates, probably those benefits except utilizing the faster sequential writes will be much discounted.
In runtime, Writeboost has equivalent metadata on the memory as hash table. This makes not only cache lookup fast but also makes invalidation easy. Without this, Writeboost's speed is really discounted.
Any logs on the cache device are never updated partially (it's too dangerous if we consider partial write failure). Durability is another benefit of log-structured caching.
As for writing on superblock, it's really random. But, we don't need to update superblock every write but every seconds or so. To begin with, it's not logically essential so you can turn it off (that's the default). The option is for users much care for the resume time.
Quoted 7 lines
Even if writeboost write everything sequentially, probably SSD won't be able to recognize that and do its own wear-leveling whatsoever. It will be easier, since there is no need to move cold data, etc.
Generally, SSDs vary a lot, IMHO, one certain optimization technique may work for certain model, but may not work for others, since they internal NAND Flash management algorithms can be very different.
Yes, Thanks.
I believe making the SSD-internal works easy can not only stabilize the performance but also reduce the possibility of being trapped by some bugs that the SSD provides such as petit freeze.
- Akira
Quoted 205 lines · Jianjian Huo
Quoted 31 lines · Akira Hayakawa
Hi,
Jianjian, You really get a point at the fundamental design.
Quoted 6 lines
If I understand it correctly, the whole idea indeed is very simple, the consumer/provider and circular buffer model. use SSD as a circular write buffer, write flush thread stores incoming writes to this buffer sequentially as provider, and writeback thread write those data logs sequentially into backing device as consumer.
Quoted 9 lines
If writeboost can do that without any random writes, then probably it can save SSD/FTL of doing a lot of dirty jobs, and utilize the faster sequential read/write performance from SSD. That'll be awesome. However, I saw every data log segment in its design has meta data header, like
dirty_bits, so I guess writeboost has to randomly write those data headers of stored data logs in SSD; also, splitting all bio into 4KB will hurt its ability to get max raw SSD throughput, modern NAND Flash has pages much bigger than 4KB; so overall I think the actual benefits writeboost gets from this design will be discounted.You understand *almost* correctly.
Writeboost has two circular buffers, not one; RAM buffers and SSD. The incoming bio is split into 4KB chunks at the virtual
make_requestand are NOT directly remapped to the SSD.
As you mentioned, if I designed so, many update on the metadata happens. That's really bad since SSD is very bad at small update.Actually, the 4KB bio is first stored in RAM buffer, which is 512KB large. There are (512-4)/4=127 4KB bio data stored in the RAM buffer and 4KB metadata section at the head is made after that.
Quoted 7 lines
The RAM buffer is now called "log" and as you mentioned, flushed to the SSD as 512KB sequential write. This definitely maximizes throughput and lifetime.
Unfortunately, this is not always the case because of barrier request handlings. But, when the writes is really heavy (e.g. massive dirty page writeback), Writeboost works as above.
How about invalidating previous writes on same sector address? if first write is stored in one 512KB log in SSD, later when user write the same address, will writeboost invalid old write by updating meta data header in place in that 512KB log? and other meta data like superblock, will writeboost will update them in place? if writeboost has those frequent random in-place updates, probably those benefits except utilizing the faster sequential writes will be much discounted.
Quoted 8 lines
Quoted 5 lines
The good thing is that it seems writeboost doesn't use garbage collection to clean old invalid logs, this will avoid the double garage collection effect other caching module has, which essentially both caching module and internal SSD will perform garbage collections twice.
Yes. And I believe SSDs can remove wear-leveling if I used it as fairly sequential. Am I right? Indeed, Writeboost is really SSD frinedly.
Even if writeboost write everything sequentially, probably SSD won't be able to recognize that and do its own wear-leveling whatsoever. It will be easier, since there is no need to move cold data, etc.
Generally, SSDs vary a lot, IMHO, one certain optimization technique may work for certain model, but may not work for others, since they internal NAND Flash management algorithms can be very different.
Quoted 142 lines
Quoted 2 lines
And one question, how long will be data logs replay time during init, if SSD is almost full of dirty data logs?
Sorry, I don't have a data now but it's slow as you may imagine. I will measure the time on later.
The major reason is, it needs to read full 512KB segment to calculate checksum to know if the log isn't half written.
(Read 500GB SSD that performs 500MB/sec seqread spends 1000secs)
I think making the procedure done in parallel to exploit the full internal parallelism inside SSD may improve performance but it's just the matter of coefficient down from 1 to 1/n. Definitely, Writeboost isn't fit for a machine that needs reboot frequently (e.g. desktop).There is a way to reduce the init time. We can dump "what is the latest log written back" on the superblock. This can skip readings that aren't essential.
The corresponding code is
replay_log_on_cache()function. Please read if you are interested.Thanks,
- Akira
Quoted 118 lines · Jianjian Huo
If I understand it correctly, the whole idea indeed is very simple, the consumer/provider and circular buffer model. use SSD as a circular write buffer, write flush thread stores incoming writes to this buffer sequentially as provider, and writeback thread write those data logs sequentially into backing device as consumer.
If writeboost can do that without any random writes, then probably it can save SSD/FTL of doing a lot of dirty jobs, and utilize the faster sequential read/write performance from SSD. That'll be awesome. However, I saw every data log segment in its design has meta data header, like
dirty_bits, so I guess writeboost has to randomly write those data headers of stored data logs in SSD; also, splitting all bio into 4KB will hurt its ability to get max raw SSD throughput, modern NAND Flash has pages much bigger than 4KB; so overall I think the actual benefits writeboost gets from this design will be discounted.The good thing is that it seems writeboost doesn't use garbage collection to clean old invalid logs, this will avoid the double garage collection effect other caching module has, which essentially both caching module and internal SSD will perform garbage collections twice.
And one question, how long will be data logs replay time during init, if SSD is almost full of dirty data logs?
Jianjian
Quoted 77 lines · Akira Hayakawa
Quoted 8 lines
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
These decisions are made based on measurement. They are not naive. I am a man who dislikes performance optimization without measurement. As a result, I regard things brought by the simplicity much important than what's from other design decisions possible.
About the CPU consumption,
the average CPU consumption while performing random write fio with consumer level SSD is only 3% or so,
which is 5 times efficient than bcache per iops.With RAM-backed cache device, it reaches about 1.5GB/sec throughput. Even in this case the CPU consumption is only 12%.
Please see this post,
http://www.redhat.com/archives/dm-devel/2014-February/msg00000.htmlI don't think the CPU consumption is small enough to ignore.
About the memory consumption,
you seem to misunderstand the fact.
The rambufs are not dynamically allocated but statically. The default amount is 8MB and this is usually not to argue.Quoted 5 lines
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
Some people deploy Writeboost in their daily use.
The sound of "log-structured" seems to easily attract storage guys' attention. If this driver is merged into upstream, I think it gains many audience and thus feedback.
When my driver was introduced by Phoronix before, it actually drew attentions. They must wait for Writeboost become available in upstream.
http://www.phoronix.com/scan.php?page=news_item&px=MTQ1MjgQuoted 3 lines
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
If you read the code further, you will find how simple the mechanism is. Not to mention the code itself is.
- Akira
Quoted 25 lines · Joe Thornber
Quoted 1 line · Akira Hayakawa
The SSD-caching should be log-structured.
No argument there, and this is why I've supported you with dm-writeboost over the last couple of years.
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
Quoted 7 lines
Quoted 2 lines
- Joe
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
Hi,
I've just measured how split affects.
I think seqread can make the discussion solid
so these are the cases of reading 6.4GB (64MB * 100) sequentially.
HDD:
64MB read
real 2m1.191s
user 0m0.000s
sys 0m0.470s
Writeboost (HDD+SSD):
64MB read
real 2m13.532s
user 0m0.000s
sys 0m28.740s
The splitting actually affects to some extent (2m1 -> 2m13 is 10% loss). But not too big if we consider the typical workload is NOT seqreads (if so, the user shouldn't use SSD caching).
Splitting bio into 4KB chunks makes the cache lookup and locking simple and this contributes to the performance of both write and read is the fact, don't miss it. Without this, especially, writes isn't so fast in Writeboost but rather loses its charms.
Since simple and fast is the ideal for any softwares. I am really unwilling to change this fundamental design; splitting.
But, an idea of selective splitting can be proposed for future enhancement. Add a layer so that a target can choose if it needs splitting or not may be interesting. I think Writeboost can bypass big writes/reads at the cost of duplicated cache lookup. Can DM-cache also benefit from this extension?
Conceptually, it's like this
before: bio -> ~map:bio->bio
after: bio -> ~should_split:bio->bool -> ~map:bio->bio
- Akira
Quoted 80 lines · Akira Hayakawa
Quoted 8 lines
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
These decisions are made based on measurement. They are not naive. I am a man who dislikes performance optimization without measurement. As a result, I regard things brought by the simplicity much important than what's from other design decisions possible.
About the CPU consumption,
the average CPU consumption while performing random write fio with consumer level SSD is only 3% or so,
which is 5 times efficient than bcache per iops.With RAM-backed cache device, it reaches about 1.5GB/sec throughput. Even in this case the CPU consumption is only 12%.
Please see this post,
http://www.redhat.com/archives/dm-devel/2014-February/msg00000.htmlI don't think the CPU consumption is small enough to ignore.
About the memory consumption,
you seem to misunderstand the fact.
The rambufs are not dynamically allocated but statically. The default amount is 8MB and this is usually not to argue.Quoted 5 lines
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
Some people deploy Writeboost in their daily use.
The sound of "log-structured" seems to easily attract storage guys' attention. If this driver is merged into upstream, I think it gains many audience and thus feedback.
When my driver was introduced by Phoronix before, it actually drew attentions. They must wait for Writeboost become available in upstream.
http://www.phoronix.com/scan.php?page=news_item&px=MTQ1MjgQuoted 3 lines
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
If you read the code further, you will find how simple the mechanism is. Not to mention the code itself is.
- Akira
Quoted 27 lines · Joe Thornber
Quoted 1 line · Akira Hayakawa
The SSD-caching should be log-structured.
No argument there, and this is why I've supported you with dm-writeboost over the last couple of years.
However, after looking at the current code, and using it I think it's a long, long way from being ready for production. As we've already discussed there are some very naive design decisions in there, such as copying every bio payload to another memory buffer, splitting all io down to 4k. Think about the cpu overhead and memory consumption! Think about how it will perform when memory is constrained and it can't allocate many of those rambufs! I'm sure more issues will be found if I read further.
I'm sorry to have disappointed you so, but if I let this go upstream it would mean a massive amount of support work for me, not to mention a damaged reputation for dm.
Mike raised the question of why you want this in the kernel so much? You'd find none of the distros would support it; so it doesn't widen your audience much. It's far better for you to maintain it outside of the kernel at this point. Any users will be bold, adventurous people, who will be quite capable of building a kernel module.
- Joe