linux-stable/include/uapi
Arjun Roy 94ab9eb9b2 net-zerocopy: Defer vm zap unless actually needed.
Zapping pages is required only if we are calling vm_insert_page into a
region where pages had previously been mapped. Receive zerocopy allows
reusing such regions, and hitherto called zap_page_range() before
calling vm_insert_page() in that range.

zap_page_range() can also be triggered from userspace with
madvise(MADV_DONTNEED). If userspace is configured to call this before
reusing a segment, or if there was nothing mapped at this virtual
address to begin with, we can avoid calling zap_page_range() under the
socket lock. That said, if userspace does not do that, then we are
still responsible for calling zap_page_range().

This patch adds a flag that the user can use to hint to the kernel
that a zap is not required. If the flag is not set, or if an older
user application does not have a flags field at all, then the kernel
calls zap_page_range as before. Also, if the flag is set but a zap is
still required, the kernel performs that zap as necessary. Thus
incorrectly indicating that a zap can be avoided does not change the
correctness of operation. It also increases the batchsize for
vm_insert_pages and prefetches the page struct for the batch since
we're about to bump the refcount.

An alternative mechanism could be to not have a flag, assume by
default a zap is not needed, and fall back to zapping if needed.
However, this would harm performance for older applications for which
a zap is necessary, and thus we implement it with an explicit flag
so newer applications can opt in.

When using RPC-style traffic with medium sized (tens of KB) RPCs, this
change yields an efficency improvement of about 30% for QPS/CPU usage.

Signed-off-by: Arjun Roy <arjunroy@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-12-04 13:40:53 -08:00
..
asm-generic net: Add SO_BUSY_POLL_BUDGET socket option 2020-12-01 00:09:25 +01:00
drm Merge tag 'amd-drm-next-5.10-2020-09-03' of git://people.freedesktop.org/~agd5f/linux into drm-next 2020-09-08 16:40:13 +10:00
linux net-zerocopy: Defer vm zap unless actually needed. 2020-12-04 13:40:53 -08:00
misc habanalabs: Add an option to map CB to device MMU 2020-09-22 18:49:54 +03:00
mtd MTD: mtd-abi.h: drop a duplicated word 2020-08-02 23:00:10 +02:00
rdma net/mlx5: Add misc4 to mlx5_ifc_fte_match_param_bits 2020-11-26 18:43:47 -08:00
scsi scsi: qla2xxx: Change in PUREX to handle FPIN ELS requests 2020-07-01 22:24:16 -04:00
sound ALSA: fix kernel-doc markups 2020-10-26 15:26:31 +01:00
video
xen xen/gntdev: gntdev.h: drop a duplicated word 2020-08-03 07:46:42 +02:00
Kbuild