aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/af_unix.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2013-08-08 17:37:32 -0400
committerDavid S. Miller <davem@davemloft.net>2013-08-10 04:16:44 -0400
commite370a7236321773245c5522d8bb299380830d3b2 (patch)
treee374e13b5fcccdd9aa28fcb5ab0dd3df05b4d384 /include/net/af_unix.h
parent149479d019e06df5a7f4096f95c00cfb1380309c (diff)
af_unix: improve STREAM behavior with fragmented memory
unix_stream_sendmsg() currently uses order-2 allocations, and we had numerous reports this can fail. The __GFP_REPEAT flag present in sock_alloc_send_pskb() is not helping. This patch extends the work done in commit eb6a24816b247c ("af_unix: reduce high order page allocations) for datagram sockets. This opens the possibility of zero copy IO (splice() and friends) The trick is to not use skb_pull() anymore in recvmsg() path, and instead add a @consumed field in UNIXCB() to track amount of already read payload in the skb. There is a performance regression for large sends because of extra page allocations that will be addressed in a follow-up patch, allowing sock_alloc_send_pskb() to attempt high order page allocations. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: David Rientjes <rientjes@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/af_unix.h')
-rw-r--r--include/net/af_unix.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index 05442df4ca89..a175ba4a7adb 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -35,6 +35,7 @@ struct unix_skb_parms {
35#ifdef CONFIG_SECURITY_NETWORK 35#ifdef CONFIG_SECURITY_NETWORK
36 u32 secid; /* Security ID */ 36 u32 secid; /* Security ID */
37#endif 37#endif
38 u32 consumed;
38}; 39};
39 40
40#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb)) 41#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb))