linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* pte_none versus pte_present
@ 2007-08-24  9:02 Francis Moreau
  2007-08-24 10:55 ` Hugh Dickins
  0 siblings, 1 reply; 3+ messages in thread
From: Francis Moreau @ 2007-08-24  9:02 UTC (permalink / raw)
  To: linux-mm

or call me the dumb question of the day instead...

Sorry for being blind but I cannot see any differences between these 2 helpers.
When should we prefer using one rather the other ?

Thanks for sheding some light !
-- 
Francis

--
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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pte_none versus pte_present
  2007-08-24  9:02 pte_none versus pte_present Francis Moreau
@ 2007-08-24 10:55 ` Hugh Dickins
  2007-08-24 19:35   ` Francis Moreau
  0 siblings, 1 reply; 3+ messages in thread
From: Hugh Dickins @ 2007-08-24 10:55 UTC (permalink / raw)
  To: Francis Moreau; +Cc: linux-mm

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pte_none versus pte_present
  2007-08-24 10:55 ` Hugh Dickins
@ 2007-08-24 19:35   ` Francis Moreau
  0 siblings, 0 replies; 3+ messages in thread
From: Francis Moreau @ 2007-08-24 19:35 UTC (permalink / raw)
  To: Hugh Dickins; +Cc: linux-mm

Hello Hugh,

On 8/24/07, Hugh Dickins <hugh@veritas.com> wrote:
> 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).
>

It could had been called pte_mmu instead...

> 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.
>

ok, so this one could had been named pte_inuse...

> 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.
>

I think I get the idea now.

Thanks a lot for that !
-- 
Francis

--
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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-24 19:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-24  9:02 pte_none versus pte_present Francis Moreau
2007-08-24 10:55 ` Hugh Dickins
2007-08-24 19:35   ` Francis Moreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox