Skip to content

Commit 9030fb0

Browse files
committed
Merge tag 'folio-5.18c' of git://git.infradead.org/users/willy/pagecache
Pull folio updates from Matthew Wilcox: - Rewrite how munlock works to massively reduce the contention on i_mmap_rwsem (Hugh Dickins): https://lore.kernel.org/linux-mm/[email protected]/ - Sort out the page refcount mess for ZONE_DEVICE pages (Christoph Hellwig): https://lore.kernel.org/linux-mm/[email protected]/ - Convert GUP to use folios and make pincount available for order-1 pages. (Matthew Wilcox) - Convert a few more truncation functions to use folios (Matthew Wilcox) - Convert page_vma_mapped_walk to use PFNs instead of pages (Matthew Wilcox) - Convert rmap_walk to use folios (Matthew Wilcox) - Convert most of shrink_page_list() to use a folio (Matthew Wilcox) - Add support for creating large folios in readahead (Matthew Wilcox) * tag 'folio-5.18c' of git://git.infradead.org/users/willy/pagecache: (114 commits) mm/damon: minor cleanup for damon_pa_young selftests/vm/transhuge-stress: Support file-backed PMD folios mm/filemap: Support VM_HUGEPAGE for file mappings mm/readahead: Switch to page_cache_ra_order mm/readahead: Align file mappings for non-DAX mm/readahead: Add large folio readahead mm: Support arbitrary THP sizes mm: Make large folios depend on THP mm: Fix READ_ONLY_THP warning mm/filemap: Allow large folios to be added to the page cache mm: Turn can_split_huge_page() into can_split_folio() mm/vmscan: Convert pageout() to take a folio mm/vmscan: Turn page_check_references() into folio_check_references() mm/vmscan: Account large folios correctly mm/vmscan: Optimise shrink_page_list for non-PMD-sized folios mm/vmscan: Free non-shmem folios without splitting them mm/rmap: Constify the rmap_walk_control argument mm/rmap: Convert rmap_walk() to take a folio mm: Turn page_anon_vma() into folio_anon_vma() mm/rmap: Turn page_lock_anon_vma_read() into folio_lock_anon_vma_read() ...
2 parents 3bf03b9 + 2a3c4bc commit 9030fb0

File tree

100 files changed

+2900
-3020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+2900
-3020
lines changed

Documentation/core-api/pin_user_pages.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ flags the caller provides. The caller is required to pass in a non-null struct
5555
pages* array, and the function then pins pages by incrementing each by a special
5656
value: GUP_PIN_COUNTING_BIAS.
5757

58-
For huge pages (and in fact, any compound page of more than 2 pages), the
59-
GUP_PIN_COUNTING_BIAS scheme is not used. Instead, an exact form of pin counting
60-
is achieved, by using the 3rd struct page in the compound page. A new struct
61-
page field, hpage_pinned_refcount, has been added in order to support this.
58+
For compound pages, the GUP_PIN_COUNTING_BIAS scheme is not used. Instead,
59+
an exact form of pin counting is achieved, by using the 2nd struct page
60+
in the compound page. A new struct page field, compound_pincount, has
61+
been added in order to support this.
6262

6363
This approach for compound pages avoids the counting upper limit problems that
6464
are discussed below. Those limitations would have been aggravated severely by
6565
huge pages, because each tail page adds a refcount to the head page. And in
66-
fact, testing revealed that, without a separate hpage_pinned_refcount field,
66+
fact, testing revealed that, without a separate compound_pincount field,
6767
page overflows were seen in some huge page stress tests.
6868

69-
This also means that huge pages and compound pages (of order > 1) do not suffer
69+
This also means that huge pages and compound pages do not suffer
7070
from the false positives problem that is mentioned below.::
7171

7272
Function
@@ -264,9 +264,9 @@ place.)
264264
Other diagnostics
265265
=================
266266

267-
dump_page() has been enhanced slightly, to handle these new counting fields, and
268-
to better report on compound pages in general. Specifically, for compound pages
269-
with order > 1, the exact (hpage_pinned_refcount) pincount is reported.
267+
dump_page() has been enhanced slightly, to handle these new counting
268+
fields, and to better report on compound pages in general. Specifically,
269+
for compound pages, the exact (compound_pincount) pincount is reported.
270270

271271
References
272272
==========

arch/alpha/include/asm/pgtable.h

+1
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ pmd_page_vaddr(pmd_t pmd)
233233
return ((pmd_val(pmd) & _PFN_MASK) >> (32-PAGE_SHIFT)) + PAGE_OFFSET;
234234
}
235235

