Messages in this thread | | | Date | Tue, 26 Oct 1999 11:29:05 +0200 | From | Helge Hafting <> | Subject | RE: Speeding up swap |
| |
> > I am looking for a mechanism that enables a user process to > > advise the kernel on a per-fd basis not to keep more than say > > two pages of a certain file any buffer cache based on the > > promise that the user process will read that file only in a > > sequentially-forward or even non-seeking manner. I exspect > > performance improvements from such a mechanism because I > > observed that unrelated user processes get paged out when a very > > large file is passed thru a streaming application. > > If you allow it to be used by non-privileged processes, you create the > potential for an untrusted process to cause ridiculous amounts of physical > I/O. They can do that already by abusing fsync for every byte written or some such. This ridiculous reading won't be suc a big deal anyway, the abusive process will be blocked for IO a lot of the time letting others run, and the others will find their data in the now un-polluted cache.
Of course there are ways to prevent abuse too. The minimum limit could be 8 pages instead of 2 perhaps. And the kernel don't *need* to honor such a request, it is a 'hint', not a 'rule'. The kernel can ditch the hint if it proves ineffective. A backwards seek outside the limit could raise the limit so that sort of seek may be cached the next time, for example.
Helge Hafting
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |