]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iov_iter: optimize page_copy_sane()
authorEric Dumazet <edumazet@google.com>
Tue, 26 Feb 2019 18:42:39 +0000 (10:42 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 May 2019 05:38:58 +0000 (07:38 +0200)
commit4999174b1a7772c2172804c2840cead989681a21
tree71cc9341cc6057f3c0760ed18d532a29da9b93fc
parent6e52e4b6cf50c26af2ec20b4b527fc7046892a20
iov_iter: optimize page_copy_sane()

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>
lib/iov_iter.c