236+
#define pmd_pfn(pmd) (pmd_val(pmd) >> 32)
236237
#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> 32))
237238
#define pud_page(pud) (pfn_to_page(pud_val(pud) >> 32))
238239

arch/arc/include/asm/hugepage.h

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ static inline pmd_t pte_pmd(pte_t pte)
3131

3232
#define pmd_write(pmd) pte_write(pmd_pte(pmd))
3333
#define pmd_young(pmd) pte_young(pmd_pte(pmd))
34-
#define pmd_pfn(pmd) pte_pfn(pmd_pte(pmd))
3534
#define pmd_dirty(pmd) pte_dirty(pmd_pte(pmd))
3635

3736
#define mk_pmd(page, prot) pte_pmd(mk_pte(page, prot))

arch/arc/include/asm/pgtable-levels.h

+1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@
161161
#define pmd_present(x) (pmd_val(x))
162162
#define pmd_clear(xp) do { pmd_val(*(xp)) = 0; } while (0)
163163
#define pmd_page_vaddr(pmd) (pmd_val(pmd) & PAGE_MASK)
164+
#define pmd_pfn(pmd) ((pmd_val(pmd) & PAGE_MASK) >> PAGE_SHIFT)
164165
#define pmd_page(pmd) virt_to_page(pmd_page_vaddr(pmd))
165166
#define set_pmd(pmdp, pmd) (*(pmdp) = pmd)
166167
#define pmd_pgtable(pmd) ((pgtable_t) pmd_page_vaddr(pmd))

arch/arm/include/asm/pgtable-2level.h

+2
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
208208
}
209209
#define pmd_offset pmd_offset
210210

211+
#define pmd_pfn(pmd) (__phys_to_pfn(pmd_val(pmd) & PHYS_MASK))
212+
211213
#define pmd_large(pmd) (pmd_val(pmd) & 2)
212214
#define pmd_leaf(pmd) (pmd_val(pmd) & 2)
213215
#define pmd_bad(pmd) (pmd_val(pmd) & 2)

arch/arm64/mm/mmu.c

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/mman.h>
1818
#include <linux/nodemask.h>
1919
#include <linux/memblock.h>
20+
#include <linux/memremap.h>
2021
#include <linux/memory.h>
2122
#include <linux/fs.h>
2223
#include <linux/io.h>

arch/csky/include/asm/pgtable.h

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define pgd_ERROR(e) \
3131
pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
3232

33+
#define pmd_pfn(pmd) (pmd_phys(pmd) >> PAGE_SHIFT)
3334
#define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
3435
#define pte_clear(mm, addr, ptep) set_pte((ptep), \
3536
(((unsigned int) addr >= PAGE_OFFSET) ? __pte(_PAGE_GLOBAL) : __pte(0)))

arch/hexagon/include/asm/pgtable.h

+5
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ static inline int pmd_bad(pmd_t pmd)
235235
return 0;
236236
}
237237

238+
/*
239+
* pmd_pfn - converts a PMD entry to a page frame number
240+
*/
241+
#define pmd_pfn(pmd) (pmd_val(pmd) >> PAGE_SHIFT)
242+
238243
/*
239244
* pmd_page - converts a PMD entry to a page pointer
240245
*/

arch/ia64/include/asm/pgtable.h

+1
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ ia64_phys_addr_valid (unsigned long addr)
267267
#define pmd_present(pmd) (pmd_val(pmd) != 0UL)
268268
#define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0UL)
269269
#define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val(pmd) & _PFN_MASK))
270+
#define pmd_pfn(pmd) ((pmd_val(pmd) & _PFN_MASK) >> PAGE_SHIFT)
270271
#define pmd_page(pmd) virt_to_page((pmd_val(pmd) + PAGE_OFFSET))
271272

272273
#define pud_none(pud) (!pud_val(pud))

arch/m68k/include/asm/mcf_pgtable.h

+1
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ extern pgd_t kernel_pg_dir[PTRS_PER_PGD];
322322
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
323323
#define __swp_entry_to_pte(x) (__pte((x).val))
324324

325+
#define pmd_pfn(pmd) (pmd_val(pmd) >> PAGE_SHIFT)
325326
#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
326327

327328
#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))

arch/m68k/include/asm/motorola_pgtable.h

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ static inline void pud_set(pud_t *pudp, pmd_t *pmdp)
147147
#define pmd_present(pmd) (pmd_val(pmd) & _PAGE_TABLE)
148148
#define pmd_clear(pmdp) ({ pmd_val(*pmdp) = 0; })
149149

