}
union mc_target {
- struct page *page;
+ struct folio *folio;
swp_entry_t ent;
};
* Return:
* * MC_TARGET_NONE - If the pte is not a target for move charge.
* * MC_TARGET_PAGE - If the page corresponding to this pte is a target for
- * move charge. If @target is not NULL, the page is stored in target->page
+ * move charge. If @target is not NULL, the folio is stored in target->folio
* with extra refcnt taken (Caller should release it).
* * MC_TARGET_SWAP - If the swap entry corresponding to this pte is a
* target for charge migration. If @target is not NULL, the entry is
is_device_coherent_page(page))
ret = MC_TARGET_DEVICE;
if (target)
- target->page = page;
+ target->folio = page_folio(page);
}
if (!ret || !target) {
if (target)
put_page(page);
return MC_TARGET_NONE;
}
- target->page = page;
+ target->folio = page_folio(page);
}
}
return ret;
}
target_type = get_mctgt_type_thp(vma, addr, *pmd, &target);
if (target_type == MC_TARGET_PAGE) {
- folio = page_folio(target.page);
+ folio = target.folio;
if (folio_isolate_lru(folio)) {
if (!mem_cgroup_move_account(folio, true,
mc.from, mc.to)) {
folio_unlock(folio);
folio_put(folio);
} else if (target_type == MC_TARGET_DEVICE) {
- folio = page_folio(target.page);
+ folio = target.folio;
if (!mem_cgroup_move_account(folio, true,
mc.from, mc.to)) {
mc.precharge -= HPAGE_PMD_NR;
device = true;
fallthrough;
case MC_TARGET_PAGE:
- folio = page_folio(target.page);
+ folio = target.folio;
/*
* We can have a part of the split pmd here. Moving it
* can be done but it would be too convoluted so simply