From: "Stephen C. Tweedie" <sct@redhat.com>
To: Kanoj Sarcar <kanoj@google.engr.sgi.com>
Cc: "Stephen C. Tweedie" <sct@redhat.com>,
riel@nl.linux.org, linux-mm@kvack.org
Subject: Re: filecache/swapcache questions
Date: Fri, 18 Jun 1999 18:00:03 +0100 (BST) [thread overview]
Message-ID: <14186.31507.833263.846717@dukat.scot.redhat.com> (raw)
In-Reply-To: <199906180020.RAA02498@google.engr.sgi.com>
Hi,
On Thu, 17 Jun 1999 17:20:10 -0700 (PDT), kanoj@google.engr.sgi.com
(Kanoj Sarcar) said:
> Interesting scenario ... unfortunately, I am getting confused.
> I am trying to lay out the steps in your example here:
> Step 1: P1 and P2 sharing a page which is not in core, is out on
> swap at swap handle X, swap_count(X) = 2 (P1 + P2)
> Step 2: P1 writes to page.
> Step 2a: swap_in reads in the page into core into page A,
> page_count(A) = 2 (swapcache + P1), A.offset = X,
> swap_count (X)= 2 (P2 + swapcache)
Yes. Exactly.
> So, what am I missing, since your example does not end up with
> page_count = 1 and swap_count(page offset/swaphandle) = 1?
> I did give an alternative scenario involving an exitting process,
> do you believe that one?
Yes --- I'd missed the fact that you wanted swap_count to be one as well
as page count.
> While I have your attention, I think I found a bug in the
> sys_swapoff algorithm ... basically, it needs to also look
> at swap_lockmap. Say an exitting process fired off some async
> swap ins just before it exitted, and a bunch of these are in
> flight (swap_lockmaps are set, as are swap_map, from swapcache).
> The swap device gets deleted (with a printk warning message due
> to non zero swap_map count). Finally, the old async swap in's
> start terminating, invoking swap_after_unlock_page. Interesting
> things could happen, depending on whether the swap id has been
> reallocated or not ... Is there any protection against this
> scenario?
Yes --- try_to_unuse calls read_swap_cache() with wait==1, so we always
wait for the IO to complete before swapoff can complete. At least,
that's the theory. :)
--Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm my@address'
in the body to majordomo@kvack.org. For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/
next prev parent reply other threads:[~1999-06-18 17:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-06-15 7:16 filecache/swapcache questions Kanoj Sarcar
1999-06-15 7:32 ` Rik van Riel
1999-06-15 15:51 ` Kanoj Sarcar
1999-06-15 20:24 ` Rik van Riel
1999-06-15 21:02 ` Kanoj Sarcar
1999-06-16 20:37 ` Andrea Arcangeli
1999-06-17 23:33 ` Stephen C. Tweedie
1999-06-18 0:20 ` Kanoj Sarcar
1999-06-18 17:00 ` Stephen C. Tweedie [this message]
1999-06-18 17:03 ` Kanoj Sarcar
-- strict thread matches above, loose matches on Subject: below --
1999-06-21 5:29 Kanoj Sarcar
1999-06-21 11:25 ` Stephen C. Tweedie
1999-06-21 16:46 ` Kanoj Sarcar
1999-06-21 16:57 ` Stephen C. Tweedie
1999-06-21 17:36 ` Kanoj Sarcar
1999-06-21 17:49 ` Stephen C. Tweedie
1999-06-21 18:46 ` Kanoj Sarcar
1999-06-21 23:44 ` Kanoj Sarcar
1999-06-24 22:23 ` Andrea Arcangeli
1999-06-24 23:55 ` Kanoj Sarcar
1999-06-25 0:26 ` Andrea Arcangeli
1999-06-28 22:36 ` Stephen C. Tweedie
1999-06-28 23:24 ` Kanoj Sarcar
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=14186.31507.833263.846717@dukat.scot.redhat.com \
--to=sct@redhat.com \
--cc=kanoj@google.engr.sgi.com \
--cc=linux-mm@kvack.org \
--cc=riel@nl.linux.org \
/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.