Re: [PATCH v2 bpf-next 01/10] lib/buildid: add single page-based file reader abstraction

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

 



> +static int freader_get_page(struct freader *r, u64 file_off)
> +{
> +	pgoff_t pg_off = file_off >> PAGE_SHIFT;
> +
> +	freader_put_page(r);
> +
> +	r->page = find_get_page(r->mapping, pg_off);
> +	if (!r->page)
> +		return -EFAULT;	/* page not mapped */
> +
> +	r->page_addr = kmap_local_page(r->page);

kmaps are a limited resource on true highmem systems
(something like 16-32)
Can you guarantee that you don't overrun them?

Some of the callers below seem to be in a loop.

You probably won't see any failures unless you test with real highmem.
Given it's a obscure configuration these days, but with some of the
attempts to unmap the page cache by default it might be back in
mainstream.

Also true highmem disables preemption, I assume you took that
into account. If the worst case run time is long enough would
need preemption points.

-Andi




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux