On Tue, 30 Sep 2014 12:08:41 -0400, Matthew Wilcox said: > The more I think about this, the more I think this is a bad idea. > When you have a file open with O_DIRECT, your I/O has to be done in > 512-byte multiples, and it has to be aligned to 512-byte boundaries > in memory. If an unsuspecting application has O_DIRECT forced on it, > it isn't going to know to do that, and so all its I/Os will fail. I'm thinking of more than one place where that would be a feature, not a bug. :) > What problem are you really trying to solve? Some big files hogging > the page cache? I'm officially a storage admin. I mostly support HPC and research. As such, I'm always looking to add tools to my toolkit. :) (And yes, I fully recognize that *in general*, this is a Bad Idea. However, when you've got That One Problem Data File that *should* always be access via O_DIRECT, and *usually* is accessed via O_DIRECT, and bad things happen if something accesses it without it (for instance, when the file is 1.5X the actual RAM), you start looking for fixes. If you've got another, more sustainable way to say "do not let file /X/Y/Z hog the page cache" (and no, LD_PRELOAD isn't sustainable the way chattr is, in my book), feel free to recommend something. :)
Attachment:
pgpJOgo6RHY3n.pgp
Description: PGP signature