linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* nr_async_pages and swapin readahead on -ac series
@ 2001-03-08  1:57 Marcelo Tosatti
  2001-03-08 12:17 ` Rik van Riel
  2001-03-08 20:17 ` Stephen C. Tweedie
  0 siblings, 2 replies; 5+ messages in thread
From: Marcelo Tosatti @ 2001-03-08  1:57 UTC (permalink / raw)
  To: Rik van Riel; +Cc: linux-mm, Alan Cox

Rik, 
 
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. 

One possible way to limit the swapin readahead is to split nr_async_pages
into read and write counters and change all places which use
nr_async_pages accordingly.

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)

Comments? 


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-03-09 11:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-08  1:57 nr_async_pages and swapin readahead on -ac series Marcelo Tosatti
2001-03-08 12:17 ` Rik van Riel
2001-03-08 20:17 ` Stephen C. Tweedie
2001-03-08 22:47   ` Marcelo Tosatti
2001-03-09 11:02     ` Stephen C. Tweedie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox