lanconnected / EnhanceIO

EnhanceIO Open Source for Linux
Other
101 stars 31 forks source link

/proc interface to manage caches #25

Open d-a-v opened 7 years ago

d-a-v commented 7 years ago

I happen to have a nearly ready pull request that allows caches management directly from a new procfs file /proc/enhanceio/control. It allows to enable caches directly from initrd scripts thanks to this because the python CLI is not anymore required. Is this is of any interest, I can make a PR.

For example this creates a cache:

echo "  create   policy = lru mode=wb   bs=4096 cache=test ssd=/dev/zram0 dev=$(readlink -f /dev/disk/by-id/ata-Micron_1100_SATA_256GB_1720171DB8D8-part1)  " > /proc/enhanceio/control

(this is a test line where spaces are intentionally not coherent)

lanconnected commented 6 years ago

Sorry for ignoring you for such a long time :). I see nothing wrong with your idea, i'd like to get rid of user-space tool myself. Kernel part should handle all logic and sanity checks. To make things consistent, this method should be the only one supported, and eio_cli should be rewritten as a wrapper to it. What would be even nicer is moving to /sys interface instead of /proc. I'll have a deeper look into your patch and hopefully merge it to some new branch. Thanks.

d-a-v commented 6 years ago

Agreed with a new eio_cli (with same syntax).