Re: [PATCH mmotm v2] tmpfs: do not allocate pages on read

Hugh Dickins
2022-03-08T21:46:21Z

On Tue, 8 Mar 2022, Darrick J. Wong wrote:
>
> I've long wondered (for my own nefarious purposes) why tmpfs files
> didn't just grab the zero page,

(tmpfs files have been using the zero page for reads for many years:
it was just this odd internal "could it be for a stacking filesystem?"
case, which /dev/loop also fell into, which was doing allocation on read.

I wonder what your nefarious purposes are ;) Maybe related to pages
faulted into an mmap: those pages tmpfs has always allocated for, then
they're freed up later by page reclaim if still undirtied. We may change
that in future, and use the zero page even there: there are advantages
of course, but some care and code needed - never been a priority.)

> so:
>
> Acked-by: Darrick J. Wong <djwong@kernel.org>

Thanks,
Hugh