linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Francis Moreau <francis.moro@gmail.com>
Cc: linux-mm@kvack.org
Subject: Re: pte_none versus pte_present
Date: Fri, 24 Aug 2007 11:55:59 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0708241137180.13431@blonde.wat.veritas.com> (raw)
In-Reply-To: <38b2ab8a0708240202o6570cf55j2d97e45663d8165e@mail.gmail.com>

On Fri, 24 Aug 2007, Francis Moreau wrote:
> 
> Sorry for being blind but I cannot see any differences between
> these 2 helpers.  When should we prefer using one rather the other ?

pte_present says if there's a real page table entry there (including
the exceptional case of a pte which is not-present to the MMU, but
otherwise a good pte: sometimes required when handling PROT_NONE).

pte_none says if the slot is empty: when a pte is not present, we may
use its slot to note where to find the page when it's to be faulted
in; or if that's not needed leave it empty as pte_none.

The common case of !pte_present && !pte_none is when an anonymous page
is swapped out: the slot notes where the required page can be found
on swap.  Oddly we don't have a macro for that case, but for the less
common case of pte_file: used in a VM_NONLINEAR vma, to note what
offset of the file to pull the page from when faulting in.  (And
page migration uses a swap-like value, without actually using swap.)

Hope that helps you to decide which one you need.

Hugh

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-08-24 10:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-24  9:02 Francis Moreau
2007-08-24 10:55 ` Hugh Dickins [this message]
2007-08-24 19:35   ` Francis Moreau

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=Pine.LNX.4.64.0708241137180.13431@blonde.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=francis.moro@gmail.com \
    --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