150+
#define pmd_pfn(pmd) ((pmd_val(pmd) & _TABLE_MASK) >> PAGE_SHIFT)
150151
/*
151152
* m68k does not have huge pages (020/030 actually could), but generic code
152153
* expects pmd_page() to exists, only to then DCE it all. Provide a dummy to

arch/m68k/include/asm/sun3_pgtable.h

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ static inline void pte_clear (struct mm_struct *mm, unsigned long addr, pte_t *p
130130
({ pte_t __pte; pte_val(__pte) = pfn | pgprot_val(pgprot); __pte; })
131131

132132
#define pte_page(pte) virt_to_page(__pte_page(pte))
133+
#define pmd_pfn(pmd) (pmd_val(pmd) >> PAGE_SHIFT)
133134
#define pmd_page(pmd) virt_to_page(pmd_page_vaddr(pmd))
134135

135136

arch/microblaze/include/asm/pgtable.h

+3
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,9 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd)
399399
return ((unsigned long) (pmd_val(pmd) & PAGE_MASK));
400400
}
401401

402+
/* returns pfn of the pmd entry*/
403+
#define pmd_pfn(pmd) (__pa(pmd_val(pmd)) >> PAGE_SHIFT)
404+
402405
/* returns struct *page of the pmd entry*/
403406
#define pmd_page(pmd) (pfn_to_page(__pa(pmd_val(pmd)) >> PAGE_SHIFT))
404407

arch/mips/include/asm/pgtable.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ extern void paging_init(void);
8686
*/
8787
#define pmd_phys(pmd) virt_to_phys((void *)pmd_val(pmd))
8888

89+
static inline unsigned long pmd_pfn(pmd_t pmd)
90+
{
91+
return pmd_val(pmd) >> _PFN_SHIFT;
92+
}
93+
8994
#ifndef CONFIG_MIPS_HUGE_TLB_SUPPORT
9095
#define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
9196
#endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */
@@ -422,11 +427,6 @@ static inline int pmd_write(pmd_t pmd)
422427
return !!(pmd_val(pmd) & _PAGE_WRITE);
423428
}
424429

425-
static inline unsigned long pmd_pfn(pmd_t pmd)
426-
{
427-
return pmd_val(pmd) >> _PFN_SHIFT;
428-
}
429-
430430
static inline struct page *pmd_page(pmd_t pmd)
431431
{
432432
if (pmd_val(pmd) & _PAGE_HUGE)

arch/nds32/include/asm/pgtable.h

+1
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ static inline pmd_t __mk_pmd(pte_t * ptep, unsigned long prot)
308308
return pmd;
309309
}
310310

311+
#define pmd_pfn(pmd) (pmd_val(pmd) >> PAGE_SHIFT)
311312
#define pmd_page(pmd) virt_to_page(__va(pmd_val(pmd)))
312313

313314
/*

arch/nios2/include/asm/pgtable.h

+1
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ static inline void pte_clear(struct mm_struct *mm,
235235
* and a page entry and page directory to the page they refer to.
236236
*/
237237
#define pmd_phys(pmd) virt_to_phys((void *)pmd_val(pmd))
238+
#define pmd_pfn(pmd) (pmd_phys(pmd) >> PAGE_SHIFT)
238239
#define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
239240

240241
static inline unsigned long pmd_page_vaddr(pmd_t pmd)

arch/openrisc/include/asm/pgtable.h

+1
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep)
361361
pmd_val(*pmdp) = _KERNPG_TABLE | (unsigned long) ptep;
362362
}
363363

364+
#define pmd_pfn(pmd) (pmd_val(pmd) >> PAGE_SHIFT)
364365
#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
365366

366367
static inline unsigned long pmd_page_vaddr(pmd_t pmd)

arch/parisc/include/asm/pgtable.h

+1
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd)
408408
return ((unsigned long) __va(pmd_address(pmd)));
409409
}
410410

411+
#define pmd_pfn(pmd) (pmd_address(pmd) >> PAGE_SHIFT)
411412
#define __pmd_page(pmd) ((unsigned long) __va(pmd_address(pmd)))
412413
#define pmd_page(pmd) virt_to_page((void *)__pmd_page(pmd))
413414

arch/powerpc/include/asm/book3s/32/pgtable.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma,
372372
#define __HAVE_ARCH_PTE_SAME
373373
#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HASHPTE) == 0)
374374

