Hmm yes, unwinding the priorities when processes exit is complicated. But I wonder if simply leaving the priority at its highest level reached would be harmless; it really depends on how much influence the heuristic has.
It doesn't strike me as particularly wrong for a page to still be classified as elevated priority if some higher priority process had classified it as such even if that process no longer exists. At least not for file-backed pages, which are really what I'm interested in, in this context. Chances are good the file gets accessed again in a similar fashion, the priority stickiness could help keep it around.
The "do not cache this" approach is quite heavy-handed and can be problematic if you want some caching for things like producing deltas, or in the case of a restore from backup reassembling from myriad delta files, without blowing out the page cache.
As corbet mentioned the cgroups approach does provide a solution to constrain page cache effects.
It doesn't strike me as particularly wrong for a page to still be classified as elevated priority if some higher priority process had classified it as such even if that process no longer exists. At least not for file-backed pages, which are really what I'm interested in, in this context. Chances are good the file gets accessed again in a similar fashion, the priority stickiness could help keep it around.
The "do not cache this" approach is quite heavy-handed and can be problematic if you want some caching for things like producing deltas, or in the case of a restore from backup reassembling from myriad delta files, without blowing out the page cache.
As corbet mentioned the cgroups approach does provide a solution to constrain page cache effects.