On Thu, Nov 12, 2015 at 02:26:52PM +0300, Pavel Emelyanov wrote: > > + nr = min((unsigned long)(nr_pages - i), > > + (unsigned long)((vma->e->end - va) / PAGE_SIZE)); > > Maybe grab the min_t() helper from the kernel? Yeah, good idea. Will do and send, please drop it.