staging: writeboost: Add dm-writeboost
Subsystems (2)
PATCH 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 | 47 + 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, 5142 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 +47 -0
47 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
201 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.
Greg KH
maintainerQuoted 39 lines · Akira Hayakawa
drivers/staging/writeboost/TODO new file +36
-0@@ -0,0 +1,47 @@ +TODO: + +- Expose bugs and fix them. +- Clean up the interfaces. Some input values should be limited in case user may choose too big values. +- Wait for proper review by Mike Snitzer. +- Fix up documents. + +------------------------------------------------------------------------- + +Project Ideas: + +1. Add read caching feature +Device-Mapper maintainer Mike Snitzer said that +a single target should provide caching for both reads and writes. +(cf. http://www.redhat.com/archives/dm-devel/2014-January/msg00078.html) + +To follow Mike's guide, I will implement read-caching for Writeboost. +The great idea is, at least conceptually, +sending back the read data to the write entrance. +I didn't notice this simple idea at that time of previous discussion. + +This should be done background and +some threshold to determine +which sequence of data should be staged. + +This feature will be implemented step-by-step. +I don't think this feature will change then interface drastically. + +2. Improve initialization time +Some user complains that the initialization is too slow. + +Any ideas? + +3. Reduce metadata footprint +Writeboost has a hash table in RAM for cache management. +This isn't cheap.
drivers/staging/writeboost/TODO line 46
Quoted 10 lines
drivers/staging/writeboost/TODO new file +10
-0+ +Any ideas? + +------------------------------------------------------------------------- + +Please send any patches +To: +Akira Hayakawa <[email protected]> +Cc: +Greg Kroah-Hartman <[email protected]>
Greg Kroah-Hartman <[email protected]> please, and also the driverdevel mailing list, which is where the rest of the staging patches go.
And, I'll need an ack from the dm maintainers before I can accept this as something they think is ok and will get merged to the "real" part of the kernel someday.
thanks,
greg k-h
Quoted 3 lines
Greg Kroah-Hartman <[email protected]> please, and also the driverdevel mailing list, which is where the rest of the staging patches go.
Sorry and yes, I will fix.
Quoted 3 lines
And, I'll need an ack from the dm maintainers before I can accept this as something they think is ok and will get merged to the "real" part of the kernel someday.
OK.
Mike and Alasdair,
I need your ack
- Akira
Quoted 63 lines · Greg KH
Quoted 39 lines · Akira Hayakawa
drivers/staging/writeboost/TODO new file +36
-0@@ -0,0 +1,47 @@ +TODO: + +- Expose bugs and fix them. +- Clean up the interfaces. Some input values should be limited in case user may choose too big values. +- Wait for proper review by Mike Snitzer. +- Fix up documents. + +------------------------------------------------------------------------- + +Project Ideas: + +1. Add read caching feature +Device-Mapper maintainer Mike Snitzer said that +a single target should provide caching for both reads and writes. +(cf. http://www.redhat.com/archives/dm-devel/2014-January/msg00078.html) + +To follow Mike's guide, I will implement read-caching for Writeboost. +The great idea is, at least conceptually, +sending back the read data to the write entrance. +I didn't notice this simple idea at that time of previous discussion. + +This should be done background and +some threshold to determine +which sequence of data should be staged. + +This feature will be implemented step-by-step. +I don't think this feature will change then interface drastically. + +2. Improve initialization time +Some user complains that the initialization is too slow. + +Any ideas? + +3. Reduce metadata footprint +Writeboost has a hash table in RAM for cache management. +This isn't cheap.drivers/staging/writeboost/TODO line 46
Quoted 10 lines
drivers/staging/writeboost/TODO new file +10
-0+ +Any ideas? + +------------------------------------------------------------------------- + +Please send any patches +To: +Akira Hayakawa <[email protected]> +Cc: +Greg Kroah-Hartman <[email protected]>Greg Kroah-Hartman <[email protected]> please, and also the driverdevel mailing list, which is where the rest of the staging patches go.
And, I'll need an ack from the dm maintainers before I can accept this as something they think is ok and will get merged to the "real" part of the kernel someday.
thanks,
greg k-h
Quoted 2 lines · Akira Hayakawa
Mike and Alasdair,
I need your ack
Hi Akira,
I just spent some time playing with your latest code. On the positive side I am seeing some good performance with the fio tests. Which is great, we know your design should outperform dm-cache with small random io.
However I'm still getting v. poor results with the git-extract test, which clones a linux kernel repo, and then checks out 5 revisions, all with drop_caches in between.
I'll summarise the results I get here:
raw SSD: 69, 107
raw spindle: 73, 184
dm-cache: 74, 118
writeboost type 0: 115, 247
writeboost type 1: 193, 275Each result consists of two numbers, the time to do the clone and the time to do the extract.
Writeboost is significantly slower than the spindle alone for this very simple test. I do not understand what is causing the issue. At first I thought it was because the working set is larger than the SSD space, but I get the same results even if there's more SSD space than spindle.
Running the same test using SSD on SSD also yields v. poor results:
115, 177 and 198, 218 for type 0 and type 1 respectively. Obviously this is a pointless configuration, but it does allow us to see the overhead of the caching layer.
It's fine to have different benefits of the caching software depending on the load. But I think the worst case should always be close to the performance of the raw spindle device.
If you get the following work items done I will ack to go upstream:
i) Get this test so it's performance is similar to raw spindle.
ii) Write good documentation in Documentation/device-mapper/. eg. How
do I remove a cache? When should I use dm-writeboost rather than bcache or dm-cache?
iii) Provide an equivalent to the fsck tool to repair a damaged cache.
- Joe
Quoted 6 lines · Joe Thornber
Quoted 2 lines · Akira Hayakawa
Mike and Alasdair,
I need your ackHi Akira,
Quoted 8 lines
I just spent some time playing with your latest code. On the positive side I am seeing some good performance with the fio tests. Which is great, we know your design should outperform dm-cache with small random io.
However I'm still getting v. poor results with the git-extract test, which clones a linux kernel repo, and then checks out 5 revisions, all with
drop_cachesin between.
Thanks for re-evaluating dm-writeboost performance Joe.
Quoted 6 lines
It's fine to have different benefits of the caching software depending on the load. But I think the worst case should always be close to the performance of the raw spindle device.
If you get the following work items done I will ack to go upstream:
Quoted 7 lines
i) Get this test so it's performance is similar to raw spindle.
ii) Write good documentation in
Documentation/device-mapper/. eg. How
do I remove a cache? When should I use dm-writeboost rather than bcache or dm-cache?iii) Provide an equivalent to the fsck tool to repair a damaged cache.
I agree with this TODO list. But I'd also add:
iv) perform full code review to catch various implementation issues,
any style nits, etc.
v) explore/implement read caching support (could the lack of read caching be contributing to why the git_extract test is so poor?)
Item iv) would be a task for myself and anyone else interested in getting dm-writeboost ready for inclusion. Akira, I can start working on dm-writeboost code review once I complete review of the dm-dedup target (my current priority) -- but realistically that likely won't be until the new year.
BTW, I'm really not seeing much point putting dm-writeboost in staging. I'd be happy to take dm-writeboost into drivers/md/ once the above list is resolved. BUT if you'd still like dm-writeboost to go into staging _without_ any of these 5 work items being completed I'll ack it but to be very clear: dm-writeboost will not migrate out of staging until these items are resolved.
Thanks,
Mike
Hi,
Quoted 4 lines
BUT if you'd still like dm-writeboost to go into staging _without_ any of these 5 work items being completed I'll ack it but to be very clear: dm-writeboost will not migrate out of staging until these items are resolved.
Yes. I will go into staging.
Greg, I will send you a patch with some fixes on TODO.
I agree with the 5 work times to be done for md.
I add some comments below,
Quoted 1 line
Quoted 1 line
i) Get this test so it's performance is similar to raw spindle.
Yes.
Quoted 5 lines
Quoted 5 lines
ii) Write good documentation in
Documentation/device-mapper/. eg. How
do I remove a cache? When should I use dm-writeboost rather than bcache or dm-cache?iii) Provide an equivalent to the fsck tool to repair a damaged cache.
OK. I took a look at tools for DM-cache.
I will implement something similar.
But please remember, since Writeboost is log-structured fsck tools aren't essentially needed. On power failure, some logs at the head may be half done and discarding these logs can roll the state back.
Quoted 4 lines
iv) perform full code review to catch various implementation issues,
any style nits, etc.
v) explore/implement read caching support (could the lack of read caching be contributing to why thegit_extracttest is so poor?)
This will be my first work in staging.
- Akira
Quoted 57 lines · Mike Snitzer
Quoted 6 lines · Joe Thornber
Quoted 2 lines · Akira Hayakawa
Mike and Alasdair,
I need your ackHi Akira,
Quoted 8 lines
I just spent some time playing with your latest code. On the positive side I am seeing some good performance with the fio tests. Which is great, we know your design should outperform dm-cache with small random io.
However I'm still getting v. poor results with the git-extract test, which clones a linux kernel repo, and then checks out 5 revisions, all with
drop_cachesin between.Thanks for re-evaluating dm-writeboost performance Joe.
Quoted 6 lines
It's fine to have different benefits of the caching software depending on the load. But I think the worst case should always be close to the performance of the raw spindle device.
If you get the following work items done I will ack to go upstream:
Quoted 7 lines
i) Get this test so it's performance is similar to raw spindle.
ii) Write good documentation in
Documentation/device-mapper/. eg. How
do I remove a cache? When should I use dm-writeboost rather than bcache or dm-cache?iii) Provide an equivalent to the fsck tool to repair a damaged cache.
I agree with this TODO list. But I'd also add:
iv) perform full code review to catch various implementation issues,
any style nits, etc.v) explore/implement read caching support (could the lack of read caching be contributing to why the
git_extracttest is so poor?)Item iv) would be a task for myself and anyone else interested in getting dm-writeboost ready for inclusion. Akira, I can start working on dm-writeboost code review once I complete review of the dm-dedup target (my current priority) -- but realistically that likely won't be until the new year.
BTW, I'm really not seeing much point putting dm-writeboost in staging. I'd be happy to take dm-writeboost into
drivers/md/once the above list is resolved. BUT if you'd still like dm-writeboost to go into staging _without_ any of these 5 work items being completed I'll ack it but to be very clear: dm-writeboost will not migrate out of staging until these items are resolved.Thanks,
Mike
Quoted 2 lines · Joe Thornber
Writeboost is significantly slower than the spindle alone for this very simple test. I do not understand what is causing the issue.
I started doing the code review and now understand what's going on, sadly.
You are splitting all bios up into 4k blocks to simplify the metadata layout, and mapping logic. This murders performance. File systems and the block layer try really hard to submit the largest bio possible for a reason.
A simple dd in large chunks across your cache reveals this:
raw spindle: 8.9s writeboost type 0: 32.2s writeboost type 1: 71.1s
dm-cache and dm-thin do also split io into blocks, but much larger, user configurable blocks. It's still a performance issue for us, which is why I'm using range locking to move away from this bio splitting (eg, recent cache discard patches).
One of the main advantages of a log based metadata layout is you can cope nicely with arbitrarily sized bios. Unlike dm-cache for instance, which has to do a read from the origin if it wants to cache a write that partially covers a block (or maintain a 'valid' bit for each sector of every cached block).
The writeboost target as it stands will only benefit v. small, random io. It will seriously degrade performance of any other IO profile. I'm NACKing this for upstream, and will not be spending any more time on it at this point.
You've put a lot of effort into this so far, so I suggest you redesign the log metadata, and drop the io splitting; you'll end up with something far better.
Sorry,
- Joe
Hi, Joe
Thanks for continuous evaluation.
I think it's to soon to conclude splitting is the case.
In general, the time order of memory operations and disk operations is much different. So, it's not likely that bio splitting, memory operation, is the case. Again, in general. But yes, I will add seq write/read performance tests to dmts to see what's really going on.
By the way, what environment are you using for those tests?
My past result of git-extract differ from yours. I think this is strange.
(http://www.redhat.com/archives/dm-devel/2014-May/msg00052.html)
WriteboostTestsBackingDevice
Elapsed 52.494120792: git_prepare
Elapsed 276.545543981: extract all versions
Finished in 331.363683334 seconds
WriteboostTestsType0
Elapsed 46.966797484: git_prepare
Elapsed 215.305219932: extract all versions
Finished in 270.176494226 seconds.
WriteboostTestsType1
Elapsed 83.344358679: git_prepare
Elapsed 236.562481129: extract all versions
Finished in 329.684926274 seconds.
I conducted those experiments on physical machine with a HDD and a SSD. I will re-evaluate those tests with the current kernel on my machine and compare with this result.
- Akira
Quoted 47 lines · Joe Thornber
Quoted 2 lines · Joe Thornber
Writeboost is significantly slower than the spindle alone for this very simple test. I do not understand what is causing the issue.
I started doing the code review and now understand what's going on, sadly.
You are splitting all bios up into 4k blocks to simplify the metadata layout, and mapping logic. This murders performance. File systems and the block layer try really hard to submit the largest bio possible for a reason.
A simple dd in large chunks across your cache reveals this:
raw spindle: 8.9s writeboost type 0: 32.2s writeboost type 1: 71.1sdm-cache and dm-thin do also split io into blocks, but much larger, user configurable blocks. It's still a performance issue for us, which is why I'm using range locking to move away from this bio splitting (eg, recent cache discard patches).
One of the main advantages of a log based metadata layout is you can cope nicely with arbitrarily sized bios. Unlike dm-cache for instance, which has to do a read from the origin if it wants to cache a write that partially covers a block (or maintain a 'valid' bit for each sector of every cached block).
The writeboost target as it stands will only benefit v. small, random io. It will seriously degrade performance of any other IO profile. I'm NACKing this for upstream, and will not be spending any more time on it at this point.
You've put a lot of effort into this so far, so I suggest you redesign the log metadata, and drop the io splitting; you'll end up with something far better.
Sorry,
- Joe
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
Quoted 1 line · Akira Hayakawa
By the way, what environment are you using for those tests?
Those test are on a vm, with a consumer level spindle and SSD behind it.
- Joe
Quoted 3 lines · Akira Hayakawa
Hi, Joe
Thanks for continuous evaluation.
Some more details:
dd, with block size 512b
------------------------
raw spindle : 143
writeboost Type 0: 137
writeboost Type 1: 130
dd, with block size 4k
----------------------
raw spindle : 31
writeboost Type 0: 29
writeboost Type 1: 81
dd, with block size 64m
-----------------------
raw spindle : 8.9
writeboost Type 0: 32
writeboost Type 1: 72
So maybe it's just volume of IO that's causing the problem? What's the difference between Type 0 and Type 1? In the code I notice you have 'rambuf' structures, are you caching IO in memory?
Joe,
I appreciate your continuous work.
Is that read or write?
The difference between Type 0 and 1 should only show up in write path. So is it write test?
And what is the unit of each result?
Quoted 3 lines
So maybe it's just volume of IO that's causing the problem? What's the difference between Type 0 and Type 1? In the code I notice you have 'rambuf' structures, are you caching IO in memory?
"rambuf" is a temporary space that every write data comes in. 127*4KB data are once stored there and 4KB metadata section are added then it becomes a log and flushed to the cache device sequentially (512KB each).
By the way,
I think more clearer discussion can be done if tests are done on physical machines to isolate things relevant to VM. I will also add these tests to dmts later and run on my machine.
But, it will be much better if we have good server with RAID-ed backing store and the newest SSD (How would it be if it's PCI-e SSD)...
- Akira
Quoted 35 lines · Joe Thornber
Quoted 3 lines · Akira Hayakawa
Hi, Joe
Thanks for continuous evaluation.
Some more details:
dd, with block size 512b
------------------------raw spindle : 143
writeboost Type 0: 137
writeboost Type 1: 130dd, with block size 4k
----------------------raw spindle : 31
writeboost Type 0: 29
writeboost Type 1: 81dd, with block size 64m
-----------------------raw spindle : 8.9
writeboost Type 0: 32
writeboost Type 1: 72So maybe it's just volume of IO that's causing the problem? What's the difference between Type 0 and Type 1? In the code I notice you have 'rambuf' structures, are you caching IO in memory?
Quoted 7 lines · Akira Hayakawa
Joe,
I appreciate your continuous work.
Is that read or write?
The difference between Type 0 and 1 should only show up in write path. So is it write test?
Yes, writing across the whole device using 'dd'.
These are the tests:
dmtest list --suite writeboost -n /wipe_device/
Quoted 1 line
And what is the unit of each result?
seconds.
Quoted 7 lines
Quoted 4 lines
So maybe it's just volume of IO that's causing the problem? What's the difference between Type 0 and Type 1? In the code I notice you have 'rambuf' structures, are you caching IO in memory?
"rambuf" is a temporary space that every write data comes in. 127*4KB data are once stored there and 4KB metadata section are added then it becomes a log and flushed to the cache device sequentially (512KB each).
So you copy the bio payload to a different block of ram and then complete the bio? Or does the rambuf refer to the bio payload directly?
Quoted 6 lines
By the way,
I think more clearer discussion can be done if tests are done on physical machines to isolate things relevant to VM. I will also add these tests to dmts later and run on my machine.
But, it will be much better if we have good server with RAID-ed backing store and the newest SSD (How would it be if it's PCI-e SSD)...
I generally find it quicker to investigate problems on the machine that are actually exhibiting the problem ;) Seriously though, you're asking us to send this upstream; it needs to work on consumer level hardware.
I've got a big machine with Fusion IO storage that I can run the same tests on later.
- Joe
Joe,
Quoted 3 lines
So you copy the bio payload to a different block of ram and then complete the bio? Or does the rambuf refer to the bio payload directly?
Good question.
The answer is, copy the data (got by bio_data(bio)) to rambuf once and ack if it's not barrier things.
It would be nice if data in rambuf points to bio payload but it now copies because bio payload can be reused after completion. Am I right? Is there a way of eliminate memory copying?
Quoted 4 lines
I generally find it quicker to investigate problems on the machine that are actually exhibiting the problem ;) Seriously though, you're asking us to send this upstream; it needs to work on consumer level hardware.
OK, I see. I will continue evaluation on my machine too.
Quoted 2 lines
I've got a big machine with Fusion IO storage that I can run the same tests on later.
What is the limit of random write performance is one of my concerns. I guess it can be over 1GB/sec.
- Akira
Quoted 48 lines · Joe Thornber
Quoted 7 lines · Akira Hayakawa
Joe,
I appreciate your continuous work.
Is that read or write?
The difference between Type 0 and 1 should only show up in write path. So is it write test?Yes, writing across the whole device using 'dd'.
These are the tests:
dmtest list --suite writeboost -n /wipe_device/Quoted 1 line
And what is the unit of each result?
seconds.
Quoted 7 lines
Quoted 4 lines
So maybe it's just volume of IO that's causing the problem? What's the difference between Type 0 and Type 1? In the code I notice you have 'rambuf' structures, are you caching IO in memory?
"rambuf" is a temporary space that every write data comes in. 127*4KB data are once stored there and 4KB metadata section are added then it becomes a log and flushed to the cache device sequentially (512KB each).
So you copy the bio payload to a different block of ram and then complete the bio? Or does the rambuf refer to the bio payload directly?
Quoted 6 lines
By the way,
I think more clearer discussion can be done if tests are done on physical machines to isolate things relevant to VM. I will also add these tests to dmts later and run on my machine.
But, it will be much better if we have good server with RAID-ed backing store and the newest SSD (How would it be if it's PCI-e SSD)...I generally find it quicker to investigate problems on the machine that are actually exhibiting the problem ;) Seriously though, you're asking us to send this upstream; it needs to work on consumer level hardware.
I've got a big machine with Fusion IO storage that I can run the same tests on later.
- Joe
Quoted 11 lines · Akira Hayakawa
Joe,
Quoted 3 lines
So you copy the bio payload to a different block of ram and then complete the bio? Or does the rambuf refer to the bio payload directly?
Good question.
The answer is, copy the data (got bybio_data(bio)) to rambuf once and ack if it's not barrier things.
It would be nice if data in rambuf points to bio payload but it now copies because bio payload can be reused after completion. Am I right? Is there a way of eliminate memory copying?
You *have* to eliminate this memory copying. Remap the bios to the relevant portion of your log, and don't complete them until you log chunk is coherent.
Quoted 13 lines · Joe Thornber
Quoted 11 lines · Akira Hayakawa
Joe,
Quoted 3 lines
So you copy the bio payload to a different block of ram and then complete the bio? Or does the rambuf refer to the bio payload directly?
Good question.
The answer is, copy the data (got bybio_data(bio)) to rambuf once and ack if it's not barrier things.
It would be nice if data in rambuf points to bio payload but it now copies because bio payload can be reused after completion. Am I right? Is there a way of eliminate memory copying?
Quoted 4 lines
You *have* to eliminate this memory copying. Remap the bios to the relevant portion of your log, and don't complete them until you log chunk is coherent.
Barrier writes don't ack until the log is written on cache device. I guess treating other writes as well will do this work.
But, it will be much better if I can do this by manipulating reference count of the bio payload. I am not sure how the implementation would be.
Anyway, thanks for advice,
- Akira
Quoted 29 lines · Joe Thornber
Quoted 2 lines · Joe Thornber
Writeboost is significantly slower than the spindle alone for this very simple test. I do not understand what is causing the issue.
I started doing the code review and now understand what's going on, sadly.
You are splitting all bios up into 4k blocks to simplify the metadata layout, and mapping logic. This murders performance. File systems and the block layer try really hard to submit the largest bio possible for a reason.
A simple dd in large chunks across your cache reveals this:
raw spindle: 8.9s writeboost type 0: 32.2s writeboost type 1: 71.1sdm-cache and dm-thin do also split io into blocks, but much larger, user configurable blocks. It's still a performance issue for us, which is why I'm using range locking to move away from this bio splitting (eg, recent cache discard patches).
One of the main advantages of a log based metadata layout is you can cope nicely with arbitrarily sized bios. Unlike dm-cache for instance, which has to do a read from the origin if it wants to cache a write that partially covers a block (or maintain a 'valid' bit for each sector of every cached block).
Quoted 4 lines
The writeboost target as it stands will only benefit v. small, random io. It will seriously degrade performance of any other IO profile. I'm NACKing this for upstream, and will not be spending any more time on it at this point.
Is not that what some databases are doing?
Quoted 4 lines
You've put a lot of effort into this so far, so I suggest you redesign the log metadata, and drop the io splitting; you'll end up with something far better.
Perhaps passing large writes[1] directly to HDD - consumer SSDs and HDDs sequential write speeds are IIUC almost identical.
[1]: What is large write? In my mental model fits a "tunable".
Quoted 10 lines
Sorry,
- Joe
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel