lkml.org 
[lkml]   [2001]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: do_swap_page() in -pre4

On Mon, 29 Oct 2001, Andrew Morton wrote:
> Linus Torvalds wrote:
> >
> > On Mon, 29 Oct 2001, Andrew Morton wrote:
> > >
> > > That UnlockPage() looks wrong to me?
> >
> > You're right. I'll fix it and make a pre5, it's obviously left-overs from
> > before..

pre5 fixed (along with some other things, like remobing from the LRU list
in all cases where needed..)

> OK. Could you please add mm->page_table_lock to this comment:
>
> + *
> + * Ordering:
mm->page_table_lock ->
> + * swap_lock ->
swap_device_lock() ->
> + * pagemap_lru_lock ->
> + * pagecache_lock

is what it should be. If that doesn't look right, holler.

I don't think any other locking really changed, except the LRU and the
pagecache lock used to be the other way around.

Oh, the thing that _did_ change was that getting the page lock used to
also freeze the swap_map count for that page. Which meant much too much
locking of pages on swapin (which in turn meant that you couldn't just
re-attach the page while it was being written out).

pre5 makes the new rules clearer, I think (ie we check the swap count
under the swap lock, and we check the page count under the pagecache lock,
so there should be no "subtle" rules wrt the page lock at all. The page
lock has no bearing on the swap count at all).

I've tested pre5 by running X and konqueror in 40MB of RAM, and I tested
pre4 by swapping heavily in 2GB or ram (which only goes to show you how
forgiving 2G is even if you have almost 3BG in swap - the UnlockPage and a
few other things were very clear in 40MB and never showed up with tons
of memory).

It behaves well here, although in the low-memory tests I think there I've
found what appears to be a KDE process startup race condition (ie KDE is
not happy about swapping heavily and starting new processes - looks like
the communication setup is racy or something).

Testers appreciated,

Linus

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

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