> +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