Re: [PATCH] fadvise: only initiate writeback for specified rangewith FADV_DONTNEED

From: Johannes Weiner
Date: Tue Nov 01 2011 - 11:06:21 EST


On Mon, Oct 31, 2011 at 11:16:59AM -0500, Shawn Bohrer wrote:
> Previously POSIX_FADV_DONTNEED would start writeback for the entire file
> when the bdi was not write congested. This negatively impacts
> performance if the file contians dirty pages outside of the requested
> range. This change uses __filemap_fdatawrite_range() to only initiate
> writeback for the requested range.
>
> Signed-off-by: Shawn Bohrer <sbohrer@xxxxxxxxxxxxxxx>

It probably makes sense for some cases to take advantage of the disk
head being nearby and flush more than requested.

But I can certainly see this go wrong by taking away the write-caching
benefits for the rest of the file just because a small part of it was
fadvised.

Acked-by: Johannes Weiner <jweiner@xxxxxxxxxx>
--
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/