The ext3 developers have also been wanting things like this for a long time,
both having a "memory pressure" notification, and a differentiation between
"write this now" and "this is a periodic sync, write some stuff". I've
CC'd them in case they want to contribute.
There are also other non-core caches in the kernel which could benefit
from having a generic "memory pressure" notification. Having a generic
memory pressure notification helps reduce (but not eliminate) the need
to call "write this page now" into the filesystem.
My guess would be that having calls into the FS with "priorities", just
like shrink_dcache_memory() does, would allow the FS to make more
intelligent decisions about what to write/free _before_ you get to the
stage where the VM is in a panic and is telling you _specifically_ what
to write/free/etc.
> > If you think that VM should tell the FS when it has too many pages, does
> > that mean that the VM understands that a particular page in the subcache
> > has not been accessed recently enough? Is that the pivot point of our
> > disagreement?
>
> Pretty much. I don't think the VM should say 'you have too many pages', I
> think it should say 'free this page'.
As above, it should have the capability to do both, depending on the
circumstances. The FS can obviously make better judgements locally about
what to write under normal circumstances, so it should be given the best
chance to do so.
The VM can make better _specific_ judgements when it needs to (e.g. free
a DMA page or another specific page to allow a larger contiguous chunk of
memory to be allocated), but in the cases where it just wants _some_ page(s)
to be freed, it should allow the FS to decide which one(s), if it cares.
Cheers, Andreas
-- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://www-mddsp.enel.ucalgary.ca/People/adilger/- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/