Skip to contentSkip to conversation

mm/fs: cleancache documentation

PATCH In review Dan Magenheimer 2 participants 4 messages Apr 14, 2011 – Apr 15, 2011

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH v8 1/8 mm/fs: cleancache documentation

[PATCH V8 1/8] mm/fs: cleancache documentation

This patchset introduces cleancache, an optional new feature exposed by the VFS layer that potentially dramatically increases page cache effectiveness for many workloads in many environments at a negligible cost. It does this by providing an interface to transcendent memory, which is memory/storage that is not otherwise visible to and/or directly addressable by the kernel.

Instead of being discarded, hooks in the reclaim code "put" clean pages to cleancache. Filesystems that "opt-in" may "get" pages from cleancache that were previously put, but pages in cleancache are "ephemeral", meaning they may disappear at any time. And the size of cleancache is entirely dynamic and unknowable to the kernel. Filesystems currently supported by this patchset include ext3, ext4, btrfs, and ocfs2. Other filesystems (especially those built entirely on VFS) should be easy to add, but should first be thoroughly tested to ensure coherency.

Details and a FAQ are provided in Documentation/vm/cleancache.txt

This first patch of eight in this cleancache series only adds two new documentation files.

[v8: minor documentation changes by author]
[v3: akpm at linux-foundation.org: document sysfs API]
[v3: hch at infradead.org: move detailed description to Documentation/vm]
Cc Al Viro <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Nick Piggin <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Rik Van Riel <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Chris Mason <[email protected]>
Cc Andreas Dilger <[email protected]>
Cc Ted Ts'o <[email protected]>
Cc Mark Fasheh <[email protected]>
Cc Joel Becker <[email protected]>
Cc Nitin Gupta <[email protected]>

---

Diffstat:

 Documentation/ABI/testing/sysfs-kernel-mm-cleancache |   11 
 Documentation/vm/cleancache.txt                      |  278 ++++++++++
 2 files changed, 289 insertions(+)
Documentation/ABI/testing/sysfs-kernel-mm-cleancache +11 -0
@@ -0,0 +1,11 @@
+What:		/sys/kernel/mm/cleancache/
+Date:		April 2011
+Contact:	Dan Magenheimer <[email protected]>
+Description:
+		/sys/kernel/mm/cleancache/ contains a number of files which
+		record a count of various cleancache operations
+		(sum across all filesystems):
+			succ_gets
+			failed_gets
+			puts
+			flushes
Documentation/vm/cleancache.txt +278 -0

278 lines not on this page · raw message

#1 lore raw
Quoted 19 lines · Dan Magenheimer

[PATCH V8 1/8] mm/fs: cleancache documentation

This patchset introduces cleancache, an optional new feature exposed by the VFS layer that potentially dramatically increases page cache effectiveness for many workloads in many environments at a negligible cost. It does this by providing an interface to transcendent memory, which is memory/storage that is not otherwise visible to and/or directly addressable by the kernel.

Instead of being discarded, hooks in the reclaim code "put" clean pages to cleancache. Filesystems that "opt-in" may "get" pages from cleancache that were previously put, but pages in cleancache are "ephemeral", meaning they may disappear at any time. And the size of cleancache is entirely dynamic and unknowable to the kernel. Filesystems currently supported by this patchset include ext3, ext4, btrfs, and ocfs2. Other filesystems (especially those built entirely on VFS) should be easy to add, but should first be thoroughly tested to ensure coherency.

Quoted 4 lines

Details and a FAQ are provided in Documentation/vm/cleancache.txt

This first patch of eight in this cleancache series only adds two new documentation files.

Another question: why can't this enable/disable per sb, e.g. via mount options? (I have the interest the cache stuff like this by SSD on physical systems like dragonfly's swapcache.)

Well, anyway, I guess force enabling this for mostly unused sb can just add cache-write overhead and call for unpleasing reclaim to backend (because of limited space of backend) like updatedb.

And already there is in FAQ though, I also have interest about async interface because of SDD backend (I'm not sure for now though). Is there any plan like SSD backend?

Thanks.

Signature · 8 lines
OGAWA Hirofumi <[email protected]>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#2 lore raw

Hi Hirofumi-san --

Quoted 3 lines

Another question: why can't this enable/disable per sb, e.g. via mount options? (I have the interest the cache stuff like this by SSD on physical systems like dragonfly's swapcache.)

This would be useful and could be added later if individual filesystems choose to add the mount functionality. My goal with this patchset is to enable only minimal functionality so that other kernel developers can build on it.

Quoted 3 lines

Well, anyway, I guess force enabling this for mostly unused sb can just add cache-write overhead and call for unpleasing reclaim to backend (because of limited space of backend) like updatedb.

If the sb is mostly unused, there should be few puts. But you are correct that if the backend has only very limited space, cleancache adds cost and has little value. On these systems, cleancache should probably be disabled. However, the cost is very small so leaving it enabled may not even show a measureable performance impact.

Quoted 3 lines

And already there is in FAQ though, I also have interest about async interface because of SDD backend (I'm not sure for now though). Is there any plan like SSD backend?

Yes, I think an SSD backend is very interesting, especially if the SSD is "very near" to the processor so that it can be used as a RAM extension rather than as an I/O device.

The existing cleancache hooks will work for this and I am working on a cleancache backend called RAMster that will be a good foundation to access other asynchronous devices.
See: http://marc.info/?l=3Dlinux-mm&m=3D130013567810410&w=3D2=20

Thanks for your feedback!
Dan

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#3 lore raw
Quoted 10 lines · Dan Magenheimer
Quoted 3 lines

Well, anyway, I guess force enabling this for mostly unused sb can just add cache-write overhead and call for unpleasing reclaim to backend (because of limited space of backend) like updatedb.

If the sb is mostly unused, there should be few puts. But you are correct that if the backend has only very limited space, cleancache adds cost and has little value. On these systems, cleancache should probably be disabled. However, the cost is very small so leaving it enabled may not even show a measureable performance impact.

Ah, mostly unused sb meant read once for all data pages on that sb for each few days (updatedb might be wrong example, because it's meta data. Umm... maybe likely example is backup process). I guess it will be "put" all pages into backend, and would "flush" useful caches. So, I think overhead and reclaim pressure are noticeable impact.

Ok, but if now it's concentrating on interface for backend of this, I think it can be later.

Quoted 4 lines
Quoted 3 lines

And already there is in FAQ though, I also have interest about async interface because of SDD backend (I'm not sure for now though). Is there any plan like SSD backend?

Quoted 8 lines

Yes, I think an SSD backend is very interesting, especially if the SSD is "very near" to the processor so that it can be used as a RAM extension rather than as an I/O device.

The existing cleancache hooks will work for this and I am working on a cleancache backend called RAMster that will be a good foundation to access other asynchronous devices.
See: http://marc.info/?l=linux-mm&m=130013567810410&w=2

Thanks for info.

Signature · 1 line
OGAWA Hirofumi <[email protected]>