mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
KVM: guest_memfd: Don't set FGP_ACCESSED when getting folios
guest_memfd folios don't care about accessed flags since the memory is unevictable and there is no storage to write back to, hence, cleanup the allocation path by not setting FGP_ACCESSED. Signed-off-by: Ackerley Tng <ackerleytng@google.com> [sean: split to separate patch] Acked-by: Vlastimil Babka <vbabka@suse.cz> Acked-by: David Hildenbrand (arm) <david@kernel.org> Link: https://patch.msgid.link/20260129172646.2361462-1-ackerleytng@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
committed by
Sean Christopherson
parent
11439c4635
commit
6dad5447c7
@@ -126,14 +126,13 @@ static struct folio *kvm_gmem_get_folio(struct inode *inode, pgoff_t index)
|
||||
* Fast-path: See if folio is already present in mapping to avoid
|
||||
* policy_lookup.
|
||||
*/
|
||||
folio = __filemap_get_folio(inode->i_mapping, index,
|
||||
FGP_LOCK | FGP_ACCESSED, 0);
|
||||
folio = filemap_lock_folio(inode->i_mapping, index);
|
||||
if (!IS_ERR(folio))
|
||||
return folio;
|
||||
|
||||
policy = mpol_shared_policy_lookup(&GMEM_I(inode)->policy, index);
|
||||
folio = __filemap_get_folio_mpol(inode->i_mapping, index,
|
||||
FGP_LOCK | FGP_ACCESSED | FGP_CREAT,
|
||||
FGP_LOCK | FGP_CREAT,
|
||||
mapping_gfp_mask(inode->i_mapping), policy);
|
||||
mpol_cond_put(policy);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user