From: Sidhartha Kumar <sidhartha.kumar@oracle.com>
To: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: akpm@linux-foundation.org, songmuchun@bytedance.com,
mike.kravetz@oracle.com, willy@infradead.org,
jhubbard@nvidia.com, gerald.schaefer@linux.ibm.com,
Sidhartha Kumar <sidhartha.kumar@oracle.com>
Subject: [PATCH v2 1/8] mm/hugetlb: convert hugetlb_install_page to folios
Date: Wed, 25 Jan 2023 09:05:30 -0800 [thread overview]
Message-ID: <20230125170537.96973-2-sidhartha.kumar@oracle.com> (raw)
In-Reply-To: <20230125170537.96973-1-sidhartha.kumar@oracle.com>
Change hugetlb_install_page() to hugetlb_install_folio(). This reduces one
user of the Huge Page flag macros which take in a page.
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
---
mm/hugetlb.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index d20c8b09890e..849206e94742 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -4946,14 +4946,14 @@ static bool is_hugetlb_entry_hwpoisoned(pte_t pte)
}
static void
-hugetlb_install_page(struct vm_area_struct *vma, pte_t *ptep, unsigned long addr,
- struct page *new_page)
+hugetlb_install_folio(struct vm_area_struct *vma, pte_t *ptep, unsigned long addr,
+ struct folio *new_folio)
{
- __SetPageUptodate(new_page);
- hugepage_add_new_anon_rmap(new_page, vma, addr);
- set_huge_pte_at(vma->vm_mm, addr, ptep, make_huge_pte(vma, new_page, 1));
+ __folio_mark_uptodate(new_folio);
+ hugepage_add_new_anon_rmap(&new_folio->page, vma, addr);
+ set_huge_pte_at(vma->vm_mm, addr, ptep, make_huge_pte(vma, &new_folio->page, 1));
hugetlb_count_add(pages_per_huge_page(hstate_vma(vma)), vma->vm_mm);
- SetHPageMigratable(new_page);
+ folio_set_hugetlb_migratable(new_folio);
}
int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
@@ -5107,7 +5107,7 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
/* huge_ptep of dst_pte won't change as in child */
goto again;
}
- hugetlb_install_page(dst_vma, dst_pte, addr, new);
+ hugetlb_install_folio(dst_vma, dst_pte, addr, page_folio(new));
spin_unlock(src_ptl);
spin_unlock(dst_ptl);
continue;
--
2.39.1
next prev parent reply other threads:[~2023-01-25 17:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-25 17:05 [PATCH v2 0/8] convert hugetlb fault functions " Sidhartha Kumar
2023-01-25 17:05 ` Sidhartha Kumar [this message]
2023-01-25 17:05 ` [PATCH v2 2/8] mm/hugetlb: convert hugetlbfs_pagecache_present() " Sidhartha Kumar
2023-01-25 17:05 ` [PATCH v2 3/8] mm/hugetlb: convert putback_active_hugepage to take in a folio Sidhartha Kumar
2023-01-25 17:05 ` [PATCH v2 4/8] mm/hugetlb: convert hugetlb fault paths to use alloc_hugetlb_folio() Sidhartha Kumar
2023-01-25 17:05 ` [PATCH v2 5/8] mm/hugetlb: convert restore_reserve_on_error to take in a folio Sidhartha Kumar
2023-01-25 17:05 ` [PATCH v2 6/8] mm/hugetlb: convert hugetlb_add_to_page_cache " Sidhartha Kumar
2023-01-25 17:05 ` [PATCH v2 7/8] mm/hugetlb: convert hugetlb_wp() " Sidhartha Kumar
2023-01-25 17:05 ` [PATCH v2 8/8] Documentation/mm: update hugetlbfs documentation to mention alloc_hugetlb_folio Sidhartha Kumar
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=20230125170537.96973-2-sidhartha.kumar@oracle.com \
--to=sidhartha.kumar@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=gerald.schaefer@linux.ibm.com \
--cc=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=songmuchun@bytedance.com \
--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