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

Re: nr_async_pages and swapin readahead on -ac series



On Wed, 7 Mar 2001, Marcelo Tosatti wrote:

> On the latest 2.4 -ac series, nr_async_pages is only being used to count
> swap outs, and not for both swap reads and writes (as Linus tree does).
>
> The problem is that nr_async_pages is used to limit swapin readahead based
> on the number of on flight swap pages (mm/memory.c::swapin_readahead):
>
>                 /* Don't block on I/O for read-ahead */
>                 if (atomic_read(&nr_async_pages) >= pager_daemon.swap_cluster
>                                 * (1 << page_cluster)) {
>                         while (i++ < num)
>                                 swap_free(SWP_ENTRY(SWP_TYPE(entry), offset++));
>                         break;
>                 }
>
>
> So swapin readahead is (theorically) unlimited.

> However, I think a better solution is to ask the block layer if
> there are free requests on the device queue and stop the
> readahead in case there are no free ones. (we don't something
> like that right now, but it can be easily done in the block
> layer)

An even better idea would be to only do swapin readahead if
there is memory available ...

regards,

Rik
--
Linux MM bugzilla: http://linux-mm.org/bugzilla.shtml

Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...

		http://www.surriel.com/
http://www.conectiva.com/	http://distro.conectiva.com/

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/