Re: MM deadlock [was: Re: arca-vm-8...]

Andrea Arcangeli
1999-01-13T13:45:09Z

On Tue, 12 Jan 1999, Rik van Riel wrote:

> IIRC this facility was in the original swapin readahead
> implementation. That only leaves the question who removed
> it and why :))

There's another thing I completly disagree and that I just removed here.
It's the alignment of the offset field. I see no one point in going back
instead of only doing real read_ahead_.

Maybe I am missing something?

Index: page_alloc.c
===================================================================
RCS file: /var/cvs/linux/mm/page_alloc.c,v
retrieving revision 1.1.1.8
retrieving revision 1.1.1.1.2.29
diff -u -r1.1.1.8 -r1.1.1.1.2.29
--- page_alloc.c 1999/01/11 21:24:23 1.1.1.8
+++ linux/mm/page_alloc.c 1999/01/12 23:00:04 1.1.1.1.2.29
@@ -353,10 +352,10 @@
unsigned long offset = SWP_OFFSET(entry);
struct swap_info_struct *swapdev = SWP_TYPE(entry) + swap_info;

- offset = (offset >> page_cluster) << page_cluster;
-
for (i = 1 << page_cluster; i > 0; i--) {
- if (offset >= swapdev->max)
+ if (offset >= swapdev->max ||
+ /* don't block on I/O for doing readahead -arca */
+ atomic_read(&nr_async_pages) > pager_daemon.max_async_pages)
return;
if (!swapdev->swap_map[offset] ||
swapdev->swap_map[offset] == SWAP_MAP_BAD ||

Andrea Arcangeli