[lkml]   [2012]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 04/31] x86/mm: Introduce pte_accessible()
On Thu, Oct 25, 2012 at 02:16:21PM +0200, Peter Zijlstra wrote:
> From: Rik van Riel <>
> We need pte_present to return true for _PAGE_PROTNONE pages, to indicate that
> the pte is associated with a page.
> However, for TLB flushing purposes, we would like to know whether the pte
> points to an actually accessible page. This allows us to skip remote TLB
> flushes for pages that are not actually accessible.

It feels like we are putting the cart before the horse to be taking TLB
flushing optimisations into account this early in the series. That
aside, what was wrong with the following patches?

autonuma: define _PAGE_NUMA
arch-dependant definition of a flag that happens to be PROT_NONE
on x86 but could be anything at all really which would help portability

autonuma: pte_numa() and pmd_numa()
makes pte_present do what you want
adds pte_numa and pmd_numa which potentially could have been
used instead of pte_accessible

autonuma: teach gup_fast about pmd_numa
sortof self-explanatory

and building on those? The arch-dependant nature of _PAGE_NUMA might have
avoided Linus sending the childrens college fund to the swear jar and
avoided this complaint;

because you have no idea if other architectures do

(a) the same trick as x86 does for PROT_NONE (I can already tell you
from a quick grep that ia64, m32r, m68k and sh do it)
(b) might not perhaps be caching non-present pte's anyway

The "autonuma: define _PAGE_NUMA" happens to use PROT_NONE but as an
implementation detail rather than by design and as a bonus point describes
what it is doing. The "autonuma" part in the title is misleading, it's
not autonuma-specific at all and could have been dropped or just renamed

Mel Gorman

 \ /
  Last update: 2012-11-01 12:21    [W:0.266 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site