hoytech / vmtouch

Portable file system cache diagnostics and control
https://hoytech.com/vmtouch/
BSD 3-Clause "New" or "Revised" License
1.81k stars 214 forks source link

Recrawl on HUP? #54

Open timp87 opened 7 years ago

timp87 commented 7 years ago

Hello. What if vmtouch recrawled file paths in case of SIGHUP receiving? What do you think?

hoytech commented 7 years ago

Yes, it's a good idea, thanks! It might be a bit complicated to implement though. We'd have to keep track of the mappings as we make them, then unlock and unmap them before redoing the crawl.

Usually it's enough to just kill the vmtouch process and spawn it again, but a HUP signal could have some advantages. For example, if a file hasn't changed inode/size, then we could avoid remapping/relocking it, therefore eliminating the small window where it's unlocked.

Thanks for the idea! Unfortunately I don't have the time to do this right now, but I'd consider a PR for it.