hugetlbfs: cleanup and new primitives for s390, v3
Subsystems (3)
cover hugetlbfs: cleanup and new primitives for s390, v3
Quoted 3 lines · Andrew Morton
So basically the existing hugetlb arch support code needs a big de-macro crapectomy. But your patch has gone and massively duplicated the existing crap, making that decrapectomy larger and harder.
ok, all good things come in threes I guess, so here is a new patchset that also does the de-macro crapectomy. All macros are now replaced with inline functions, which increased the total loc again by some amount.
This patchset cleans up hugetlbfs architecture headers and adds new primitives as preparation for the s390 large page support. Most notably we found that we need to add a new tlb flush for the copy-on-write of a large page (patch 2/3). We think that this is a bug, but obviously one that hasn't shown up so far on any of the other large page architectures.
Cross-Compile tests on the affected architectures (and one unaffected) worked fine, but I had no cross-compiler for sh.
--
Gerald Schaefer
PATCH 1/3 hugetlbfs: architecture header cleanup
Subject: [PATCH 1/3] hugetlbfs: architecture header cleanup
From: Gerald Schaefer <[email protected]>
This patch moves all architecture functions for hugetlb to architecture header files (include/asm-foo/hugetlb.h) and converts all macros to inline functions. It also removes (!) ARCH_HAS_HUGEPAGE_ONLY_RANGE, ARCH_HAS_HUGETLB_FREE_PGD_RANGE, ARCH_HAS_PREPARE_HUGEPAGE_RANGE, ARCH_HAS_SETCLEAR_HUGE_PTE and ARCH_HAS_HUGETLB_PREFAULT_HOOK.
Getting rid of the ARCH_HAS_xxx #ifdef and macro fugliness should increase readability and maintainability, at the price of some code duplication. An asm-generic common part would have reduced the loc, but we would end up with new ARCH_HAS_xxx defines eventually.
---
include/asm-ia64/hugetlb.h | 37 +++++++++++++++++++++++++++++++ include/asm-ia64/page.h | 6 ----- include/asm-powerpc/hugetlb.h | 37 +++++++++++++++++++++++++++++++ include/asm-powerpc/page_64.h | 7 ------ include/asm-sh/hugetlb.h | 49 ++++++++++++++++++++++++++++++++++++++++++ include/asm-sparc64/hugetlb.h | 42 ++++++++++++++++++++++++++++++++++++ include/asm-sparc64/page.h | 2 - include/asm-x86/hugetlb.h | 49 ++++++++++++++++++++++++++++++++++++++++++ include/linux/hugetlb.h | 46 --------------------------------------- 9 files changed, 215 insertions(+), 60 deletions(-)
include/asm-ia64/hugetlb.h new file +37 -0
@@ -0,0 +1,37 @@ +#ifndef _ASM_IA64_HUGETLB_H +#define _ASM_IA64_HUGETLB_H + +#include <asm/page.h> + + +void hugetlb_free_pgd_range (struct mmu_gather **tlb,unsigned long addr, +unsigned long end,unsigned long floor, +unsigned long ceiling); + +int prepare_hugepage_range (unsigned long addr,unsigned long len); + +static inline int is_hugepage_only_range (struct mm_struct *mm, +unsigned long addr, +unsigned long len) +{ +return (REGION_NUMBER (addr) ==RGN_HPAGE || +REGION_NUMBER ((addr)+(len)-1 ) ==RGN_HPAGE ); +} + +static inline void hugetlb_prefault_arch_hook (struct mm_struct *mm) +{ +} + +static inline void set_huge_pte_at (struct mm_struct *mm,unsigned long addr, +pte_t *ptep,pte_t pte) +{ +set_pte_at (mm, addr, ptep, pte); +} + +static inline pte_t huge_ptep_get_and_clear (struct mm_struct *mm, +unsigned long addr,pte_t *ptep) +{ +return ptep_get_and_clear (mm, addr, ptep); +} + +#endif /* _ASM_IA64_HUGETLB_H */
include/asm-sh/hugetlb.h new file +49 -0
49 lines not on this page · raw message
include/asm-sparc64/hugetlb.h new file +42 -0
42 lines not on this page · raw message
include/asm-x86/hugetlb.h new file +49 -0
49 lines not on this page · raw message
include/linux/hugetlb.h +1 -45
58 lines not on this page · raw message
include/asm-powerpc/hugetlb.h new file +37 -0
@@ -0,0 +1,37 @@ +#ifndef _ASM_POWERPC_HUGETLB_H +#define _ASM_POWERPC_HUGETLB_H + +#include <asm/page.h> + + +int is_hugepage_only_range (struct mm_struct *mm,unsigned long addr, +unsigned long len); + +void hugetlb_free_pgd_range (struct mmu_gather **tlb,unsigned long addr, +unsigned long end,unsigned long floor, +unsigned long ceiling); + +void set_huge_pte_at (struct mm_struct *mm,unsigned long addr, +pte_t *ptep,pte_t pte); + +pte_t huge_ptep_get_and_clear (struct mm_struct *mm,unsigned long addr, +pte_t *ptep); + +/* +* If the arch doesn't supply something else, assume that hugepage +* size aligned regions are ok without further preparation. +*/ +static inline int prepare_hugepage_range (unsigned long addr,unsigned long len) +{ +if (len & ~HPAGE_MASK ) +return -EINVAL ; +if (addr & ~HPAGE_MASK ) +return -EINVAL ; +return 0 ; +} + +static inline void hugetlb_prefault_arch_hook (struct mm_struct *mm) +{ +} + +#endif /* _ASM_POWERPC_HUGETLB_H */
include/asm-ia64/page.h +0 -6
@@ -54,9 +54,6 @@# define HPAGE_MASK (~(HPAGE_SIZE - 1))# define HAVE_ARCH_HUGETLB_UNMAPPED_AREA -# define ARCH_HAS_HUGEPAGE_ONLY_RANGE -# define ARCH_HAS_PREPARE_HUGEPAGE_RANGE -# define ARCH_HAS_HUGETLB_FREE_PGD_RANGE #endif /* CONFIG_HUGETLB_PAGE */ #ifdef __ASSEMBLY__
@@ -153,9 +150,6 @@ typedef union ia64_va {# define htlbpage_to_page (x) (((unsigned long) REGION_NUMBER(x) << 61) \ | (REGION_OFFSET(x) >> (HPAGE_SHIFT-PAGE_SHIFT)))# define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) -# define is_hugepage_only_range (mm, addr, len) \ - (REGION_NUMBER(addr) == RGN_HPAGE || \ - REGION_NUMBER((addr)+(len)-1) == RGN_HPAGE)extern unsigned int hpage_shift;#endif
include/asm-powerpc/page_64.h +0 -7
@@ -128,11 +128,6 @@ extern void slice_init_context(struct mmextern void slice_set_user_psize (struct mm_struct *mm,unsigned int psize);#define slice_mm_new_context (mm) ((mm)->context.id == 0) -#define ARCH_HAS_HUGEPAGE_ONLY_RANGE -extern int is_hugepage_only_range (struct mm_struct *m, -unsigned long addr, -unsigned long len); -#endif /* __ASSEMBLY__ */ #else #define slice_init ()
@@ -146,8 +141,6 @@ do { \#ifdef CONFIG_HUGETLB_PAGE -#define ARCH_HAS_HUGETLB_FREE_PGD_RANGE -#define ARCH_HAS_SETCLEAR_HUGE_PTE #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA #endif /* !CONFIG_HUGETLB_PAGE */
include/asm-sparc64/page.h +0 -2
@@ -39,8 +39,6 @@#define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)#define HPAGE_MASK (~(HPAGE_SIZE - 1UL))#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) -#define ARCH_HAS_SETCLEAR_HUGE_PTE -#define ARCH_HAS_HUGETLB_PREFAULT_HOOK #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA #endif
Andrew Morton
maintainerRe: [PATCH 1/3] hugetlbfs: architecture header cleanup
Quoted 19 lines · On Fri, 04 Apr 2008 18:49:50 +0200 Gerald Schaefer…
Subject: [PATCH 1/3] hugetlbfs: architecture header cleanup
From: Gerald Schaefer <[email protected]>
This patch moves all architecture functions for hugetlb to architecture header files (
include/asm-foo/hugetlb.h) and converts all macros to inline functions. It also removes (!)ARCH_HAS_HUGEPAGE_ONLY_RANGE,ARCH_HAS_HUGETLB_FREE_PGD_RANGE,ARCH_HAS_PREPARE_HUGEPAGE_RANGE,ARCH_HAS_SETCLEAR_HUGE_PTEandARCH_HAS_HUGETLB_PREFAULT_HOOK.Getting rid of the
ARCH_HAS_xxx#ifdef and macro fugliness should increase readability and maintainability, at the price of some code duplication. An asm-generic common part would have reduced the loc, but we would end up with newARCH_HAS_xxxdefines eventually.Signed-off-by Gerald Schaefer <[email protected]>---
Quoted 9 lines
include/asm-ia64/hugetlb.h | 37 +++++++++++++++++++++++++++++++ include/asm-ia64/page.h | 6 ----- include/asm-powerpc/hugetlb.h | 37 +++++++++++++++++++++++++++++++ include/asm-powerpc/page_64.h | 7 ------ include/asm-sh/hugetlb.h | 49 ++++++++++++++++++++++++++++++++++++++++++ include/asm-sparc64/hugetlb.h | 42 ++++++++++++++++++++++++++++++++++++ include/asm-sparc64/page.h | 2 - include/asm-x86/hugetlb.h | 49 ++++++++++++++++++++++++++++++++++++++++++ include/linux/hugetlb.h | 46 ---------------------------------------
Seem that git-s390 is currently carrying the old versions of these patches.
I'll drop git-s390. Which will presumably kick off a cascade of droppages due to git-s390 versus git-kvm damage control. All of which will need to be undropped in some fashion when those trees come to their senses. Ho hum.
Re: [PATCH 1/3] hugetlbfs: architecture header cleanup
Quoted 6 lines · Andrew Morton
Seem that git-s390 is currently carrying the old versions of these patches.
I'll drop git-s390. Which will presumably kick off a cascade of droppages due to git-s390 versus git-kvm damage control. All of which will need to be undropped in some fashion when those trees come to their senses. Ho hum.
Yes, git-s390 wasn't updated for a few days. I've dropped all the hugetlbfs patches since the version we will push upstream depends on the cleanup which will go in over -mm. I keep the fingers crossed that the git-s390 now works again.
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 2/3 hugetlbfs: add missing TLB flush to hugetlb_cow()
In reply to Gerald SchaeferSubject: [PATCH 2/3] hugetlbfs: add missing TLB flush to hugetlb_cow()
From: Gerald Schaefer <[email protected]>
A cow break on a hugetlbfs page with page_count > 1 will set a new pte with set_huge_pte_at(), w/o any tlb flush operation. The old pte will remain in the tlb and subsequent write access to the page will result in a page fault loop, for as long as it may take until the tlb is flushed from somewhere else.
This patch introduces an architecture-specific huge_ptep_clear_flush() function, which is called before the the set_huge_pte_at() in hugetlb_cow().
ATTENTION: This is just a nop on all architectures for now, the s390 implementation will come with our large page patch later. Other architectures should define their own huge_ptep_clear_flush() if needed.
---
include/asm-ia64/hugetlb.h | 5 +++++ include/asm-powerpc/hugetlb.h | 5 +++++ include/asm-sh/hugetlb.h | 5 +++++ include/asm-sparc64/hugetlb.h | 5 +++++ include/asm-x86/hugetlb.h | 5 +++++ mm/hugetlb.c | 1 + 6 files changed, 26 insertions(+)
mm/hugetlb.c +1 -0
@@ -875,6 +875,7 @@ static int hugetlb_cow(struct mm_struct ptep =huge_pte_offset (mm, address &HPAGE_MASK );if (likely (pte_same (*ptep, pte))) {/* Break COW */ +huge_ptep_clear_flush (vma, address, ptep);set_huge_pte_at (mm, address, ptep,make_huge_pte (vma, new_page,1 ));/* Make the old page be freed below */
include/asm-ia64/hugetlb.h +5 -0
@@ -34,4 +34,9 @@ static inline pte_t huge_ptep_get_and_cl return ptep_get_and_clear(mm, addr, ptep); } +static inline void huge_ptep_clear_flush (struct vm_area_struct *vma, +unsigned long addr,pte_t *ptep) +{ +} +#endif /* _ASM_IA64_HUGETLB_H */
include/asm-powerpc/hugetlb.h +5 -0
@@ -34,4 +34,9 @@ static inline void hugetlb_prefault_arch { } +static inline void huge_ptep_clear_flush (struct vm_area_struct *vma, +unsigned long addr,pte_t *ptep) +{ +} +#endif /* _ASM_POWERPC_HUGETLB_H */
include/asm-sh/hugetlb.h +5 -0
@@ -46,4 +46,9 @@ static inline pte_t huge_ptep_get_and_cl return ptep_get_and_clear(mm, addr, ptep); } +static inline void huge_ptep_clear_flush (struct vm_area_struct *vma, +unsigned long addr,pte_t *ptep) +{ +} +#endif /* _ASM_SH_HUGETLB_H */
include/asm-sparc64/hugetlb.h +5 -0
@@ -39,4 +39,9 @@ static inline void hugetlb_free_pgd_rang free_pgd_range(tlb, addr, end, floor, ceiling); } +static inline void huge_ptep_clear_flush (struct vm_area_struct *vma, +unsigned long addr,pte_t *ptep) +{ +} +#endif /* _ASM_SPARC64_HUGETLB_H */
include/asm-x86/hugetlb.h +5 -0
@@ -46,4 +46,9 @@ static inline pte_t huge_ptep_get_and_cl return ptep_get_and_clear(mm, addr, ptep); } +static inline void huge_ptep_clear_flush (struct vm_area_struct *vma, +unsigned long addr,pte_t *ptep) +{ +} +#endif /* _ASM_X86_HUGETLB_H */
PATCH 3/3 hugetlbfs: common code update for s390
In reply to Gerald SchaeferSubject: [PATCH 3/3] hugetlbfs: common code update for s390
From: Gerald Schaefer <[email protected]>
Huge ptes have a special type on s390 and cannot be handled with the standard pte functions in certain cases, e.g. because of a different location of the invalid bit. This patch adds some new architecture- specific functions to hugetlb common code, as a prerequisite for the s390 large page support.
This won't affect other architectures in functionality, but I need to add some new dummy inline functions to the headers.
---
include/asm-ia64/hugetlb.h | 37 +++++++++++++++++++++++++++++++++++++ include/asm-powerpc/hugetlb.h | 37 +++++++++++++++++++++++++++++++++++++ include/asm-sh/hugetlb.h | 37 +++++++++++++++++++++++++++++++++++++ include/asm-sparc64/hugetlb.h | 37 +++++++++++++++++++++++++++++++++++++ include/asm-x86/hugetlb.h | 37 +++++++++++++++++++++++++++++++++++++ mm/hugetlb.c | 36 +++++++++++++++++++++--------------- 6 files changed, 206 insertions(+), 15 deletions(-)
mm/hugetlb.c +21 -15
@@ -129,6 +129,7 @@ static void update_and_free_page(struct }set_compound_page_dtor (page,NULL );set_page_refcounted (page); +arch_release_hugepage (page);__free_pages (page,HUGETLB_PAGE_ORDER ); }
@@ -198,6 +199,10 @@ static struct page *alloc_fresh_huge_pag htlb_alloc_mask|__GFP_COMP|__GFP_THISNODE|__GFP_NOWARN, HUGETLB_PAGE_ORDER);if (page) { +if (arch_prepare_hugepage (page)) { +__free_pages (page,HUGETLB_PAGE_ORDER ); +return 0 ; + }set_compound_page_dtor (page, free_huge_page);spin_lock (&hugetlb_lock); nr_huge_pages++;
@@ -718,7 +723,7 @@ static pte_t make_huge_pte(struct vm_are entry =pte_mkwrite (pte_mkdirty (mk_pte (page, vma->vm_page_prot))); }else { - entry =pte_wrprotect (mk_pte (page, vma->vm_page_prot)); + entry =huge_pte_wrprotect (mk_pte (page, vma->vm_page_prot)); } entry =pte_mkyoung (entry); entry =pte_mkhuge (entry);
@@ -731,8 +736,8 @@ static void set_huge_ptep_writable(struc {pte_t entry; - entry =pte_mkwrite (pte_mkdirty (*ptep)); -if (ptep_set_access_flags (vma, address, ptep, entry,1 )) { + entry =pte_mkwrite (pte_mkdirty (huge_ptep_get (ptep))); +if (huge_ptep_set_access_flags (vma, address, ptep, entry,1 )) {update_mmu_cache (vma, address, entry); } }
@@ -762,10 +767,10 @@ int copy_hugetlb_page_range(struct mm_stspin_lock (&dst->page_table_lock);spin_lock (&src->page_table_lock); -if (!pte_none (*src_pte)) { +if (!huge_pte_none (huge_ptep_get (src_pte))) {if (cow) -ptep_set_wrprotect (src, addr, src_pte); - entry = *src_pte; +huge_ptep_set_wrprotect (src, addr, src_pte); + entry =huge_ptep_get (src_pte); ptepage =pte_page (entry);get_page (ptepage);set_huge_pte_at (dst, addr, dst_pte, entry);
@@ -809,7 +814,7 @@ void __unmap_hugepage_range(struct vm_arcontinue ; pte =huge_ptep_get_and_clear (mm, address, ptep); -if (pte_none (pte)) +if (huge_pte_none (pte))continue ; page =pte_page (pte);
@@ -873,7 +878,7 @@ static int hugetlb_cow(struct mm_structspin_lock (&mm->page_table_lock); ptep =huge_pte_offset (mm, address &HPAGE_MASK ); -if (likely (pte_same (*ptep, pte))) { +if (likely (pte_same (huge_ptep_get (ptep), pte))) {/* Break COW */ huge_ptep_clear_flush (vma, address, ptep); set_huge_pte_at(mm, address, ptep,
@@ -943,7 +948,7 @@ retry: goto backout; ret =0 ; -if (!pte_none (*ptep)) +if (!huge_pte_none (huge_ptep_get (ptep))) goto backout; new_pte = make_huge_pte(vma, page, ((vma->vm_flags & VM_WRITE)
@@ -985,8 +990,8 @@ int hugetlb_fault(struct mm_struct *mm,* the same page in the page cache. */ mutex_lock (&hugetlb_instantiation_mutex); - entry = *ptep; -if (pte_none (entry)) { + entry =huge_ptep_get (ptep); +if (huge_pte_none (entry)) { ret =hugetlb_no_page (mm, vma, address, ptep, write_access);mutex_unlock (&hugetlb_instantiation_mutex);return ret;
@@ -996,7 +1001,7 @@ int hugetlb_fault(struct mm_struct *mm,spin_lock (&mm->page_table_lock);/* Check for a racing update before calling hugetlb_cow */ -if (likely (pte_same (entry, *ptep))) +if (likely (pte_same (entry,huge_ptep_get (ptep))))if (write_access && !pte_write (entry)) ret =hugetlb_cow (mm, vma, address, ptep, entry);spin_unlock (&mm->page_table_lock);
@@ -1026,7 +1031,8 @@ int follow_hugetlb_page(struct mm_struct*/ pte =huge_pte_offset (mm, vaddr &HPAGE_MASK ); -if (!pte ||pte_none (*pte) || (write && !pte_write (*pte))) { +if (!pte ||huge_pte_none (huge_ptep_get (pte)) || + (write && !pte_write (huge_ptep_get (pte)))) {int ret;spin_unlock (&mm->page_table_lock);
@@ -1042,7 +1048,7 @@ int follow_hugetlb_page(struct mm_struct } pfn_offset = (vaddr & ~HPAGE_MASK ) >>PAGE_SHIFT ; - page =pte_page (*pte); + page =pte_page (huge_ptep_get (pte)); same_page:if (pages) {get_page (page);
@@ -1091,7 +1097,7 @@ void hugetlb_change_protection(struct vmcontinue ;if (huge_pmd_unshare (mm, &address, ptep))continue ; -if (!pte_none (*ptep)) { +if (!huge_pte_none (huge_ptep_get (ptep))) { pte =huge_ptep_get_and_clear (mm, address, ptep); pte =pte_mkhuge (pte_modify (pte, newprot));set_huge_pte_at (mm, address, ptep, pte);
include/asm-ia64/hugetlb.h +37 -0
@@ -39,4 +39,41 @@ static inline void huge_ptep_clear_flush { } +static inline int huge_pte_none (pte_t pte) +{ +return pte_none (pte); +} + +static inline pte_t huge_pte_wrprotect (pte_t pte) +{ +return pte_wrprotect (pte); +} + +static inline void huge_ptep_set_wrprotect (struct mm_struct *mm, +unsigned long addr,pte_t *ptep) +{ +ptep_set_wrprotect (mm, addr, ptep); +} + +static inline int huge_ptep_set_access_flags (struct vm_area_struct *vma, +unsigned long addr,pte_t *ptep, +pte_t pte,int dirty) +{ +return ptep_set_access_flags (vma, addr, ptep, pte, dirty); +} + +static inline pte_t huge_ptep_get (pte_t *ptep) +{ +return *ptep; +} + +static inline int arch_prepare_hugepage (struct page *page) +{ +return 0 ; +} + +static inline void arch_release_hugepage (struct page *page) +{ +} +#endif /* _ASM_IA64_HUGETLB_H */
include/asm-powerpc/hugetlb.h +37 -0
@@ -39,4 +39,41 @@ static inline void huge_ptep_clear_flush { } +static inline int huge_pte_none (pte_t pte) +{ +return pte_none (pte); +} + +static inline pte_t huge_pte_wrprotect (pte_t pte) +{ +return pte_wrprotect (pte); +} + +static inline void huge_ptep_set_wrprotect (struct mm_struct *mm, +unsigned long addr,pte_t *ptep) +{ +ptep_set_wrprotect (mm, addr, ptep); +} + +static inline int huge_ptep_set_access_flags (struct vm_area_struct *vma, +unsigned long addr,pte_t *ptep, +pte_t pte,int dirty) +{ +return ptep_set_access_flags (vma, addr, ptep, pte, dirty); +} + +static inline pte_t huge_ptep_get (pte_t *ptep) +{ +return *ptep; +} + +static inline int arch_prepare_hugepage (struct page *page) +{ +return 0 ; +} + +static inline void arch_release_hugepage (struct page *page) +{ +} +#endif /* _ASM_POWERPC_HUGETLB_H */
include/asm-sh/hugetlb.h +37 -0
@@ -51,4 +51,41 @@ static inline void huge_ptep_clear_flush { } +static inline int huge_pte_none (pte_t pte) +{ +return pte_none (pte); +} + +static inline pte_t huge_pte_wrprotect (pte_t pte) +{ +return pte_wrprotect (pte); +} + +static inline void huge_ptep_set_wrprotect (struct mm_struct *mm, +unsigned long addr,pte_t *ptep) +{ +ptep_set_wrprotect (mm, addr, ptep); +} + +static inline int huge_ptep_set_access_flags (struct vm_area_struct *vma, +unsigned long addr,pte_t *ptep, +pte_t pte,int dirty) +{ +return ptep_set_access_flags (vma, addr, ptep, pte, dirty); +} + +static inline pte_t huge_ptep_get (pte_t *ptep) +{ +return *ptep; +} + +static inline int arch_prepare_hugepage (struct page *page) +{ +return 0 ; +} + +static inline void arch_release_hugepage (struct page *page) +{ +} +#endif /* _ASM_SH_HUGETLB_H */
include/asm-sparc64/hugetlb.h +37 -0
@@ -44,4 +44,41 @@ static inline void huge_ptep_clear_flush { } +static inline int huge_pte_none (pte_t pte) +{ +return pte_none (pte); +} + +static inline pte_t huge_pte_wrprotect (pte_t pte) +{ +return pte_wrprotect (pte); +} + +static inline void huge_ptep_set_wrprotect (struct mm_struct *mm, +unsigned long addr,pte_t *ptep) +{ +ptep_set_wrprotect (mm, addr, ptep); +} + +static inline int huge_ptep_set_access_flags (struct vm_area_struct *vma, +unsigned long addr,pte_t *ptep, +pte_t pte,int dirty) +{ +return ptep_set_access_flags (vma, addr, ptep, pte, dirty); +} + +static inline pte_t huge_ptep_get (pte_t *ptep) +{ +return *ptep; +} + +static inline int arch_prepare_hugepage (struct page *page) +{ +return 0 ; +} + +static inline void arch_release_hugepage (struct page *page) +{ +} +#endif /* _ASM_SPARC64_HUGETLB_H */
include/asm-x86/hugetlb.h +37 -0
@@ -51,4 +51,41 @@ static inline void huge_ptep_clear_flush { } +static inline int huge_pte_none (pte_t pte) +{ +return pte_none (pte); +} + +static inline pte_t huge_pte_wrprotect (pte_t pte) +{ +return pte_wrprotect (pte); +} + +static inline void huge_ptep_set_wrprotect (struct mm_struct *mm, +unsigned long addr,pte_t *ptep) +{ +ptep_set_wrprotect (mm, addr, ptep); +} + +static inline int huge_ptep_set_access_flags (struct vm_area_struct *vma, +unsigned long addr,pte_t *ptep, +pte_t pte,int dirty) +{ +return ptep_set_access_flags (vma, addr, ptep, pte, dirty); +} + +static inline pte_t huge_ptep_get (pte_t *ptep) +{ +return *ptep; +} + +static inline int arch_prepare_hugepage (struct page *page) +{ +return 0 ; +} + +static inline void arch_release_hugepage (struct page *page) +{ +} +#endif /* _ASM_X86_HUGETLB_H */