Re: [PATCH 3/14] tmpfs: take control of its truncate_range
From: Christoph Hellwig
Date: Fri Jun 03 2011 - 01:16:17 EST
On Wed, Jun 01, 2011 at 09:58:18AM -0700, Hugh Dickins wrote:
> (i915 isn't really doing hole-punching there, I think it just found it
> a useful interface to remove the page-and-swapcache without touching
> i_size. Parentheses because it makes no difference to your point.)
Keeping i_size while removing pages on tmpfs fits the defintion of hole
punching for me. Not that it matters anyway.
> When I say "shmem", I am including the !SHMEM-was-TINY_SHMEM case too,
> which goes to ramfs. Currently i915 has been configured to disable that
> possibility, though we insisted on it originally: there may or may not be
> good reason for disabling it - may just be a side-effect of the rather
> twisted unintuitive SHMEM/TMPFS dependencies.
Hmm, the two different implementations make everything harder. Also
because we don't even implement the hole punching in !SHMEM tmpfs.
> Fine, I'll add tmpfs PUNCH_HOLE later on. And wire up madvise MADV_REMOVE
> to fallocate PUNCH_HOLE, yes?
Yeah. One thing I've noticed is that the hole punching doesn't seem
to do the unmap_mapping_range. It might be worth to audit that from the
VM point of view.
> Would you like me to remove the ->truncate_range method from
> inode_operations completely?
Doing that would be nice. Do we always have the required file struct
for ->fallocate in the callers?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/