rearrange frto field to save space.
Subsystems (4)
PATCH 1/1 rearrange frto field to save space.
In reply to a message not in the archiveSince the frto_counter field only goes from 0 to 4, it can be moved into a unused byte size hole to save space.
include/linux/tcp.h +4 -3
@@ -255,6 +255,10 @@__u8 retransmits;/* Number of unrecovered RTO timeouts. */ __u8 reordering;/* Packet reordering metric. */ +__u8 frto_counter;/* Number of new acks after RTO */ +__u32 frto_highmark;/* snd_nxt when RTO occurred */ + +__u8 unused_pad;__u8 queue_shrunk;/* Write queue has been shrunk recently.*/ __u8 defer_accept;/* User waits for some data after accept() */
@@ -369,9 +373,6 @@unsigned int keepalive_time;/* time before keep alive takes place */ unsigned int keepalive_intvl;/* time interval between keep alive probes */ int linger2; - -int frto_counter;/* Number of new acks after RTO */ -__u32 frto_highmark;/* snd_nxt when RTO occurred */ unsigned long last_synq_overflow;
PATCH 1/1 add sysctl to turn off caching metrics
In reply to a message not in the archiveWhen running benchmarks and other experiments, it is often useful not to save the route metrics (cwnd, rtt) from each connection. Here is a simple way to do it with sysctl. Not a new idea, it is part of the web100 stuff as well.
Patch against 2.6.6-rc2
include/linux/sysctl.h +1 -0
@@ -326,6 +326,7 @@NET_IPV4_IPFRAG_SECRET_INTERVAL =94 ,NET_TCP_WESTWOOD =95 ,NET_IPV4_IGMP_MAX_MSF =96 , + NET_TCP_NO_METRICS_SAVE=97, }; enum {
include/net/tcp.h +1 -0
@@ -583,6 +583,7 @@extern int sysctl_tcp_frto;extern int sysctl_tcp_low_latency;extern int sysctl_tcp_westwood; +extern int sysctl_tcp_nometrics_save;extern atomic_t tcp_memory_allocated;extern atomic_t tcp_sockets_allocated;
net/ipv4/sysctl_net_ipv4.c +9 -0
@@ -594,6 +594,14 @@ .strategy = &sysctl_jiffies }, { + .ctl_name = NET_TCP_NO_METRICS_SAVE, + .procname = "tcp_no_metrics_save", + .data = &sysctl_tcp_nometrics_save, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, + { .ctl_name = NET_TCP_WESTWOOD, .procname = "tcp_westwood", .data = &sysctl_tcp_westwood,
@@ -601,6 +609,7 @@ .mode = 0644, .proc_handler = &proc_dointvec, }, + { .ctl_name = 0 } };
net/ipv4/tcp_input.c +4 -0
@@ -87,6 +87,7 @@int sysctl_tcp_max_orphans =NR_FILE ;int sysctl_tcp_frto;int sysctl_tcp_westwood; +int sysctl_tcp_nometrics_save;#define FLAG_DATA 0x01/* Incoming frame contained data. */ #define FLAG_WIN_UPDATE 0x02/* Incoming ACK was a window update. */
@@ -517,6 +518,9 @@ {struct tcp_opt *tp =tcp_sk (sk);struct dst_entry *dst =__sk_dst_get (sk); + +if (sysctl_tcp_nometrics_save) +return ;dst_confirm (dst);
Quoted 2 lines · On Wed, 21 Apr 2004 11:10:32 -0700 Stephen Hemminger <[email protected]>…
Since the
frto_counterfield only goes from 0 to 4, it can be moved into a unused byte size hole to save space.
Ok. Applied.
Re: [PATCH] add sysctl to turn off caching metrics
In reply to Stephen HemmingerQuoted 4 lines · On Wed, 21 Apr 2004 11:10:46 -0700 Stephen Hemminger <[email protected]>…
When running benchmarks and other experiments, it is often useful not to save the route metrics (cwnd, rtt) from each connection. Here is a simple way to do it with sysctl. Not a new idea, it is part of the web100 stuff as well.
This is fine.
include/linux/tcp.h line 261
Quoted 1 line · Stephen Hemminger
include/linux/tcp.h +1
-0+__u8 unused_pad;
There's no real reason that I can see to have padding here.
Quoted 4 lines · On Wed, 21 Apr 2004 17:15:12 -0700 Joe Perches <[email protected]> wrote:
include/linux/tcp.h line 261
Quoted 1 line · Stephen Hemminger
include/linux/tcp.h +1
-0+__u8 unused_pad;There's no real reason that I can see to have padding here.
SO that the next person adding member to this struct know it exists.