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()
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?
Posted Jun 8, 2012 0:35 UTC (Fri)
by dlang (guest, #313)
[Link]
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)
Volatile ranges with fallocate()