lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 15 May 2013 21:19:01 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Maciej Żenczykowski <zenczykowski@...il.com>
Cc:	David Miller <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>,
	Tom Herbert <therbert@...gle.com>,
	Neal Cardwell <ncardwell@...gle.com>,
	Yuchung Cheng <ycheng@...gle.com>
Subject: Re: [PATCH] tcp: gso: do not generate out of order packets

On Wed, 2013-05-15 at 20:58 -0700, Maciej Żenczykowski wrote:
> I'd be worried that calling the destructor that many times would cause
> performance problems
> (and only call the destructor and do memory accounting on the last segment).
> 
> Could we instead move the queue mapping into the skb somehow instead?

There is no performance problem, because all these packets are going to
be freed at the same time from TX completion handler.

The socket cache lines we use (sk->sk_state, sk->sk_wmem_alloc) are hot.

Anyway its way cleaner propagating socket information, as it might be
needed by netfilter or classifiers.

Some months ago I tested a variant of sock_wfree() not testing
sk>sk_state as TCP sockets set SOCK_USE_WRITE_QUEUE flag, and I had no
change in performance. sk_state & sk_wmem_alloc were on separate cache
lines :

offsetof(struct sock, sk_flags) = 0xe8
offsetof(struct sock, sk_wmem_alloc) = 0x104

void sock_fast_wfree(struct sk_buff *skb)
{
        struct sock *sk = skb->sk;

        if (atomic_sub_and_test(skb->truesize, &sk->sk_wmem_alloc))
                __sk_free(sk);
}



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