mm/memory.c: refactor insert_page to prepare for batched-lock insert

Add helper methods for vm_insert_page()/insert_page() to prepare for
vm_insert_pages(), which batch-inserts pages to reduce spinlock
operations when inserting multiple consecutive pages into the user page

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

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 <>
1 file changed