All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Zlatko Calusic <Zlatko.Calusic@CARNet.hr>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: Linux-MM List <linux-mm@kvack.org>,
	Linux Kernel List <linux-kernel@vger.rutgers.edu>
Subject: Re: Removing swap lockmap...
Date: 19 Jan 1999 02:33:42 +0100	[thread overview]
Message-ID: <874spoqc5l.fsf@atlas.CARNet.hr> (raw)
In-Reply-To: "Stephen C. Tweedie"'s message of "Mon, 18 Jan 1999 21:46:40 GMT"

"Stephen C. Tweedie" <sct@redhat.com> writes:

> Hi,
> 
> In article <87iue47gy4.fsf@atlas.CARNet.hr>, Zlatko Calusic
> <Zlatko.Calusic@CARNet.hr> writes:
> 
> > I removed swap lockmap all together and, to my surprise, I can't
> > produce any ill behaviour on my system, not even under very heavy
> > swapping (in low memory condition).
> 
> Just because you can't reproduce it doesn't mean it works perfectly.
> There was a very good reason why the swap lock map was still required
> until recently.  The race condition it fixed wass an obscure one but
> still important.  However, very recent VM changes make me wonder if it
> is still absolutely necessary.  
> 
> The problem was that if we swapped out a page, we might sometimes remove
> the swap cache for the page before the IO was complete.  If we can
> _guarantee_ that the swap cache will persist until after the IO is
> complete, then any future attempt to use that swap page will find that
> the page is locked and will wait for the IO to complete.
> 
> However, if in fact the swap cache for the page _ever_ gets removed
> before the IO completes, then a future read in of the page might start
> before the current write had completed.  This has been observed in
> practice.  The swap lock protects against this.

Yes, this is what I observed by reading some older articles from
linux-mm list (mostly conversation between you and Eric). So, I
decided to remove swap lockmap, reproduce problems and then try to fix
them. There is even one Eric's useful comment (removed in my patch)
that is useful in deciding what should be done to prevent problems.

But, interesting thing is that whatever I do, I CAN'T get into trouble 
and that is interesting part. :-)

> 
> Now that we always keep the swap cache intact in mm/vmscan.c and only
> reclaim it in mm/filemap.c, we might in fact be safe omiting the swap
> lock.  I'd be nervous about it without a _thorough_ audit of the code,
> though, as this particular race is hard to reproduce.
> 

Yes, I have the same worries now so close to real 2.2.0, that's why I
see this patch strictly experimental (it is not sent to Linus,
directly!). Maybe, someone of you could try it for yourself, and if
enough people test it, and if we try hard to understand why it seems
to not make thing worse, maybe there's a slight chance it could go in
for 2.2, or at least as a first thing in 2.3.0, so it gets heavily
tested and debugged.

But, I'm also nervous about it...
I rememeber there really were some nasty silent deaths while lockmap was
removed in some revisions during 2.1.x. :-(

Thanks for comments.
-- 
Zlatko
--
This is a majordomo managed list.  To unsubscribe, send a message with
the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org

  reply	other threads:[~1999-01-19  1:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-18 15:12 Removing swap lockmap Zlatko Calusic
1999-01-18 20:26 ` Andrea Arcangeli
1999-01-18 22:24   ` BUG: deadlock in swap lockmap handling Alan Cox
1999-01-18 21:46 ` Removing swap lockmap Stephen C. Tweedie
1999-01-19  1:33   ` Zlatko Calusic [this message]
1999-01-19  0:34 ` Eric W. Biederman
1999-01-19  1:37   ` Zlatko Calusic
1999-01-19 18:15     ` Andrea Arcangeli
1999-01-20 17:09       ` Stephen C. Tweedie
1999-01-20 18:14         ` Zlatko Calusic

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=874spoqc5l.fsf@atlas.CARNet.hr \
    --to=zlatko.calusic@carnet.hr \
    --cc=linux-kernel@vger.rutgers.edu \
    --cc=linux-mm@kvack.org \
    --cc=sct@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.