History

Merge tag 'drm-next-2020-04-03-1' of git://anongit.freedesktop.org/drm/drm

Pull drm hugepage support from Dave Airlie: "This adds support for hugepages to TTM and has been tested with the vmwgfx drivers, though I expect other drivers to start using it" * tag 'drm-next-2020-04-03-1' of git://anongit.freedesktop.org/drm/drm: drm/vmwgfx: Hook up the helpers to align buffer objects drm/vmwgfx: Introduce a huge page aligning TTM range manager drm: Add a drm_get_unmapped_area() helper drm/vmwgfx: Support huge page faults drm/ttm, drm/vmwgfx: Support huge TTM pagefaults mm: Add vmf_insert_pfn_xxx_prot() for huge page-table entries mm: Split huge pages on write-notify or COW mm: Introduce vma_is_special_huge fs: Constify vma argument to vma_is_dax

Linus Torvalds committed 6 years ago

Commit ea9448b2 parents 83eb69f 0e7e61916 files · +692 −28Browse files

Showing the changes to include/linux (3 of 16 files). Show all

Unified · Split

3 files
  1. include/linux/fs.h +1 −1
  2. include/linux/huge_mm.h +39 −2
  3. include/linux/mm.h +17 −0
include/linux/fs.h+1−1
@@ -3399,7 +3399,7 @@ static inline bool io_is_direct(struct file *filp) · 3398 unmodified lines
3399 return (filp->f_flags & O_DIRECT) || IS_DAX(filp->f_mapping->host);3399 return (filp->f_flags & O_DIRECT) || IS_DAX(filp->f_mapping->host);
3400}3400}
3401 3401
3402static inline bool vma_is_dax(struct vm_area_struct *vma)3402static inline bool vma_is_dax(const struct vm_area_struct *vma)
3403{3403{
3404 return vma->vm_file && IS_DAX(vma->vm_file->f_mapping->host);3404 return vma->vm_file && IS_DAX(vma->vm_file->f_mapping->host);
3405}3405}
include/linux/huge_mm.h+39−2
@@ -47,8 +47,45 @@ extern bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr, · 46 unmodified lines
47extern int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,47extern int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
48 unsigned long addr, pgprot_t newprot,48 unsigned long addr, pgprot_t newprot,
49 int prot_numa);49 int prot_numa);
50vm_fault_t vmf_insert_pfn_pmd(struct vm_fault *vmf, pfn_t pfn, bool write);50vm_fault_t vmf_insert_pfn_pmd_prot(struct vm_fault *vmf, pfn_t pfn,
51vm_fault_t vmf_insert_pfn_pud(struct vm_fault *vmf, pfn_t pfn, bool write);51 pgprot_t pgprot, bool write);
52
53/**
54 * vmf_insert_pfn_pmd - insert a pmd size pfn
55 * @vmf: Structure describing the fault
56 * @pfn: pfn to insert
57 * @pgprot: page protection to use
58 * @write: whether it's a write fault
59 *
60 * Insert a pmd size pfn. See vmf_insert_pfn() for additional info.
61 *
62 * Return: vm_fault_t value.
63 */
64static inline vm_fault_t vmf_insert_pfn_pmd(struct vm_fault *vmf, pfn_t pfn,
65 bool write)
66{
67 return vmf_insert_pfn_pmd_prot(vmf, pfn, vmf->vma->vm_page_prot, write);
68}
69vm_fault_t vmf_insert_pfn_pud_prot(struct vm_fault *vmf, pfn_t pfn,
70 pgprot_t pgprot, bool write);
71
72/**
73 * vmf_insert_pfn_pud - insert a pud size pfn
74 * @vmf: Structure describing the fault
75 * @pfn: pfn to insert
76 * @pgprot: page protection to use
77 * @write: whether it's a write fault
78 *
79 * Insert a pud size pfn. See vmf_insert_pfn() for additional info.
80 *
81 * Return: vm_fault_t value.
82 */
83static inline vm_fault_t vmf_insert_pfn_pud(struct vm_fault *vmf, pfn_t pfn,
84 bool write)
85{
86 return vmf_insert_pfn_pud_prot(vmf, pfn, vmf->vma->vm_page_prot, write);
87}
88
52enum transparent_hugepage_flag {89enum transparent_hugepage_flag {
53 TRANSPARENT_HUGEPAGE_FLAG,90 TRANSPARENT_HUGEPAGE_FLAG,
54 TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,91 TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,
include/linux/mm.h+17−0
@@ -3014,6 +3014,23 @@ extern long copy_huge_page_from_user(struct page *dst_page, · 3013 unmodified lines
3014 const void __user *usr_src,3014 const void __user *usr_src,
3015 unsigned int pages_per_huge_page,3015 unsigned int pages_per_huge_page,
3016 bool allow_pagefault);3016 bool allow_pagefault);
3017
3018/**
3019 * vma_is_special_huge - Are transhuge page-table entries considered special?
3020 * @vma: Pointer to the struct vm_area_struct to consider
3021 *
3022 * Whether transhuge page-table entries are considered "special" following
3023 * the definition in vm_normal_page().
3024 *
3025 * Return: true if transhuge page-table entries should be considered special,
3026 * false otherwise.
3027 */
3028static inline bool vma_is_special_huge(const struct vm_area_struct *vma)
3029{
3030 return vma_is_dax(vma) || (vma->vm_file &&
3031 (vma->vm_flags & (VM_PFNMAP | VM_MIXEDMAP)));
3032}
3033
3017#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */3034#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */
3018 3035
3019#ifdef CONFIG_DEBUG_PAGEALLOC3036#ifdef CONFIG_DEBUG_PAGEALLOC