Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93173112 authored by David S. Miller's avatar David S. Miller
Browse files

[TCP]: Don't set SKB owner in tcp_transmit_skb().



The data itself is already charged to the SKB, doing
the skb_set_owner_w() just generates a lot of noise and
extra atomics we don't really need.

Lmbench improvements on lat_tcp are minimal:

before:
TCP latency using localhost: 23.2701 microseconds
TCP latency using localhost: 23.1994 microseconds
TCP latency using localhost: 23.2257 microseconds

after:
TCP latency using localhost: 22.8380 microseconds
TCP latency using localhost: 22.9465 microseconds
TCP latency using localhost: 22.8462 microseconds

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ef56e622
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -38,5 +38,5 @@ extern void inet6_csk_reqsk_queue_hash_add(struct sock *sk,

extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr);

extern int inet6_csk_xmit(struct sk_buff *skb, int ipfragok);
extern int inet6_csk_xmit(struct sk_buff *skb, struct sock *sk, int ipfragok);
#endif /* _INET6_CONNECTION_SOCK_H */
+2 −1
Original line number Diff line number Diff line
@@ -36,7 +36,8 @@ struct tcp_congestion_ops;
 * (i.e. things that depend on the address family)
 */
struct inet_connection_sock_af_ops {
	int	    (*queue_xmit)(struct sk_buff *skb, int ipfragok);
	int	    (*queue_xmit)(struct sk_buff *skb, struct sock *sk,
				  int ipfragok);
	void	    (*send_check)(struct sock *sk, int len,
				  struct sk_buff *skb);
	int	    (*rebuild_header)(struct sock *sk);
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ extern int ip_mc_output(struct sk_buff *skb);
extern int		ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));
extern int		ip_do_nat(struct sk_buff *skb);
extern void		ip_send_check(struct iphdr *ip);
extern int		ip_queue_xmit(struct sk_buff *skb, int ipfragok);
extern int		ip_queue_xmit(struct sk_buff *skb, struct sock *sk, int ipfragok);
extern void		ip_init(void);
extern int		ip_append_data(struct sock *sk,
				       int getfrag(void *from, char *to, int offset, int len,
+2 −2
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)
		DCCP_INC_STATS(DCCP_MIB_OUTSEGS);

		memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
		err = icsk->icsk_af_ops->queue_xmit(skb, 0);
		err = icsk->icsk_af_ops->queue_xmit(skb, sk, 0);
		if (err <= 0)
			return err;

@@ -426,7 +426,7 @@ int dccp_send_reset(struct sock *sk, enum dccp_reset_codes code)
						      code);
		if (skb != NULL) {
			memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
			err = inet_csk(sk)->icsk_af_ops->queue_xmit(skb, 0);
			err = inet_csk(sk)->icsk_af_ops->queue_xmit(skb, sk, 0);
			if (err == NET_XMIT_CN)
				err = 0;
		}
+1 −2
Original line number Diff line number Diff line
@@ -288,9 +288,8 @@ int ip_output(struct sk_buff *skb)
			    !(IPCB(skb)->flags & IPSKB_REROUTED));
}

int ip_queue_xmit(struct sk_buff *skb, int ipfragok)
int ip_queue_xmit(struct sk_buff *skb, struct sock *sk, int ipfragok)
{
	struct sock *sk = skb->sk;
	struct inet_sock *inet = inet_sk(sk);
	struct ip_options *opt = inet->opt;
	struct rtable *rt;
Loading