mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-02 22:36:41 +07:00
net: allow better page reuse in splice(sock -> pipe)
splice() from socket to pipe needs linear_to_page() helper to transfert skb header to part of page. We can reset the offset in the current sk->sk_sndmsg_page if we are the last user of the page. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
acd6996234
commit
e66e9a3147
@ -1565,6 +1565,9 @@ static inline struct page *linear_to_page(struct page *page, unsigned int *len,
|
||||
} else {
|
||||
unsigned int mlen;
|
||||
|
||||
/* If we are the only user of the page, we can reset offset */
|
||||
if (page_count(p) == 1)
|
||||
sk->sk_sndmsg_off = 0;
|
||||
off = sk->sk_sndmsg_off;
|
||||
mlen = PAGE_SIZE - off;
|
||||
if (mlen < 64 && mlen < *len) {
|
||||
|
Loading…
Reference in New Issue
Block a user