Re: [patch]mm: make madvise(MADV_WILLNEED) support swap file prefetch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 08, 2013 at 10:16:07AM +0800, Wanpeng Li wrote:
> On Mon, Jan 07, 2013 at 12:06:30PM -0800, Andrew Morton wrote:
> >On Mon, 7 Jan 2013 16:12:37 +0800
> >Shaohua Li <shli@xxxxxxxxxx> wrote:
> >
> >> 
> >> Make madvise(MADV_WILLNEED) support swap file prefetch. If memory is swapout,
> >> this syscall can do swapin prefetch. It has no impact if the memory isn't
> >> swapout.
> >
> >Seems sensible.
> 
> Hi Andrew and Shaohua,
> 
> What's the performance in the scenario of serious memory pressure? Since
> in this case pages in swap are highly fragmented and cache hit is most
> impossible. If WILLNEED path should add a check to skip readahead in
> this case since swapin only leads to unnecessary memory allocation. 

pages in swap are not highly fragmented if you access memory sequentially. In
that case, the pages you accessed will be added to lru list side by side. So if
app does swap prefetch, we can do sequential disk access and merge small
request to big one.

Another advantage is prefetch can drive high disk iodepth.  For sequential
access, this can cause big request. Even for random access, high iodepth has
much better performance especially for SSD.

Thanks,
Shaohua

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]