genode/ports-foc/patches/tcp_mem.patch
Sebastian Sumpf 8734eab6ac L4LX: Network interface fixes
Make calls using IPCs IRQ safe, handle packet exhaustion, removed
'Packet_pool', tweak TCP rmem and wmem buffer sizes to show better performance
results, use 'Net::Packet_allocator, fix 'update-patch' Makefile command
2012-08-07 22:22:28 +02:00

20 lines
700 B
Diff

Index: net/ipv4/tcp.c
===================================================================
--- net/ipv4/tcp.c (revision 23)
+++ net/ipv4/tcp.c (working copy)
@@ -3285,8 +3285,13 @@
/* Set per-socket limits to no more than 1/128 the pressure threshold */
limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7);
- max_share = min(4UL*1024*1024, limit);
+ /*
+ * Adjust limit so it performs well on systems with little memory. If
+ * this causes errors increase L4Linux main memory
+ */
+ max_share = min(4UL*1024*1024, limit < 768U * 1024 ? 768U * 1024 : limit);
+
sysctl_tcp_wmem[0] = SK_MEM_QUANTUM;
sysctl_tcp_wmem[1] = 16*1024;
sysctl_tcp_wmem[2] = max(64*1024, max_share);