mm/memory.c: add vm_insert_pages()

Add the ability to insert multiple pages at once to a user VM with lower
PTE spinlock operations.

The intention of this patch-set is to reduce atomic ops for tcp zerocopy
receives, which normally hits the same spinlock multiple times

[ pte_alloc() no longer takes the `addr' argument]
[ add missing page_count() check to vm_insert_pages()]
[ vm_insert_pages() checks if pte_index defined]
Signed-off-by: Arjun Roy <>
Signed-off-by: Eric Dumazet <>
Signed-off-by: Soheil Hassas Yeganeh <>
Signed-off-by: Andrew Morton <>
Cc: David Miller <>
Cc: Matthew Wilcox <>
Cc: Jason Gunthorpe <>
Cc: Stephen Rothwell <>
Signed-off-by: Linus Torvalds <>
2 files changed