Patch to integrate RapidDisk and RapidCache RAM Drive / Caching modules into the kernel
Subsystems (2)
PATCH 1/1 Patch to integrate RapidDisk and RapidCache RAM Drive / Caching modules into the kernel
Attached is a patch for two modules: RapidDisk & RapidCache. RapidDisk is a Linux RAM drive module which allows the user to dynamically create, remove, and resize RAM-based block devices. RapidDisk is designed to work with both volatile and non-volatile memory. In the case of volatile memory, memory is allocated only when needed. The RapidCache module in turn utilizes a RapidDisk volume as a FIFO Write-Through caching node to a slower block device.
---
Documentation/rapiddisk/rxdsk.txt | 67 ++++ MAINTAINERS | 8 + drivers/block/Kconfig | 2 + drivers/block/Makefile | 1 + drivers/block/rapiddisk/Kconfig | 10 + drivers/block/rapiddisk/Makefile | 2 + drivers/block/rapiddisk/rxcache.c | 1045 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/block/rapiddisk/rxdsk.c | 777 ++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 1912 insertions(+)
Documentation/rapiddisk/rxdsk.txt +67 -0
@@ -0,0 +1,67 @@ +RapidDisk (rxdsk) RAM disk and RapidCache (rxcache) Linux modules + +== Description == + +RapidDisk or rxdsk was designed to be used in high performing environments and has been designed with simplicity in mind. Utilizing a user land binary, the system administrator is capable of dynamically adding new RAM based block devices of varying sizes, removing existing ones to even listing all existing RAM block devices. The rxdsk module has been designed to allocate from the system's memory pages and is capable of addressing memory to support Gigabytes if not a Terabyte of available Random Access Memory. + +RapidCache or rxcache is designed to leverage the high speed performing technologies of the RapidDisk RAM disk and utilizing the Device Mapper framework, map an rxdsk volume to act as a block device's Write/Read-through cache. This can significantly boost the performance of a local or remote disk device. + + +== Module Parameters == + +RapidDisk +--------- +max_rxcnt: Total RAM Disk devices available for use. (Default = 128 = MAX) (int) +max_sectors: Maximum sectors (in KB) for the request queue. (Default = 127) (int) +nr_requests: Number of requests at a given time for the request queue. (Default = 128) (int) + +RapidCache +--------- +None. + + +== Usage == + +RapidDisk +--------- +It is advised to utilize the userland utility, rxadm, but this is essentially what is written to the /proc/rxctl proc file to manage rxdsk volumes: + +Attach a new rxdsk volume by typing (size in sectors): + # echo "rxdsk attach 0 8192" > /proc/rxctl + +Attach a non-volatile rxdsk volume by typing (starting / ending addresses in decimal format): + # echo "rxdsk attach-nv 0 1234 56789" > /proc/rxctl + +Detach an existing rxdsk volume by typing: + # echo "rxdsk detach 0" > /proc/rxctl + +Resize an existing rxdsk volume by typing (size in sectors): + # echo "rxdsk resize 0 65536" > /proc/rxctl + + +Note - the integer after the "rxdsk <command>" is the RapidDisk volume number. "0" would signify "rxd0." + +RapidCache +--------- +It is advised to utilize the userland utility, rxadm, but this is essentially what is sent to the dmsetup command: + +Map an existing rxdsk volume to a block device by typing: + # echo 0 4194303 rxcache /dev/sdb /dev/rxd0 196608|dmsetup create rxc0 + +Parameter 1: Start block of source volume (in sectors). +Parameter 2: End block of source volume (in sectors). +Parameter 4: Source volume. +Parameter 5: Cache volume. +Parameter 6: Cache size (in sectors). + + +Unmap an rxdsk volume: + + # dmsetup remove rxc0 + + +== Design == + +The memory management of the rxdsk module was inspired by the brd Linux RAM disk module. + +The functionality of the rxcache module was inspired by Flashcache-wt and dm-cache.
drivers/block/Kconfig +2 -0
@@ -558,4 +558,6 @@ config BLK_DEV_RSXX To compile this driver as a module, choose M here: the module will be called rsxx. +source "drivers/block/rapiddisk/Kconfig" + endif # BLK_DEV
drivers/block/Makefile +1 -0
@@ -43,6 +43,7 @@ obj-$(CONFIG_BLK_DEV_PCIESSD_MTIP32XX) + obj-$(CONFIG_BLK_DEV_RSXX) += rsxx/ obj-$(CONFIG_BLK_DEV_NULL_BLK) += null_blk.o obj-$(CONFIG_ZRAM) += zram/ +obj-$(CONFIG_RXDSK) += rapiddisk/ nvme-y := nvme-core.o nvme-scsi.o skd-y := skd_main.o
drivers/block/rapiddisk/Kconfig +10 -0
@@ -0,0 +1,10 @@ +config RXDSK + tristate "RapidDisk Enhanced Linux RAM disk and caching solution" + depends on BLOCK && BLK_DEV_DM + default n + help + Creates virtual block devices called /dev/rxd(X = 0, 1, ...). + Supports both volatile and non-volatile memory. And can map + rxdsk volumes as caching nodes to slower drives. + + Project home: http://www.rapiddisk.org/
drivers/block/rapiddisk/Makefile +2 -0
@@ -0,0 +1,2 @@ +obj-$(CONFIG_RXDSK) += rxdsk.o +obj-$(CONFIG_RXDSK) += rxcache.o
drivers/block/rapiddisk/rxcache.c +1045 -0
1,045 lines not on this page · raw message
drivers/block/rapiddisk/rxdsk.c +777 -0
777 lines not on this page · raw message
MAINTAINERS +8 -0
@@ -8642,6 +8642,14 @@ M: "Theodore Ts'o" <[email protected]> S: Maintained F: drivers/char/random.c +RAPIDDISK & RAPIDCACHE DRIVERS +M: Petros Koutoupis <[email protected]> +L: [email protected] +W: http://www.rapiddisk.org +S: Maintained +F: drivers/block/rapiddisk/ +F: Documentation/rapiddisk/ + RAPIDIO SUBSYSTEM M: Matt Porter <[email protected]> M: Alexandre Bounine <[email protected]>
Quoted 6 lines · Petros Koutoupis
Attached is a patch for two modules: RapidDisk & RapidCache. RapidDisk is a Linux RAM drive module which allows the user to dynamically create, remove, and resize RAM-based block devices. RapidDisk is designed to work with both volatile and non-volatile memory. In the case of volatile memory, memory is allocated only when needed. The RapidCache module in turn utilizes a RapidDisk volume as a FIFO Write-Through caching node to a slower block device.
Hi Petros,
this is three things at the same time! We already have a ramdisk driver, a pmem drive, bcache and dm-cache, so for each of them please explain why we'd want to duplicate them instead of adding whatever features you need to them. First step is to identify those features.
Christoph (and all),
I hope this message finds you well. The unfortunate truth is, had I the courage and confidence to submit this years ago, we wouldn't be having this conversation. Anyway, to address your questions:
1. Unlike the already mainline ramdisk driver, RapidDisk is designed to be managed dynamically. That is, instead of configuring a fixed number of volumes and volume sizes as compile/boot time variables, RapidDisk will allow you to add, remove, and resize your RAM drive(s) at runtime. Besides, the built in module is designed to work with smaller sizes in mind while RapidDisk focuses on larger sizes that can reach to the multiple Gigabytes or even Terabytes. Much like the built in module, it will allocate pages as they are needed which allows for over provisioning (not that it is advised) of volume sizes.
2. The majority of RapidDisk code focuses on the use of Volatile memory. The support for Non-Volatile memory is a bit newer and there may be some overlap here with the recently integrated pmem code. The only advantage to having this code within RapidDisk is to provide the user with the ability to manage both technologies simultaneously, through a single interface.
3. The RapidCache component is designed around the Non-Volatile functionality of RapidDisk (hence the block-level Write-Through caching). It is also coded and optimized around the RapidDisk sizes/variables, out-of-box. It is worth noting that I am in the process of expanding this module to add deduplication support. This will leverage RapidDisk's ability to allocate pages only when needed and reduce the cache's memory footprint; making more out of less.
Thoughts, suggestions, and concerns are always welcome.
Quoted 13 lines · Christoph Hellwig
Quoted 6 lines · Petros Koutoupis
Attached is a patch for two modules: RapidDisk & RapidCache. RapidDisk is a Linux RAM drive module which allows the user to dynamically create, remove, and resize RAM-based block devices. RapidDisk is designed to work with both volatile and non-volatile memory. In the case of volatile memory, memory is allocated only when needed. The RapidCache module in turn utilizes a RapidDisk volume as a FIFO Write-Through caching node to a slower block device.
Hi Petros,
this is three things at the same time! We already have a ramdisk driver, a pmem drive, bcache and dm-cache, so for each of them please explain why we'd want to duplicate them instead of adding whatever features you need to them. First step is to identify those features.
A message that is not in the archive (sent off-list or not yet received): CALMxJTyS5ARHw5NWhiPkJOh_0ys2x7cGVNdn60O6ecaUTFkq_Q@mail.gmail.com
Hi Petros,
Quoted 9 lines · Petros Koutoupis
1. Unlike the already mainline ramdisk driver, RapidDisk is designed to be managed dynamically. That is, instead of configuring a fixed number of volumes and volume sizes as compile/boot time variables, RapidDisk will allow you to add, remove, and resize your RAM drive(s) at runtime. Besides, the built in module is designed to work with smaller sizes in mind while RapidDisk focuses on larger sizes that can reach to the multiple Gigabytes or even Terabytes. Much like the built in module, it will allocate pages as they are needed which allows for over provisioning (not that it is advised) of volume sizes.
The ramdisk driver allows to selects sizes and count at module load load. I agree that having runtime control would be even better, but that's best done by adding a runtime interface to the existing driver instead of duplicating it.
Quoted 5 lines
2. The majority of RapidDisk code focuses on the use of Volatile memory. The support for Non-Volatile memory is a bit newer and there may be some overlap here with the recently integrated pmem code. The only advantage to having this code within RapidDisk is to provide the user with the ability to manage both technologies simultaneously, through a single interface.
Which really doesn't sound like a good enough reason to duplicate it.
Quoted 7 lines
3. The RapidCache component is designed around the Non-Volatile functionality of RapidDisk (hence the block-level Write-Through caching). It is also coded and optimized around the RapidDisk sizes/variables, out-of-box. It is worth noting that I am in the process of expanding this module to add deduplication support. This will leverage RapidDisk's ability to allocate pages only when needed and reduce the cache's memory footprint; making more out of less.
Still needs some code comparism to our existing two caching solutions.
I'd love to see you go ahead with the dynamic ramdisk configuration as this is clearly a very useful feature. A caching solution that is optimized for non-volatile memory does sound useful, but we'll still need a patch better explaining how it actually is as useful as it might sound.
Christoph,
See my replies below....
Quoted 12 lines · Christoph Hellwig
Hi Petros,
Quoted 9 lines · Petros Koutoupis
1. Unlike the already mainline ramdisk driver, RapidDisk is designed to be managed dynamically. That is, instead of configuring a fixed number of volumes and volume sizes as compile/boot time variables, RapidDisk will allow you to add, remove, and resize your RAM drive(s) at runtime. Besides, the built in module is designed to work with smaller sizes in mind while RapidDisk focuses on larger sizes that can reach to the multiple Gigabytes or even Terabytes. Much like the built in module, it will allocate pages as they are needed which allows for over provisioning (not that it is advised) of volume sizes.
Quoted 4 lines
The ramdisk driver allows to selects sizes and count at module load load. I agree that having runtime control would be even better, but that's best done by adding a runtime interface to the existing driver instead of duplicating it.
I understand the concern and I will definitely scope out this approach, although at the moment, I am not sure how both approaches will play nice together. As mentioned above, the current implementation requires the predefined number of ram drives with the specified size to be configured at boot time (or compiled into the kernel). The only wiggle room I see for runtime control is resizing individual volumes.
Quoted 6 lines
Quoted 5 lines
2. The majority of RapidDisk code focuses on the use of Volatile memory. The support for Non-Volatile memory is a bit newer and there may be some overlap here with the recently integrated pmem code. The only advantage to having this code within RapidDisk is to provide the user with the ability to manage both technologies simultaneously, through a single interface.
Which really doesn't sound like a good enough reason to duplicate it.
I do not disagree with your comment here. This component does not have to be patched into the mainline.
Quoted 7 lines
Quoted 7 lines
3. The RapidCache component is designed around the Non-Volatile functionality of RapidDisk (hence the block-level Write-Through caching). It is also coded and optimized around the RapidDisk sizes/variables, out-of-box. It is worth noting that I am in the process of expanding this module to add deduplication support. This will leverage RapidDisk's ability to allocate pages only when needed and reduce the cache's memory footprint; making more out of less.
Quoted 7 lines
Still needs some code comparism to our existing two caching solutions.
I'd love to see you go ahead with the dynamic ramdisk configuration as this is clearly a very useful feature. A caching solution that is optimized for non-volatile memory does sound useful, but we'll still need a patch better explaining how it actually is as useful as it might sound.
CORRECTION: I meant to say Volatile and NOT Non-Volatile. RapidCache is designed around Volatile memory. I guess I was a little to excited in my response and I do apologize for that. I will provide a code comparison in my next e-mail, after I go through the existing RAM drive code.
Quoted 26 lines · Petros Koutoupis
Christoph,
See my replies below....
Quoted 17 lines · Christoph Hellwig
Hi Petros,
Quoted 6 lines · Petros Koutoupis
1. Unlike the already mainline ramdisk driver, RapidDisk is designed to be
managed dynamically. That is, instead of configuring a fixed number of volumes and volume sizes as compile/boot time variables, RapidDisk will allow you to add, remove, and resize your RAM drive(s) at runtime. Besides,Quoted 8 lines
the built in module is designed to work with smaller sizes in mind while RapidDisk focuses on larger sizes that can reach to the multiple Gigabytes
or even Terabytes. Much like the built in module, it will allocate pages as
they are needed which allows for over provisioning (not that it is advised)
of volume sizes.Quoted 4 lines
The ramdisk driver allows to selects sizes and count at module load load. I agree that having runtime control would be even better, but that's best done by adding a runtime interface to the existing driver instead of duplicating it.
Quoted 6 lines
I understand the concern and I will definitely scope out this approach, although at the moment, I am not sure how both approaches will play nice together. As mentioned above, the current implementation requires the predefined number of ram drives with the specified size to be configured at boot time (or compiled into the kernel). The only wiggle room I see for runtime control is resizing individual volumes.
Just because there is not code currently to do dynamic allocation/freeing of ramdisks in the current driver doesn't mean that it isn't possible, it just means that nobody has written code to do it yet. This functionality would be extremely useful (I often use ramdisks on a VM host as a small amount of very fast swap space for the virtual machines). On top of that, the deduplication would be a wonderful feature, although it may already be indirectly implemented through KSM (that is, when KSM is on and configured to scan everything, I'm not sure if it scans memory used by the ramdisks or not).
Quoted 29 lines
Quoted 8 lines
Quoted 7 lines
2. The majority of RapidDisk code focuses on the use of Volatile memory. The support for Non-Volatile memory is a bit newer and there may be some overlap here with the recently integrated pmem code. The only advantage to
having this code within RapidDisk is to provide the user with the ability
to manage both technologies simultaneously, through a single interface.Which really doesn't sound like a good enough reason to duplicate it.
I do not disagree with your comment here. This component does not have to be patched into the mainline.
Quoted 11 lines
Quoted 11 lines
3. The RapidCache component is designed around the Non-Volatile functionality of RapidDisk (hence the block-level Write-Through caching).
It is also coded and optimized around the RapidDisk sizes/variables, out-of-box. It is worth noting that I am in the process of expanding this
module to add deduplication support. This will leverage RapidDisk's ability
to allocate pages only when needed and reduce the cache's memory footprint;
making more out of less.Quoted 7 lines
Still needs some code comparism to our existing two caching solutions.
I'd love to see you go ahead with the dynamic ramdisk configuration as this is clearly a very useful feature. A caching solution that is optimized for non-volatile memory does sound useful, but we'll still need a patch better explaining how it actually is as useful as it might sound.
Quoted 4 lines
CORRECTION: I meant to say Volatile and NOT Non-Volatile. RapidCache is designed around Volatile memory. I guess I was a little to excited in my response and I do apologize for that. I will provide a code comparison in my next e-mail, after I go through the existing RAM drive code.
To a certain extent, I see that as potentially less useful than optimized for non-volatile memory. While the current incarnation of the pagecache in Linux could stand to have some serious performance improvements (just think how fast things would be if we used ARC instead of plain LRU), it does still do it's job well for most workloads (although being able to tell the kernel to reserve some portion of memory _just_ for the pagecache would be an interesting and probably very useful feature).
Christoph and Austin,
You both have provided me with some valuable feedback. I will do what I can to clean this patch up and in turn apply the same dynamic functionality to the already in-kernel module. Also please see my replies below.
Quoted 27 lines · Austin S Hemmelgarn
Quoted 26 lines · Petros Koutoupis
Christoph,
See my replies below....
Quoted 21 lines · Christoph Hellwig
Hi Petros,
Quoted 6 lines · Petros Koutoupis
1. Unlike the already mainline ramdisk driver, RapidDisk is designed to be
managed dynamically. That is, instead of configuring a fixed number of volumes and volume sizes as compile/boot time variables, RapidDisk will allow you to add, remove, and resize your RAM drive(s) at runtime. Besides,Quoted 8 lines
the built in module is designed to work with smaller sizes in mind while RapidDisk focuses on larger sizes that can reach to the multiple Gigabytes
or even Terabytes. Much like the built in module, it will allocate pages as
they are needed which allows for over provisioning (not that it is advised)
of volume sizes.The ramdisk driver allows to selects sizes and count at module load load. I agree that having runtime control would be even better, but that's best done by adding a runtime interface to the existing driver instead of duplicating it.
Quoted 8 lines
Quoted 6 lines
I understand the concern and I will definitely scope out this approach, although at the moment, I am not sure how both approaches will play nice together. As mentioned above, the current implementation requires the predefined number of ram drives with the specified size to be configured at boot time (or compiled into the kernel). The only wiggle room I see for runtime control is resizing individual volumes.
Just because there is not code currently to do dynamic allocation/freeing of ramdisks in the current driver doesn't mean that it isn't possible, it just means that nobody has written code to do it yet. This functionality would be extremely useful (I often use ramdisks on a VM host as a small amount of very fast swap space for the virtual machines). On top of that, the deduplication would be a wonderful feature, although it may already be indirectly implemented through KSM (that is, when KSM is on and configured to scan everything, I'm not sure if it scans memory used by the ramdisks or not).
To my understanding KSM is only applied to KVM deployments. One way I have seen my caching module work is users/vendors have a block device, map it to a RapidDisk RAM drive as a RAM based Write-Through caching node and in turn export it via a traditional SAN. The idea behind adding deduplication to this module is to minimize the RAM drive footprint when used as a block level cache.
Quoted 29 lines
Quoted 29 lines
Quoted 8 lines
Quoted 7 lines
2. The majority of RapidDisk code focuses on the use of Volatile memory. The support for Non-Volatile memory is a bit newer and there may be some overlap here with the recently integrated pmem code. The only advantage to
having this code within RapidDisk is to provide the user with the ability
to manage both technologies simultaneously, through a single interface.Which really doesn't sound like a good enough reason to duplicate it.
I do not disagree with your comment here. This component does not have to be patched into the mainline.
Quoted 18 lines
Quoted 11 lines
3. The RapidCache component is designed around the Non-Volatile functionality of RapidDisk (hence the block-level Write-Through caching).
It is also coded and optimized around the RapidDisk sizes/variables, out-of-box. It is worth noting that I am in the process of expanding this
module to add deduplication support. This will leverage RapidDisk's ability
to allocate pages only when needed and reduce the cache's memory footprint;
making more out of less.Still needs some code comparism to our existing two caching solutions.
I'd love to see you go ahead with the dynamic ramdisk configuration as this is clearly a very useful feature. A caching solution that is optimized for non-volatile memory does sound useful, but we'll still need a patch better explaining how it actually is as useful as it might sound.
Quoted 6 lines
Quoted 4 lines
CORRECTION: I meant to say Volatile and NOT Non-Volatile. RapidCache is designed around Volatile memory. I guess I was a little to excited in my response and I do apologize for that. I will provide a code comparison in my next e-mail, after I go through the existing RAM drive code.
To a certain extent, I see that as potentially less useful than optimized for non-volatile memory. While the current incarnation of the pagecache in Linux could stand to have some serious performance improvements (just think how fast things would be if we used ARC instead of plain LRU), it does still do it's job well for most workloads (although being able to tell the kernel to reserve some portion of memory _just_ for the pagecache would be an interesting and probably very useful feature).
My only concern with an ARC is CPU utilization. A lot more is required to manage two lists.
Quoted 53 lines · Petros Koutoupis
Christoph and Austin,
You both have provided me with some valuable feedback. I will do what I can to clean this patch up and in turn apply the same dynamic functionality to the already in-kernel module. Also please see my replies below.
Quoted 35 lines · Austin S Hemmelgarn
Quoted 28 lines · Petros Koutoupis
Christoph,
See my replies below....
Quoted 19 lines · Christoph Hellwig
Hi Petros,
Quoted 8 lines · Petros Koutoupis
1. Unlike the already mainline ramdisk driver, RapidDisk is designed to be
managed dynamically. That is, instead of configuring a fixed number of volumes and volume sizes as compile/boot time variables, RapidDisk will
allow you to add, remove, and resize your RAM drive(s) at runtime. Besides,
the built in module is designed to work with smaller sizes in mindQuoted 8 lines
while
RapidDisk focuses on larger sizes that can reach to the multiple Gigabytes
or even Terabytes. Much like the built in module, it will allocate pages as
they are needed which allows for over provisioning (not that it is advised)
of volume sizes.Quoted 4 lines
The ramdisk driver allows to selects sizes and count at module load load. I agree that having runtime control would be even better, but that's best done by adding a runtime interface to the existing driver instead of duplicating it.
Quoted 6 lines
I understand the concern and I will definitely scope out this approach, although at the moment, I am not sure how both approaches will play nice together. As mentioned above, the current implementation requires the predefined number of ram drives with the specified size to be configured at boot time (or compiled into the kernel). The only wiggle room I see for runtime control is resizing individual volumes.
Quoted 10 lines
Just because there is not code currently to do dynamic allocation/freeing of ramdisks in the current driver doesn't mean that it isn't possible, it just means that nobody has written code to do it yet. This functionality would be extremely useful (I often use ramdisks on a VM host as a small amount of very fast swap space for the virtual machines). On top of that, the deduplication would be a wonderful feature, although it may already be indirectly implemented through KSM (that is, when KSM is on and configured to scan everything, I'm not sure if it scans memory used by the ramdisks or not).
Quoted 6 lines
To my understanding KSM is only applied to KVM deployments. One way I have seen my caching module work is users/vendors have a block device, map it to a RapidDisk RAM drive as a RAM based Write-Through caching node and in turn export it via a traditional SAN. The idea behind adding deduplication to this module is to minimize the RAM drive footprint when used as a block level cache.
KSM is usually used in KVM or other userspace VM deployments, but that is by no means the only use-case. I actually use it regularly on most of my systems, and it does help in some cases (for example, I run a lot of distributed computing apps, often using multiple instances of the same app, and those don't always share memory to the degree they should, KSM helps with this).
The write-through caching may be worth looking into, although I think (not certain about this) that you can force the page cache to do write-through caching only, except that can only be done globally.
It would probably be better to improve upon the existing pagecache implementation anyway, ideally, I would love to see:
1. The ability to tell the page cache to claim some minimum amount of memory that only it can use.
2. The ability to easily tune cache parameters on a per-device (or even better, per-filesystem) basis.
3. Conversion to a framework that would allow for easy development and testing of different caching algorithms (although this is probably never going to happen).
Quoted 45 lines
Quoted 36 lines
Quoted 32 lines
Quoted 11 lines
Quoted 10 lines
2. The majority of RapidDisk code focuses on the use of Volatile memory.
The support for Non-Volatile memory is a bit newer and there may be some
overlap here with the recently integrated pmem code. The only advantage to
having this code within RapidDisk is to provide the user with the ability
to manage both technologies simultaneously, through a single interface.Which really doesn't sound like a good enough reason to duplicate it.
I do not disagree with your comment here. This component does not have to be patched into the mainline.
Quoted 11 lines
Quoted 11 lines
3. The RapidCache component is designed around the Non-Volatile functionality of RapidDisk (hence the block-level Write-Through caching).
It is also coded and optimized around the RapidDisk sizes/variables, out-of-box. It is worth noting that I am in the process of expanding this
module to add deduplication support. This will leverage RapidDisk's ability
to allocate pages only when needed and reduce the cache's memory footprint;
making more out of less.Quoted 7 lines
Still needs some code comparism to our existing two caching solutions.
I'd love to see you go ahead with the dynamic ramdisk configuration as this is clearly a very useful feature. A caching solution that is optimized for non-volatile memory does sound useful, but we'll still need a patch better explaining how it actually is as useful as it might sound.
Quoted 4 lines
CORRECTION: I meant to say Volatile and NOT Non-Volatile. RapidCache is designed around Volatile memory. I guess I was a little to excited in my response and I do apologize for that. I will provide a code comparison in my next e-mail, after I go through the existing RAM drive code.
Quoted 9 lines
To a certain extent, I see that as potentially less useful than optimized for non-volatile memory. While the current incarnation of the pagecache in Linux could stand to have some serious performance improvements (just think how fast things would be if we used ARC instead of plain LRU), it does still do it's job well for most workloads (although being able to tell the kernel to reserve some portion of memory _just_ for the pagecache would be an interesting and probably very useful feature).
Quoted 2 lines
My only concern with an ARC is CPU utilization. A lot more is required to manage two lists.
Actually, most of the CPU time spent in an ARC cache is in the auto-tuning (the 'adaptive' bit), I've done testing just in userspace and SLRU (ARC without the adaptive sizing of the lists) uses only a little more CPU time than traditional LRU, somewhat less than ARC, and does a much better job of handling COW based workloads. COW is a tough workload for LRU caching (which is why ZFS uses ARC and not traditional LRU), as a read-modify-write cycle ends up with the read data not being needed ever again, which in turn means that MRU caching can be better in may cases for heavy read-write COW workloads.