Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permanent cache section #172

Open
mraaman opened this issue Feb 5, 2017 · 2 comments
Open

Permanent cache section #172

mraaman opened this issue Feb 5, 2017 · 2 comments

Comments

@mraaman
Copy link

mraaman commented Feb 5, 2017

It would be nice to have a permament cache section within the cache. I.e. one could mark certain blocks to never be evicted from the cache. Writeback of dirty blocks could be handled as the non-permanent blocks the only difference would be that these blocks are never removed from the cache.

The configuration of this would probably be the most difficult part.

The use case I have in mind for this would be to put inode blocks from the filesystem into the permanent cache. The Linux kernel will cache inodes in memory but there is no control on whether it remains there. Having them in the cache will prevent the kernel from going out to the backing device and seek for them. It will speed up searching and listing of files etc.

@tanantharaman
Copy link

A simpler solution is to set /proc/sys/vm/vfs_cache_pressure to 1 (default is 100), which will keep the inode blocks in RAM, in preference to any data blocks.

Also any inode blocks that don't fit in RAM are most likely in the read cache of the dm-writeboost device : inode's are typically 256 bytes so if you set the dm-writeboost read cache threshold to 8 (meaning 32kb or less), any set of 128 or less consecutive inodes (inodes from any folders with 128 or less files) will end up in the dm-writeboost SSD device anyway.

@akiradeveloper
Copy link
Owner

Yes, use write-around mode and set read_cache_threshold to a small number to indirectly achieve this goal is a good idea. A user is actually doing this to cache metadata only and he said it actually does some works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants