From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
Eric Dumazet <edumazet@google.com>,
Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH net-next 4/4] tcp: shrink tcp_timewait_sock by 8 bytes
Date: Thu, 8 Oct 2015 08:37:07 -0700 [thread overview]
Message-ID: <1444318627-27883-5-git-send-email-edumazet@google.com> (raw)
In-Reply-To: <1444318627-27883-1-git-send-email-edumazet@google.com>
Reducing tcp_timewait_sock from 280 bytes to 272 bytes
allows SLAB to pack 15 objects per page instead of 14 (on x86)
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/linux/tcp.h | 4 ++--
include/net/sock.h | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index e442e6e9a365..86a7edaa6797 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -356,8 +356,8 @@ static inline struct tcp_sock *tcp_sk(const struct sock *sk)
struct tcp_timewait_sock {
struct inet_timewait_sock tw_sk;
- u32 tw_rcv_nxt;
- u32 tw_snd_nxt;
+#define tw_rcv_nxt tw_sk.__tw_common.skc_tw_rcv_nxt
+#define tw_snd_nxt tw_sk.__tw_common.skc_tw_snd_nxt
u32 tw_rcv_wnd;
u32 tw_ts_offset;
u32 tw_ts_recent;
diff --git a/include/net/sock.h b/include/net/sock.h
index 6efba5f998f1..d43b2c0cbee4 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -227,6 +227,7 @@ struct sock_common {
union {
int skc_incoming_cpu;
u32 skc_rcv_wnd;
+ u32 skc_tw_rcv_nxt; /* struct tcp_timewait_sock */
};
atomic_t skc_refcnt;
@@ -235,6 +236,7 @@ struct sock_common {
union {
u32 skc_rxhash;
u32 skc_window_clamp;
+ u32 skc_tw_snd_nxt; /* struct tcp_timewait_sock */
};
/* public: */
};
--
2.6.0.rc2.230.g3dd15c0
next prev parent reply other threads:[~2015-10-08 15:37 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-08 15:37 [PATCH net-next 0/4] tcp: better smp listener behavior Eric Dumazet
2015-10-08 15:37 ` [PATCH net-next 1/4] net: SO_INCOMING_CPU setsockopt() support Eric Dumazet
2015-10-08 16:03 ` Tom Herbert
2015-10-08 16:29 ` Eric Dumazet
2015-10-08 16:44 ` Tom Herbert
2015-10-08 17:00 ` Eric Dumazet
2015-10-08 17:10 ` Tom Herbert
2015-10-08 16:50 ` Eric Dumazet
2015-10-08 16:07 ` kbuild test robot
2015-10-08 20:53 ` Tom Herbert
2015-10-08 21:17 ` Eric Dumazet
2015-10-08 15:37 ` [PATCH net-next 2/4] net: align sk_refcnt on 128 bytes boundary Eric Dumazet
2015-10-08 16:19 ` kbuild test robot
2015-10-08 15:37 ` [PATCH net-next 3/4] net: shrink struct sock and request_sock by 8 bytes Eric Dumazet
2015-10-08 16:31 ` kbuild test robot
2015-10-08 15:37 ` Eric Dumazet [this message]
2015-10-09 3:42 ` [PATCH net-next 0/4] tcp: better smp listener behavior Tom Herbert
2015-10-09 10:50 ` Eric Dumazet
2015-10-09 14:29 ` Eric Dumazet
2015-10-09 14:49 ` Eric Dumazet
2015-10-09 18:02 ` Daniel Borkmann
2015-10-09 18:12 ` Eric Dumazet
2015-10-13 9:22 ` Tobias Klauser
2015-10-13 9:28 ` Daniel Borkmann
2015-10-13 10:01 ` Tobias Klauser
2015-10-13 14:17 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444318627-27883-5-git-send-email-edumazet@google.com \
--to=edumazet@google.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).