• P
    [NETFILTER]: nf_conntrack: early_drop improvement · 7ae7730f
    Patrick McHardy 提交于
    When the maximum number of conntrack entries is reached and a new
    one needs to be allocated, conntrack tries to drop an unassured
    connection from the same hash bucket the new conntrack would hash
    to. Since with a properly sized hash the average number of entries
    per bucket is 1, the chances of actually finding one are not very
    good. This patch makes it walk the hash until a minimum number of
    8 entries are checked.
    
    Based on patch by Vasily Averin <vvs@sw.ru>.
    Signed-off-by: NPatrick McHardy <kaber@trash.net>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    7ae7730f
nf_conntrack_core.c 30.7 KB