linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Martin Maletinsky <maletinsky@scs.ch>
To: linux-mm@kvack.org, kernelnewbies@nl.linux.org
Subject: Question on swapping
Date: Wed, 04 Dec 2002 16:17:57 +0100	[thread overview]
Message-ID: <3DEE1CA5.7C45C252@scs.ch> (raw)

Hello,

I am looking at the swapping mechanism in Linux. I have read the relevant chapter 16 in 'Understanding the Linux Kernel' from Bovet&Cesati, and looked at the 2.2.18 kernel
source code. I still have the follwing question:

Function try_to_swap_out() [p. 481 in 'Understanding the Linux Kernel']:
If the page in question already belongs to the swap cache, the function performs no data transfer to the swap space on the disk (but only marks the page as swapped out).
The corresponding comment in the try_to_swap_out() functions states 'Is the page already in the swap cache? If so, ..... - it is already up-to-date on disk.
Understanding the Linux Kernel states on p. 482 'If the page belongs to the swap cache .... no memory transfer is performed'.
Now my question is, couldn't the page have been modified since it was added to the swap cache (and written to disk), and thus differ from the data in the swap space? In
this case shouldn't the page be written to disk (again)?
Such a modification may result from a store operation of another process that shares the page with the process from which it was added to the swap cache, or by an I/O
operation from some external device - in both cases the data stored in the corresponding page slot in the swap area differs from the data stored in the page frame. If later
on the page frame is released by shrink_mmap() from the swap cache, and subsequently needs to be restored from the data in the swap area, the page frame's latest content is
lost.

Thanks in advance for any help
with best regards
Martin Maletinsky

P.S. Please put me on CC: in your reply, since I am not in the mailing list.

--
Supercomputing System AG          email: maletinsky@scs.ch
Martin Maletinsky                 phone: +41 (0)1 445 16 05
Technoparkstrasse 1               fax:   +41 (0)1 445 16 10
CH-8005 Zurich
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/

             reply	other threads:[~2002-12-04 15:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-04 15:17 Martin Maletinsky [this message]
2002-12-05 19:08 ` Joseph A Knapka
2002-12-06  9:45   ` Martin Maletinsky
2002-12-07  1:29     ` Amol Kumar Lad
2002-12-12 15:56       ` Joseph A Knapka

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=3DEE1CA5.7C45C252@scs.ch \
    --to=maletinsky@scs.ch \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox