20 Jun, 2013

1 commit

  • This will be later used by powerpc THP support. In powerpc we want to use
    pgtable for storing the hash index values. So instead of adding them to
    mm_context list, we would like to store them in the second half of pmd

    Signed-off-by: Aneesh Kumar K.V
    Reviewed-by: Andrea Arcangeli
    Reviewed-by: David Gibson
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Benjamin Herrenschmidt

    Aneesh Kumar K.V
     

11 Dec, 2012

2 commits

  • If ptep_clear_flush() is called to clear a page table entry that is
    accessible anyway by the CPU, eg. a _PAGE_PROTNONE page table entry,
    there is no need to flush the TLB on remote CPUs.

    Signed-off-by: Rik van Riel
    Signed-off-by: Peter Zijlstra
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Link: http://lkml.kernel.org/n/tip-vm3rkzevahelwhejx5uwm8ex@git.kernel.org
    Signed-off-by: Ingo Molnar

    Rik van Riel
     
  • The function ptep_set_access_flags is only ever used to upgrade
    access permissions to a page. That means the only negative side
    effect of not flushing remote TLBs is that other CPUs may incur
    spurious page faults, if they happen to access the same address,
    and still have a PTE with the old permissions cached in their
    TLB.

    Having another CPU maybe incur a spurious page fault is faster
    than always incurring the cost of a remote TLB flush, so replace
    the remote TLB flush with a purely local one.

    This should be safe on every architecture that correctly
    implements flush_tlb_fix_spurious_fault() to actually invalidate
    the local TLB entry that caused a page fault, as well as on
    architectures where the hardware invalidates TLB entries that
    cause page faults.

    In the unlikely event that you are hitting what appears to be
    an infinite loop of page faults, and 'git bisect' took you to
    this changeset, your architecture needs to implement
    flush_tlb_fix_spurious_fault to actually flush the TLB entry.

    Signed-off-by: Rik van Riel
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Cc: Peter Zijlstra
    Cc: Michel Lespinasse
    Cc: Ingo Molnar

    Rik van Riel
     

09 Oct, 2012

2 commits

  • On s390, a valid page table entry must not be changed while it is attached
    to any CPU. So instead of pmd_mknotpresent() and set_pmd_at(), an IDTE
    operation would be necessary there. This patch introduces the
    pmdp_invalidate() function, to allow architecture-specific
    implementations.

    Signed-off-by: Gerald Schaefer
    Cc: Andrea Arcangeli
    Cc: Andi Kleen
    Cc: Hugh Dickins
    Cc: Hillf Danton
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gerald Schaefer
     
  • The thp page table pre-allocation code currently assumes that pgtable_t is
    of type "struct page *". This may not be true for all architectures, so
    this patch removes that assumption by replacing the functions
    prepare_pmd_huge_pte() and get_pmd_huge_pte() with two new functions that
    can be defined architecture-specific.

    It also removes two VM_BUG_ON checks for page_count() and page_mapcount()
    operating on a pgtable_t. Apart from the VM_BUG_ON removal, there will be
    no functional change introduced by this patch.

    Signed-off-by: Gerald Schaefer
    Cc: Andrea Arcangeli
    Cc: Andi Kleen
    Cc: Hugh Dickins
    Cc: Hillf Danton
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gerald Schaefer
     

26 May, 2012

1 commit

  • The change adds some infrastructure for managing tile pmd's more generally,
    using pte_pmd() and pmd_pte() methods to translate pmd values to and
    from ptes, since on TILEPro a pmd is really just a nested structure
    holding a pgd (aka pte). Several existing pmd methods are moved into
    this framework, and a whole raft of additional pmd accessors are defined
    that are used by the transparent hugepage framework.

    The tile PTE now has a "client2" bit. The bit is used to indicate a
    transparent huge page is in the process of being split into subpages.

    This change also fixes a generic bug where the return value of the
    generic pmdp_splitting_flush() was incorrect.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

22 Mar, 2012

1 commit

  • These macros will be used in a later patch, where all usages are expected
    to be optimized away without #ifdef CONFIG_TRANSPARENT_HUGEPAGE. But to
    detect unexpected usages, we convert the existing BUG() to BUILD_BUG().

    [akpm@linux-foundation.org: fix build in mm/pgtable-generic.c]
    Signed-off-by: Naoya Horiguchi
    Acked-by: Hillf Danton
    Reviewed-by: Andrea Arcangeli
    Reviewed-by: KAMEZAWA Hiroyuki
    Acked-by: David Rientjes
    Cc: Daisuke Nishimura
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Naoya Horiguchi
     

26 Jan, 2011

1 commit

  • mips (and sparc32):

    In file included from arch/mips/include/asm/tlb.h:21,
    from mm/pgtable-generic.c:9:
    include/asm-generic/tlb.h: In function `tlb_flush_mmu':
    include/asm-generic/tlb.h:76: error: implicit declaration of function `release_pages'
    include/asm-generic/tlb.h: In function `tlb_remove_page':
    include/asm-generic/tlb.h:105: error: implicit declaration of function `page_cache_release'

    free_pages_and_swap_cache() and free_page_and_swap_cache() are macros
    which call release_pages() and page_cache_release(). The obvious fix is
    to include pagemap.h in swap.h, where those macros are defined. But that
    breaks sparc for weird reasons.

    So fix it within mm/pgtable-generic.c instead.

    Reported-by: Yoichi Yuasa
    Cc: Geert Uytterhoeven
    Acked-by: Sam Ravnborg
    Cc: Sergei Shtylyov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

17 Jan, 2011

1 commit

  • pmdp_get_and_clear/pmdp_clear_flush/pmdp_splitting_flush were trapped as
    BUG() and they were defined only to diminish the risk of build issues on
    not-x86 archs and to be consistent with the generic pte methods previously
    defined in include/asm-generic/pgtable.h.

    But they are causing more trouble than they were supposed to solve, so
    it's simpler not to define them when THP is off.

    This is also correcting the export of pmdp_splitting_flush which is
    currently unused (x86 isn't using the generic implementation in
    mm/pgtable-generic.c and no other arch needs that [yet]).

    Signed-off-by: Andrea Arcangeli
    Sam Ravnborg
    Cc: Stephen Rothwell
    Cc: "David S. Miller"
    Cc: Benjamin Herrenschmidt
    Cc: "Luck, Tony"
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Arcangeli
     

14 Jan, 2011

1 commit

  • Some are needed to build but not actually used on archs not supporting
    transparent hugepages. Others like pmdp_clear_flush are used by x86 too.

    Signed-off-by: Andrea Arcangeli
    Acked-by: Rik van Riel
    Acked-by: Mel Gorman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Arcangeli