From: Marcelo Tosatti <marcelo@conectiva.com.br>
To: Rik van Riel <riel@conectiva.com.br>
Cc: linux-mm@kvack.org, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: nr_async_pages and swapin readahead on -ac series
Date: Wed, 7 Mar 2001 22:57:21 -0300 (BRT) [thread overview]
Message-ID: <Pine.LNX.4.21.0103072241130.1268-100000@freak.distro.conectiva> (raw)
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/
next reply other threads:[~2001-03-08 1:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-08 1:57 Marcelo Tosatti [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.21.0103072241130.1268-100000@freak.distro.conectiva \
--to=marcelo@conectiva.com.br \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-mm@kvack.org \
--cc=riel@conectiva.com.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox