Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: memory: use folio in struct copy_subpage_arg

Directly use folio in struct copy_subpage_arg.

Link: https://lkml.kernel.org/r/20240618091242.2140164-3-wangkefeng.wang@huawei.com
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Muchun Song <muchun.song@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Kefeng Wang and committed by
Andrew Morton
5132633e 78fefd04

+6 -6
+6 -6
mm/memory.c
··· 6500 6500 } 6501 6501 6502 6502 struct copy_subpage_arg { 6503 - struct page *dst; 6504 - struct page *src; 6503 + struct folio *dst; 6504 + struct folio *src; 6505 6505 struct vm_area_struct *vma; 6506 6506 }; 6507 6507 6508 6508 static int copy_subpage(unsigned long addr, int idx, void *arg) 6509 6509 { 6510 6510 struct copy_subpage_arg *copy_arg = arg; 6511 - struct page *dst = nth_page(copy_arg->dst, idx); 6512 - struct page *src = nth_page(copy_arg->src, idx); 6511 + struct page *dst = folio_page(copy_arg->dst, idx); 6512 + struct page *src = folio_page(copy_arg->src, idx); 6513 6513 6514 6514 if (copy_mc_user_highpage(dst, src, addr, copy_arg->vma)) { 6515 6515 memory_failure_queue(page_to_pfn(src), 0); ··· 6525 6525 unsigned long addr = addr_hint & 6526 6526 ~(((unsigned long)pages_per_huge_page << PAGE_SHIFT) - 1); 6527 6527 struct copy_subpage_arg arg = { 6528 - .dst = &dst->page, 6529 - .src = &src->page, 6528 + .dst = dst, 6529 + .src = src, 6530 6530 .vma = vma, 6531 6531 }; 6532 6532