375-
#define pmd_page(pmd) \
376-
pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)
375+
#define pmd_pfn(pmd) (pmd_val(pmd) >> PAGE_SHIFT)
376+
#define pmd_page(pmd) pfn_to_page(pmd_pfn(pmd))
377377

378378
/*
379379
* Encode and decode a swap entry.

arch/powerpc/include/asm/mmu_context.h

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ extern void destroy_context(struct mm_struct *mm);
2121
#ifdef CONFIG_SPAPR_TCE_IOMMU
2222
struct mm_iommu_table_group_mem_t;
2323

24-
extern int isolate_lru_page(struct page *page); /* from internal.h */
2524
extern bool mm_iommu_preregistered(struct mm_struct *mm);
2625
extern long mm_iommu_new(struct mm_struct *mm,
2726
unsigned long ua, unsigned long entries,

arch/powerpc/include/asm/nohash/32/pgtable.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -349,15 +349,14 @@ static inline int pte_young(pte_t pte)
349349
* of the pte page. -- paulus
350350
*/
351351
#ifndef CONFIG_BOOKE
352-
#define pmd_page(pmd) \
353-
pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)
352+
#define pmd_pfn(pmd) (pmd_val(pmd) >> PAGE_SHIFT)
354353
#else
355354
#define pmd_page_vaddr(pmd) \
356355
((unsigned long)(pmd_val(pmd) & ~(PTE_TABLE_SIZE - 1)))
357-
#define pmd_page(pmd) \
358-
pfn_to_page((__pa(pmd_val(pmd)) >> PAGE_SHIFT))
356+
#define pmd_pfn(pmd) (__pa(pmd_val(pmd)) >> PAGE_SHIFT)
359357
#endif
360358

359+
#define pmd_page(pmd) pfn_to_page(pmd_pfn(pmd))
361360
/*
362361
* Encode and decode a swap entry.
363362
* Note that the bits we use in a PTE for representing a swap entry

arch/powerpc/include/asm/nohash/64/pgtable.h

+1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ static inline pte_t pmd_pte(pmd_t pmd)
142142
#define pmd_present(pmd) (!pmd_none(pmd))
143143
#define pmd_page_vaddr(pmd) (pmd_val(pmd) & ~PMD_MASKED_BITS)
144144
extern struct page *pmd_page(pmd_t pmd);
145+
#define pmd_pfn(pmd) (page_to_pfn(pmd_page(pmd)))
145146

146147
static inline void pud_set(pud_t *pudp, unsigned long val)
147148
{

arch/powerpc/kvm/book3s_hv_uvmem.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
#include <linux/kvm_host.h>
9292
#include <linux/ksm.h>
9393
#include <linux/of.h>
94+
#include <linux/memremap.h>
9495
#include <asm/ultravisor.h>
9596
#include <asm/mman.h>
9697
#include <asm/kvm_ppc.h>
@@ -712,7 +713,6 @@ static struct page *kvmppc_uvmem_get_page(unsigned long gpa, struct kvm *kvm)
712713

713714
dpage = pfn_to_page(uvmem_pfn);
714715
dpage->zone_device_data = pvt;
715-
get_page(dpage);
716716
lock_page(dpage);
717717
return dpage;
718718
out_clear:

arch/powerpc/mm/book3s64/pgtable.c

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <linux/sched.h>
77
#include <linux/mm_types.h>
88
#include <linux/memblock.h>
9+
#include <linux/memremap.h>
910
#include <linux/debugfs.h>
1011
#include <misc/cxl-base.h>
1112

arch/sh/include/asm/pgtable_32.h

+1
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd)
406406
return (unsigned long)pmd_val(pmd);
407407
}
408408

409+
#define pmd_pfn(pmd) (__pa(pmd_val(pmd)) >> PAGE_SHIFT)
409410
#define pmd_page(pmd) (virt_to_page(pmd_val(pmd)))
410411

411412
#ifdef CONFIG_X2TLB

arch/sparc/include/asm/pgtable_32.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,16 @@ static inline int srmmu_device_memory(unsigned long x)
127127
return ((x & 0xF0000000) != 0);
128128
}
129129

130+
static inline unsigned long pmd_pfn(pmd_t pmd)
131+
{
132+
return (pmd_val(pmd) & SRMMU_PTD_PMASK) >> (PAGE_SHIFT-4);
133+
}
134+
130135
static inline struct page *pmd_page(pmd_t pmd)
131136
{
132137
if (srmmu_device_memory(pmd_val(pmd)))
133138
BUG();
134-
return pfn_to_page((pmd_val(pmd) & SRMMU_PTD_PMASK) >> (PAGE_SHIFT-4));
139+
return pfn_to_page(pmd_pfn(pmd));
135140
}
136141

137142
static inline unsigned long __pmd_page(pmd_t pmd)

arch/um/include/asm/pgtable.h

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ extern unsigned long end_iomem;
109109
#define p4d_newpage(x) (p4d_val(x) & _PAGE_NEWPAGE)
110110
#define p4d_mkuptodate(x) (p4d_val(x) &= ~_PAGE_NEWPAGE)
111111

112+
#define pmd_pfn(pmd) (pmd_val(pmd) >> PAGE_SHIFT)
112113
#define pmd_page(pmd) phys_to_page(pmd_val(pmd) & PAGE_MASK)
113114

114115
#define pte_page(x) pfn_to_page(pte_pfn(x))

arch/xtensa/include/asm/pgtable.h

+1
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ static inline void paging_init(void) { }
241241
* The pmd contains the kernel virtual address of the pte page.
242242
*/
243243
#define pmd_page_vaddr(pmd) ((unsigned long)(pmd_val(pmd) & PAGE_MASK))
244+
#define pmd_pfn(pmd) (__pa(pmd_val(pmd)) >> PAGE_SHIFT)
244245
#define pmd_page(pmd) virt_to_page(pmd_val(pmd))
245246

