Re: [PATCH] udmabuf: Add support for mapping hugepages (v2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux