Commit 3ae4c190 authored by David S. Miller's avatar David S. Miller Committed by Sridhar Samudrala

[TCP]: Add tcp_low_latency sysctl.

Currently it turns of prequeue processing, but more decisions
may be guided by it in the future.
Based upon a patch from Andi Kleen.
parent 9878e9dd
......@@ -281,6 +281,14 @@ tcp_rfc1337 - BOOLEAN
assassination.
Default: 0
tcp_low_latency - BOOLEAN
If set, the TCP stack makes decisions that prefer lower
latency as opposed to higher throughput. By default, this
option is not set meaning that higher throughput is preferred.
An example of an application where this default should be
changed would be a Beowulf compute cluster.
Default: 0
ip_local_port_range - 2 INTEGERS
Defines the local port range that is used by TCP and UDP to
choose the local port. The first number is the first, the
......
......@@ -305,7 +305,8 @@ enum
NET_IPV4_ICMP_RATELIMIT=89,
NET_IPV4_ICMP_RATEMASK=90,
NET_TCP_TW_REUSE=91,
NET_TCP_FRTO=92
NET_TCP_FRTO=92,
NET_TCP_LOW_LATENCY=93
};
enum {
......
......@@ -474,6 +474,7 @@ extern int sysctl_tcp_app_win;
extern int sysctl_tcp_adv_win_scale;
extern int sysctl_tcp_tw_reuse;
extern int sysctl_tcp_frto;
extern int sysctl_tcp_low_latency;
extern atomic_t tcp_memory_allocated;
extern atomic_t tcp_sockets_allocated;
......@@ -1349,7 +1350,7 @@ static __inline__ int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
{
struct tcp_opt *tp = tcp_sk(sk);
if (tp->ucopy.task) {
if (!sysctl_tcp_low_latency && tp->ucopy.task) {
__skb_queue_tail(&tp->ucopy.prequeue, skb);
tp->ucopy.memory += skb->truesize;
if (tp->ucopy.memory > sk->rcvbuf) {
......
......@@ -223,6 +223,8 @@ ctl_table ipv4_table[] = {
&sysctl_tcp_tw_reuse, sizeof(int), 0644, NULL, &proc_dointvec},
{NET_TCP_FRTO, "tcp_frto",
&sysctl_tcp_frto, sizeof(int), 0644, NULL, &proc_dointvec},
{NET_TCP_LOW_LATENCY, "tcp_low_latency",
&sysctl_tcp_low_latency, sizeof(int), 0644, NULL, &proc_dointvec},
{0}
};
......
......@@ -75,6 +75,7 @@
extern int sysctl_ip_dynaddr;
extern int sysctl_ip_default_ttl;
int sysctl_tcp_tw_reuse;
int sysctl_tcp_low_latency;
/* Check TCP sequence numbers in ICMP packets. */
#define ICMP_MIN_LENGTH 8
......
......@@ -429,6 +429,7 @@ EXPORT_SYMBOL(sysctl_tcp_wmem);
EXPORT_SYMBOL(sysctl_tcp_ecn);
EXPORT_SYMBOL(tcp_cwnd_application_limited);
EXPORT_SYMBOL(tcp_sendpage);
EXPORT_SYMBOL(sysctl_tcp_low_latency);
EXPORT_SYMBOL(tcp_write_xmit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment