]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
iov_iter: optimize page_copy_sane()
authorEric Dumazet <edumazet@google.com>
Tue, 26 Feb 2019 18:42:39 +0000 (10:42 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit019b240e6e737ee2d722aafaa46cf83ef38bf7f4
tree2b7c6ef196fdfe8f34fcbf6ee4e23665f65c70ca
parent4869493a384fa6a54c5636595f8e17a26f9c422f
iov_iter: optimize page_copy_sane()

BugLink: https://bugs.launchpad.net/bugs/1838576
commit 6daef95b8c914866a46247232a048447fff97279 upstream.

Avoid cache line miss dereferencing struct page if we can.

page_copy_sane() mostly deals with order-0 pages.

Extra cache line miss is visible on TCP recvmsg() calls dealing
with GRO packets (typically 45 page frags are attached to one skb).

Bringing the 45 struct pages into cpu cache while copying the data
is not free, since the freeing of the skb (and associated
page frags put_page()) can happen after cache lines have been evicted.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
lib/iov_iter.c