Re: [PATCH] udmabuf: Add support for mapping hugepages

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

 



  Hi,

> +		if (is_file_hugepages(memfd)) {
> +			hpstate = hstate_file(memfd);
> +			pgoff = list[i].offset >> huge_page_shift(hpstate);
> +			subpgoff = (list[i].offset &
> +				    ~huge_page_mask(hpstate)) >> PAGE_SHIFT;
> +			hpage = find_get_page_flags(
> +					file_inode(memfd)->i_mapping,
> +					pgoff, FGP_ACCESSED);
> +			if (IS_ERR(hpage)) {
> +				ret = PTR_ERR(hpage);
>  				goto err;
>  			}
> +		}
> +		for (pgidx = 0; pgidx < pgcnt; pgidx++) {
> +			if (is_file_hugepages(memfd)) {
> +				page = hpage + subpgoff + pgidx;
> +				get_page(page);

Hmm.  Does this work in case the page range spans multiple huge pages?

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