|
|
Subscribe / Log in / New account

Volatile ranges with fallocate()

Volatile ranges with fallocate()

Posted Jun 8, 2012 0:31 UTC (Fri) by robert_s (subscriber, #42402)
Parent article: Volatile ranges with fallocate()

"Any filesystem could conceivably implement this functionality, but, in practice, it only makes sense for a RAM-based filesystem like tmpfs, so it is only implemented there."

So, for the stated example, the web browser would have to:

1. Find a mounted ram-based filesystem it had access to.
2. Create a file for the cache.
3. Presumably mmap() the file so it can be accessed conveniently.

?

Also, how would the application know when an area had been reclaimed? Canaries? What if an application tried to access an object that had only partially been reclaimed - say a single 4k page had innocuously been taken from a huge blob?


to post comments

Volatile ranges with fallocate()

Posted Jun 8, 2012 0:35 UTC (Fri) by dlang (guest, #313) [Link]

to answer your second issue (how would it know that it's been reclaimed), per the article, the application does

fallocate(fd, FALLOCATE_FL_UNMARK_VOLATILE, offset, len);

and if the return code is 0, it can use the data, if the return code is non-zero, some part of the data has been reclaimed and the application needs to regenerate it.

I would hope that when the system grabs part of a block that's been marked volatile, it grabs the entire block, rather then just punching a small hole in it (or at least remembers what it damaged earlier when it needs more memory, on the theory that you may mark a large block volitile and then try to re-use small chunks of it)


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds