* swapin readahead and locking
@ 1998-12-01 16:12 Rik van Riel
1998-12-02 17:41 ` Stephen C. Tweedie
0 siblings, 1 reply; 2+ messages in thread
From: Rik van Riel @ 1998-12-01 16:12 UTC (permalink / raw)
To: Stephen C. Tweedie; +Cc: Linux MM
Hi Stephen,
I am now using the following construction (well, since
09:15 this morning):
struct page *page_map = lookup_swap_cache(entry);
if (!page_map) {
page_map = read_swap_cache(entry);
... do readahead stuff
}
I have a funny feeling I missed a wait_on_page() this way,
but things are runnig happily right now. If I missed a big
thing like this, please let me know -- I'd hate it to have
people test the patch (it is up for grabs) and end up with
a corrupted system...
thanks,
Rik -- now completely used to dvorak kbd layout...
+-------------------------------------------------------------------+
| Linux memory management tour guide. H.H.vanRiel@phys.uu.nl |
| Scouting Vries cubscout leader. http://www.phys.uu.nl/~riel/ |
+-------------------------------------------------------------------+
--
This is a majordomo managed list. To unsubscribe, send a message with
the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: swapin readahead and locking
1998-12-01 16:12 swapin readahead and locking Rik van Riel
@ 1998-12-02 17:41 ` Stephen C. Tweedie
0 siblings, 0 replies; 2+ messages in thread
From: Stephen C. Tweedie @ 1998-12-02 17:41 UTC (permalink / raw)
To: Rik van Riel; +Cc: Stephen C. Tweedie, Linux MM
Hi,
On Tue, 1 Dec 1998 17:12:45 +0100 (CET), Rik van Riel
<H.H.vanRiel@phys.uu.nl> said:
> struct page *page_map = lookup_swap_cache(entry);
> if (!page_map) {
> page_map = read_swap_cache(entry);
> ... do readahead stuff
> }
read_swap_cache() is not asynchronous! include/linux/swap.h:
#define read_swap_cache(entry) read_swap_cache_async(entry, 1);
I think you were on the right lines before (except for the missing
free_page()).
> I have a funny feeling I missed a wait_on_page() this way,
> but things are runnig happily right now.
No, read_swap_cache automatically waits, and if you do the async
version, then any later call to read the same page will in turn wait for
the IO to complete.
--Stephen
--
This is a majordomo managed list. To unsubscribe, send a message with
the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-12-02 17:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-01 16:12 swapin readahead and locking Rik van Riel
1998-12-02 17:41 ` 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