[PATCH] udmabuf: Add support for mapping hugepages (v2)
Gerd Hoffmann
kraxel at redhat.com
Fri Jun 4 05:59:03 UTC 2021
Hi,
> for (pgidx = 0; pgidx < pgcnt; pgidx++) {
> + if (is_file_hugepages(memfd)) {
> + hpage = find_get_page_flags(
> + file_inode(memfd)->i_mapping,
> + pgoff, FGP_ACCESSED);
> + if (IS_ERR(hpage)) {
> + ret = PTR_ERR(hpage);
> + goto err;
> + }
> +
> + page = hpage + (subpgoff % maxsubpgs);
> + get_page(page);
> + put_page(hpage);
if (hpage && subpgoff == maxsubpgs) {
put_page(hpage);
hpage = NULL;
}
if (!hpage) {
hpage = find_get_page_flags(...)
[ ... ]
}
Only lookup the huge page when you cross a hugepage border.
take care,
Gerd
More information about the dri-devel
mailing list