From: Eric Dumazet Date: Tue, 27 Apr 2010 22:13:20 +0000 (-0700) Subject: net: sk_add_backlog() take rmem_alloc into account X-Git-Tag: v2.6.35-rc1~473^2~357 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c377411f2494a931ff7facdbb3a6839b1266bcf6;p=pandora-kernel.git net: sk_add_backlog() take rmem_alloc into account Current socket backlog limit is not enough to really stop DDOS attacks, because user thread spend many time to process a full backlog each round, and user might crazy spin on socket lock. We should add backlog size and receive_queue size (aka rmem_alloc) to pace writers, and let user run without being slow down too much. Introduce a sk_rcvqueues_full() helper, to avoid taking socket lock in stress situations. Under huge stress from a multiqueue/RPS enabled NIC, a single flow udp receiver can now process ~200.000 pps (instead of ~100 pps before the patch) on a 8 core machine. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- Reading git-diff-tree failed