mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 22:22:08 +02:00
mm/rmap: pass vma to __folio_add_rmap()
We'll need access to the destination MM when modifying the mapcount large folios next. So pass in the VMA. Link: https://lkml.kernel.org/r/20250303163014.1128035-9-david@redhat.com Signed-off-by: David Hildenbrand <david@redhat.com> Cc: Andy Lutomirks^H^Hski <luto@kernel.org> Cc: Borislav Betkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jann Horn <jannh@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Lance Yang <ioworker0@gmail.com> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Matthew Wilcow (Oracle) <willy@infradead.org> Cc: Michal Koutn <mkoutny@suse.com> Cc: Muchun Song <muchun.song@linux.dev> Cc: tejun heo <tj@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Zefan Li <lizefan.x@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
405c4ef769
commit
1862a4af10
|
|
@ -1242,8 +1242,8 @@ int pfn_mkclean_range(unsigned long pfn, unsigned long nr_pages, pgoff_t pgoff,
|
|||
}
|
||||
|
||||
static __always_inline unsigned int __folio_add_rmap(struct folio *folio,
|
||||
struct page *page, int nr_pages, enum rmap_level level,
|
||||
int *nr_pmdmapped)
|
||||
struct page *page, int nr_pages, struct vm_area_struct *vma,
|
||||
enum rmap_level level, int *nr_pmdmapped)
|
||||
{
|
||||
atomic_t *mapped = &folio->_nr_pages_mapped;
|
||||
const int orig_nr_pages = nr_pages;
|
||||
|
|
@ -1411,7 +1411,7 @@ static __always_inline void __folio_add_anon_rmap(struct folio *folio,
|
|||
|
||||
VM_WARN_ON_FOLIO(!folio_test_anon(folio), folio);
|
||||
|
||||
nr = __folio_add_rmap(folio, page, nr_pages, level, &nr_pmdmapped);
|
||||
nr = __folio_add_rmap(folio, page, nr_pages, vma, level, &nr_pmdmapped);
|
||||
|
||||
if (likely(!folio_test_ksm(folio)))
|
||||
__page_check_anon_rmap(folio, page, vma, address);
|
||||
|
|
@ -1582,7 +1582,7 @@ static __always_inline void __folio_add_file_rmap(struct folio *folio,
|
|||
|
||||
VM_WARN_ON_FOLIO(folio_test_anon(folio), folio);
|
||||
|
||||
nr = __folio_add_rmap(folio, page, nr_pages, level, &nr_pmdmapped);
|
||||
nr = __folio_add_rmap(folio, page, nr_pages, vma, level, &nr_pmdmapped);
|
||||
__folio_mod_stat(folio, nr, nr_pmdmapped);
|
||||
|
||||
/* See comments in folio_add_anon_rmap_*() */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user