Commit d451b89d authored by Vishal Moola (Oracle)'s avatar Vishal Moola (Oracle) Committed by Andrew Morton

mm/mempolicy: convert queue_pages_required() to queue_folio_required()

Replace queue_pages_required() with queue_folio_required(). 
queue_folio_required() does the same as queue_pages_required(), except
takes in a folio instead of a page.

Link: https://lkml.kernel.org/r/20230130201833.27042-6-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Jane Chu <jane.chu@oracle.com>
Cc: "Yin, Fengwei" <fengwei.yin@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 0a2c1e81
...@@ -427,15 +427,15 @@ struct queue_pages { ...@@ -427,15 +427,15 @@ struct queue_pages {
}; };
/* /*
* Check if the page's nid is in qp->nmask. * Check if the folio's nid is in qp->nmask.
* *
* If MPOL_MF_INVERT is set in qp->flags, check if the nid is * If MPOL_MF_INVERT is set in qp->flags, check if the nid is
* in the invert of qp->nmask. * in the invert of qp->nmask.
*/ */
static inline bool queue_pages_required(struct page *page, static inline bool queue_folio_required(struct folio *folio,
struct queue_pages *qp) struct queue_pages *qp)
{ {
int nid = page_to_nid(page); int nid = folio_nid(folio);
unsigned long flags = qp->flags; unsigned long flags = qp->flags;
return node_isset(nid, *qp->nmask) == !(flags & MPOL_MF_INVERT); return node_isset(nid, *qp->nmask) == !(flags & MPOL_MF_INVERT);
...@@ -469,7 +469,7 @@ static int queue_folios_pmd(pmd_t *pmd, spinlock_t *ptl, unsigned long addr, ...@@ -469,7 +469,7 @@ static int queue_folios_pmd(pmd_t *pmd, spinlock_t *ptl, unsigned long addr,
walk->action = ACTION_CONTINUE; walk->action = ACTION_CONTINUE;
goto unlock; goto unlock;
} }
if (!queue_pages_required(&folio->page, qp)) if (!queue_folio_required(folio, qp))
goto unlock; goto unlock;
flags = qp->flags; flags = qp->flags;
...@@ -530,7 +530,7 @@ static int queue_folios_pte_range(pmd_t *pmd, unsigned long addr, ...@@ -530,7 +530,7 @@ static int queue_folios_pte_range(pmd_t *pmd, unsigned long addr,
*/ */
if (folio_test_reserved(folio)) if (folio_test_reserved(folio))
continue; continue;
if (!queue_pages_required(&folio->page, qp)) if (!queue_folio_required(folio, qp))
continue; continue;
if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) { if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) {
/* MPOL_MF_STRICT must be specified if we get here */ /* MPOL_MF_STRICT must be specified if we get here */
...@@ -575,7 +575,7 @@ static int queue_folios_hugetlb(pte_t *pte, unsigned long hmask, ...@@ -575,7 +575,7 @@ static int queue_folios_hugetlb(pte_t *pte, unsigned long hmask,
if (!pte_present(entry)) if (!pte_present(entry))
goto unlock; goto unlock;
folio = pfn_folio(pte_pfn(entry)); folio = pfn_folio(pte_pfn(entry));
if (!queue_pages_required(&folio->page, qp)) if (!queue_folio_required(folio, qp))
goto unlock; goto unlock;
if (flags == MPOL_MF_STRICT) { if (flags == MPOL_MF_STRICT) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment