lkml.org 
[lkml]   [1999]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: MM deadlock [was: Re: arca-vm-8...]
From
Date
Linus Torvalds <torvalds@transmeta.com> writes:

> On Tue, 12 Jan 1999, Stephen C. Tweedie wrote:
> >
> > On 11 Jan 1999 00:04:11 -0600, ebiederm+eric@ccr.net (Eric W. Biederman)
> > said:
> >
> > > Oh, and just as a side note we are currently unfairly penalizing
> > > threaded programs by doing for_each_task instead of for_each_mm in the
> > > swapout code...
> >
> > I know, on my TODO list...
>
> Actually, this one is _really_ easy to fix.
>
> The truly trivial fix is to just move "swap_cnt" into the mm structure,
> and you're all done. You'd still walk the list with for_each_task(), but
> it no longer matters.
>
> Linus
>

Not related to this, but I (hopefully correctly) observed that SHM
swap I/O is done synchronously.

Could somebody spare a minute to explain why is that so, and what
needs to be done to make SHM swapping asynchronous?


Also, while we're at MM fixes, I'm appending below a small patch that
will improve interactive feel.

After number of async pages gets bigger than pager_daemon.swap_cluster
(= SWAP_CLUSTER_MAX), swapin readahead becomes synchronous, and that
hurts performance. It is better to skip readahead in such situations,
and that is also more fair to swapout. Andrea came to exactly the same
conclusion, independent of me (on the same day :)).

diff -urN linux-pre-7/mm/page_alloc.c linux/mm/page_alloc.c
--- linux-pre-7/mm/page_alloc.c Tue Jan 11 07:28:06 1999
+++ linux/mm/page_alloc.c Tue Jan 11 07:29:44 1999
@@ -358,6 +358,8 @@
for (i = 1 << page_cluster; i > 0; i--) {
if (offset >= swapdev->max)
return;
+ if (atomic_read(&nr_async_pages) > pager_daemon.swap_cluster)
+ return;
if (!swapdev->swap_map[offset] ||
swapdev->swap_map[offset] == SWAP_MAP_BAD ||
test_bit(offset, swapdev->swap_lockmap))
Regards,
--
Zlatko

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.195 / U:0.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site