On Thu, Mar 30, 2023 at 10:02:52AM -0700, Sidhartha Kumar wrote:
On 3/30/23 6:40 AM, Peng Zhang wrote:There's no added assertion in this patch any more, so I'd drop that
From: ZhangPeng <zhangpeng362@xxxxxxxxxx>
Call vma_alloc_folio() directly instead of alloc_page_vma(). Add an
assertion that this is a single-page folio and removes several calls to
compound_head().
part of the description.
I'd just call it 'kaddr'. Or 'addr'.if (!*pagep) {Should this variable name be kept as page_kaddr or should it be changed to
ret = -ENOMEM;
- page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, dst_vma, dst_addr);
- if (!page)
+ folio = vma_alloc_folio(GFP_HIGHUSER_MOVABLE, 0, dst_vma, dst_addr, false);
+ if (!folio)
goto out;
- page_kaddr = kmap_local_page(page);
+ page_kaddr = kmap_local_folio(folio, 0);
something like folio_kaddr? kmap_local_folio() returns page_address(), so
maybe page_kaddr is better.