From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Muchun Song <muchun.song@linux.dev>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
David Hildenbrand <david@redhat.com>, <linux-mm@kvack.org>,
Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: [PATCH 2/2] mm: memory: use folio in struct copy_subpage_arg
Date: Thu, 13 Jun 2024 18:53:44 +0800 [thread overview]
Message-ID: <20240613105344.2876119-2-wangkefeng.wang@huawei.com> (raw)
In-Reply-To: <20240613105344.2876119-1-wangkefeng.wang@huawei.com>
Directly use folio in struct copy_subpage_arg.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
mm/memory.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index 6ef84cd0b2bf..ca44da80fd47 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -6475,16 +6475,16 @@ static int copy_user_gigantic_page(struct folio *dst, struct folio *src,
}
struct copy_subpage_arg {
- struct page *dst;
- struct page *src;
+ struct folio *dst;
+ struct folio *src;
struct vm_area_struct *vma;
};
static int copy_subpage(unsigned long addr, int idx, void *arg)
{
struct copy_subpage_arg *copy_arg = arg;
- struct page *dst = nth_page(copy_arg->dst, idx);
- struct page *src = nth_page(copy_arg->src, idx);
+ struct page *dst = folio_page(copy_arg->dst, idx);
+ struct page *src = folio_page(copy_arg->src, idx);
if (copy_mc_user_highpage(dst, src, addr, copy_arg->vma))
return -EHWPOISON;
@@ -6498,8 +6498,8 @@ int copy_user_large_folio(struct folio *dst, struct folio *src,
unsigned long addr = addr_hint &
~(((unsigned long)pages_per_huge_page << PAGE_SHIFT) - 1);
struct copy_subpage_arg arg = {
- .dst = &dst->page,
- .src = &src->page,
+ .dst = dst,
+ .src = src,
.vma = vma,
};
--
2.27.0
next prev parent reply other threads:[~2024-06-13 10:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-13 10:53 [PATCH 1/2] mm: convert clear_huge_page() to clear_large_folio() Kefeng Wang
2024-06-13 10:53 ` Kefeng Wang [this message]
2024-06-14 12:26 ` [PATCH 2/2] mm: memory: use folio in struct copy_subpage_arg David Hildenbrand
2024-06-13 14:51 ` [PATCH 1/2] mm: convert clear_huge_page() to clear_large_folio() Matthew Wilcox
2024-06-14 5:29 ` Kefeng Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240613105344.2876119-2-wangkefeng.wang@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox