Re: [PATCH v3 0/2] fadvise: support POSIX_FADV_NOREUSE

From: Patrick J. LoPresti
Date: Tue Jul 12 2011 - 20:36:08 EST


On Tue, Jul 12, 2011 at 3:22 PM, Andrea Righi <andrea@xxxxxxxxxxxxxxx> wrote:
>
> If the file data is not in memory you can't set a bit in any struct
> page. You could even open a file and execute POSIX_FADV_NOREUSE without
> reading any page from the file.

Mmm, too bad.

> I think it would be better to maintain a list of file offset/length
> structures per file descriptor or (as a starting solution) even mark the
> entire file as non-cacheable without considering the ranges.

I recommend against the "whole file" approach. In my application (for
instance), I deal with files in the hundreds of gigabytes. Marking
the whole file non-cacheable, when I was just trying to give a hint
about a few hundred megs, would be a total disaster.

I would suggest implementing it right or leaving it as a no-op. Just my $0.02.

Thanks for working on this. Better support for these page cache hints
will be great to see.

- Pat
--
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/