From: Nikolaus R. <Nik...@ra...> - 2010-07-20 01:54:21
|
Stef Bon <ste...@pu...> writes: > Hello, > > I'm looking at the possibility to make my fs make remove old and > unused entries and inodes, so have only entries and inodes in memory > which are active somehow. > > It's possible to make the fuse libraries in the session loop, (only > lowlevel) do some cleaning and maintaining of the entries and inodes > when idle, so when there is nothing to do. When using epoll in the > session loop this is possible. Alternatively you could do this in a background thread. But doing it in the session loop is probably a better idea. The less parallelism the better. > If you for example do : > > cd /somedir/dira/dirb/ > ls > cd ../../../otherdir > > and work there > > the entries of the /somedir/dira/dirb, and the contents, and > /somedir/dira and somedir are not used anymore. > The idea is to forget first the etries/inodes which have the most > "distance" from the root. > Then their parents and so on. I don't think that's a good idea. Expiring the most deeply nested entries seems rather arbitrary to me. I think you should expire the least-recently accessed inodes, and you should expire just as many as you need to keep the number of in-memory inodes below some fixed maximum. Best, -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C |