packagefs: Open HPKG files as O_NOCACHE.

We have not one but two internal caches in packagefs for *uncompressed* data;
we do not need the underlying filesystem to cache the *compressed* data
needlessly.

This seems to be a negligible memory and boot speed improvement at best,
although it will likely help in low-memory situations in reducing
the pressure on the file cache (... actually it doesn't look like
the file cache responds to low resource notifications at all, which
may be relevant here.)
This commit is contained in:
Augustin Cavalier
2019-04-01 19:02:00 -04:00
parent d1a0bc4fb5
commit 11e3c6dd26
@@ -649,7 +649,8 @@ Package::Open()
}
// open the file
fFD = openat(fPackagesDirectory->DirectoryFD(), fFileName, O_RDONLY);
fFD = openat(fPackagesDirectory->DirectoryFD(), fFileName,
O_RDONLY | O_NOCACHE);
if (fFD < 0) {
ERROR("Failed to open package file \"%s\": %s\n", fFileName.Data(),
strerror(errno));