linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Joseph A. Knapka" <jknapka@earthlink.net>
To: Martin Maletinsky <maletinsky@scs.ch>
Cc: linux-mm@kvack.org, kernelnewbies@nl.linux.org
Subject: Re: kiobuf interface / PG_locked flag
Date: Thu, 12 Sep 2002 09:24:56 -0600	[thread overview]
Message-ID: <3D80B1C8.EE19E03D@earthlink.net> (raw)
In-Reply-To: <3D8054D5.B385C83@scs.ch>

Martin Maletinsky wrote:
> 
> Hello,
> 
> I just read about the kiobuf interface in the Linux Device Driver book from Rubini/Corbet, and there is one point, which I don't understand:
> - map_user_kiobuf() forces the pages within a user space address range into physical memory, and increments their usage count, which subsequently prevents the pages from
> being swapped out.

While it's true that having a non-zero reference count will prevent
a page from being swapped out, such a page is still subject to
all normal VM operations. In particular, the VM might unmap
the page from your process, *decrement its reference count*, and
then swap it out.

> - lock_kiovec() sets the PG_locked flag for the pages in the kiobufs of a kiovec. The PG_locked flag prevents the pages from being swapped out, which is however already
> ensured by map_user_kiobuf().

I believe PG_locked will prevent the VM from unmapping the
page, which does, in fact, gaurantee that it won't be
swapped out.

Cheers,

-- Joe
  "I'd rather chew my leg off than maintain Java code, which
   sucks, 'cause I have a lot of Java code to maintain and
   the leg surgery is starting to get expensive." - Me
--
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-09-12 15:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-12  8:48 Martin Maletinsky
2002-09-12 15:24 ` Joseph A. Knapka [this message]
2002-09-12 15:33   ` Stephen C. Tweedie
2002-09-13 12:41     ` Jan Hudec
2002-09-13 14:45       ` Stephen C. Tweedie
2002-09-15 15:54         ` Jan Hudec

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=3D80B1C8.EE19E03D@earthlink.net \
    --to=jknapka@earthlink.net \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-mm@kvack.org \
    --cc=maletinsky@scs.ch \
    /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