mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Helge Hafting <helge.hafting@aitel.hist.no>
To: mfbaustx <mfbaustx@gmail.com>
Cc: Oliver Neukum <oliver@neukum.org>, linux-kernel@vger.kernel.org
Subject: Re: copy_from_user / copy_to_user with no swap space
Date: Tue, 17 Oct 2006 14:00:53 +0200	[thread overview]
Message-ID: <4534C5F5.70600@aitel.hist.no> (raw)
In-Reply-To: <op.thi48zvznwjy9v@titan>

mfbaustx wrote:
>>>> No. Your code may be only partially paged into RAM.
>>>> The same can happen for any mmaped data.
>
> That's what I thought I read.  But then my question is:  with 
> on-demand paging, is it possible to have two processes partially 
> paged?  Surely, it MUST be the case that any processes with 
> overlapping logical address spaces must be paged coherently.  So, 
> while on-demand "paging-in" allows for partial paging of a process, is 
> it the case that, on a context switch, the user-space PTE's are 
> completely erased (so that you get page-faults and can then on-demand 
> page them in...)?
You can surely have two or more processes partially paged.
Or some processes more or less paged out, while some are not.

The kernel never looses track of the address spaces, and knows very well
which block on the swapdevice maps to what address.  And of course
it knows what process the block belongs to too.

Several processes can all have their own address 4096 swapped out
at the same time, for example. Obviously to different blocks on the 
swapdisk.
There is no need for any special care when several processes are
swapped at the same time.

Demand paging happens when a process tries to use memory but the
memory isn't there.  The processor will then get an exception and
schedule read-in of the missing memory.  When the memory eventually gets
there, the process is allowed to continue.

Helge Hafting


  parent reply	other threads:[~2006-10-17 12:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-16 19:19 mfbaustx
2006-10-16 19:28 ` Oliver Neukum
2006-10-16 19:47   ` mfbaustx
2006-10-17 10:58     ` Horst H. von Brand
2006-10-17 12:00     ` Helge Hafting [this message]
2006-10-16 19:34 ` Al Viro
2006-10-16 19:39 ` Kyle Moffett
2006-10-16 20:26   ` mfbaustx
2006-10-16 20:21 ` Horst H. von Brand

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=4534C5F5.70600@aitel.hist.no \
    --to=helge.hafting@aitel.hist.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfbaustx@gmail.com \
    --cc=oliver@neukum.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

Powered by JetHome