diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-23 03:21:15 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-23 03:21:15 -0400 |
commit | 58ee01007c9e00531c1280b2d99b49d29a5e9844 (patch) | |
tree | d1feb7102591a811b4458e2e209d476580ae3687 /include/net/sock.h | |
parent | 4850f26abfcac9ed28a4db5817b46dc0bfbbbae0 (diff) | |
parent | 4b972a01a7da614b4796475f933094751a295a2f (diff) |
Merge 5.2-rc6 into usb-next
We need the USB fixes in here too.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index e9d769c04637..6cbc16136357 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1463,12 +1463,14 @@ static inline void sk_mem_uncharge(struct sock *sk, int size) | |||
1463 | __sk_mem_reclaim(sk, 1 << 20); | 1463 | __sk_mem_reclaim(sk, 1 << 20); |
1464 | } | 1464 | } |
1465 | 1465 | ||
1466 | DECLARE_STATIC_KEY_FALSE(tcp_tx_skb_cache_key); | ||
1466 | static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb) | 1467 | static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb) |
1467 | { | 1468 | { |
1468 | sock_set_flag(sk, SOCK_QUEUE_SHRUNK); | 1469 | sock_set_flag(sk, SOCK_QUEUE_SHRUNK); |
1469 | sk->sk_wmem_queued -= skb->truesize; | 1470 | sk->sk_wmem_queued -= skb->truesize; |
1470 | sk_mem_uncharge(sk, skb->truesize); | 1471 | sk_mem_uncharge(sk, skb->truesize); |
1471 | if (!sk->sk_tx_skb_cache && !skb_cloned(skb)) { | 1472 | if (static_branch_unlikely(&tcp_tx_skb_cache_key) && |
1473 | !sk->sk_tx_skb_cache && !skb_cloned(skb)) { | ||
1472 | skb_zcopy_clear(skb, true); | 1474 | skb_zcopy_clear(skb, true); |
1473 | sk->sk_tx_skb_cache = skb; | 1475 | sk->sk_tx_skb_cache = skb; |
1474 | return; | 1476 | return; |
@@ -2433,13 +2435,11 @@ static inline void skb_setup_tx_timestamp(struct sk_buff *skb, __u16 tsflags) | |||
2433 | * This routine must be called with interrupts disabled or with the socket | 2435 | * This routine must be called with interrupts disabled or with the socket |
2434 | * locked so that the sk_buff queue operation is ok. | 2436 | * locked so that the sk_buff queue operation is ok. |
2435 | */ | 2437 | */ |
2438 | DECLARE_STATIC_KEY_FALSE(tcp_rx_skb_cache_key); | ||
2436 | static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb) | 2439 | static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb) |
2437 | { | 2440 | { |
2438 | __skb_unlink(skb, &sk->sk_receive_queue); | 2441 | __skb_unlink(skb, &sk->sk_receive_queue); |
2439 | if ( | 2442 | if (static_branch_unlikely(&tcp_rx_skb_cache_key) && |
2440 | #ifdef CONFIG_RPS | ||
2441 | !static_branch_unlikely(&rps_needed) && | ||
2442 | #endif | ||
2443 | !sk->sk_rx_skb_cache) { | 2443 | !sk->sk_rx_skb_cache) { |
2444 | sk->sk_rx_skb_cache = skb; | 2444 | sk->sk_rx_skb_cache = skb; |
2445 | skb_orphan(skb); | 2445 | skb_orphan(skb); |
@@ -2534,6 +2534,8 @@ extern int sysctl_optmem_max; | |||
2534 | extern __u32 sysctl_wmem_default; | 2534 | extern __u32 sysctl_wmem_default; |
2535 | extern __u32 sysctl_rmem_default; | 2535 | extern __u32 sysctl_rmem_default; |
2536 | 2536 | ||
2537 | DECLARE_STATIC_KEY_FALSE(net_high_order_alloc_disable_key); | ||
2538 | |||
2537 | static inline int sk_get_wmem0(const struct sock *sk, const struct proto *proto) | 2539 | static inline int sk_get_wmem0(const struct sock *sk, const struct proto *proto) |
2538 | { | 2540 | { |
2539 | /* Does this proto have per netns sysctl_wmem ? */ | 2541 | /* Does this proto have per netns sysctl_wmem ? */ |