246247
/*

drivers/block/xen-blkback/xenbus.c

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include <linux/module.h>
1212
#include <linux/kthread.h>
13+
#include <linux/pagemap.h>
1314
#include <xen/events.h>
1415
#include <xen/grant_table.h>
1516
#include "common.h"

drivers/gpu/drm/amd/amdkfd/kfd_migrate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/hmm.h>
2525
#include <linux/dma-direction.h>
2626
#include <linux/dma-mapping.h>
27+
#include <linux/migrate.h>
2728
#include "amdgpu_sync.h"
2829
#include "amdgpu_object.h"
2930
#include "amdgpu_vm.h"
@@ -224,7 +225,6 @@ svm_migrate_get_vram_page(struct svm_range *prange, unsigned long pfn)
224225
page = pfn_to_page(pfn);
225226
svm_range_bo_ref(prange->svm_bo);
226227
page->zone_device_data = prange->svm_bo;
227-
get_page(page);
228228
lock_page(page);
229229
}
230230

drivers/gpu/drm/amd/amdkfd/kfd_priv.h

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include <linux/hashtable.h>
2727
#include <linux/mmu_notifier.h>
28+
#include <linux/memremap.h>
2829
#include <linux/mutex.h>
2930
#include <linux/types.h>
3031
#include <linux/atomic.h>

drivers/gpu/drm/drm_cache.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
/*
2828
* Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
2929
*/
30-
3130
#include <linux/dma-buf-map.h>
3231
#include <linux/export.h>
3332
#include <linux/highmem.h>
3433
#include <linux/cc_platform.h>
34+
#include <linux/ioport.h>
3535
#include <xen/xen.h>
3636

3737
#include <drm/drm_cache.h>

drivers/gpu/drm/nouveau/nouveau_dmem.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939

4040
#include <linux/sched/mm.h>
4141
#include <linux/hmm.h>
42+
#include <linux/memremap.h>
43+
#include <linux/migrate.h>
4244

4345
/*
4446
* FIXME: this is ugly right now we are using TTM to allocate vram and we pin
@@ -324,7 +326,6 @@ nouveau_dmem_page_alloc_locked(struct nouveau_drm *drm)
324326
return NULL;
325327
}
326328

327-
get_page(page);
328329
lock_page(page);
329330
return page;
330331
}

drivers/gpu/drm/nouveau/nouveau_svm.c

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <linux/sched/mm.h>
3636
#include <linux/sort.h>
3737
#include <linux/hmm.h>
38+
#include <linux/memremap.h>
3839
#include <linux/rmap.h>
3940

4041
struct nouveau_svm {

drivers/infiniband/core/rw.c

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/*
33
* Copyright (c) 2016 HGST, a Western Digital Company.
44
*/
5+
#include <linux/memremap.h>
56
#include <linux/moduleparam.h>
67
#include <linux/slab.h>
78
#include <linux/pci-p2pdma.h>

drivers/nvdimm/pmem.h

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#define __NVDIMM_PMEM_H__
44
#include <linux/page-flags.h>
55
#include <linux/badblocks.h>
6+
#include <linux/memremap.h>
67
#include <linux/types.h>
78
#include <linux/pfn_t.h>
89
#include <linux/fs.h>

0 commit comments

Comments
 (0)