[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#592187: [stable] Bug#576838: virtio network crashes again



> > Who's done the checks to find out any problems with these patches?
> 
> I'll skim the changelogs in 2.6.3[345].x to see if there are any related
> patches.

This is all I could find in current 2.6.36-rc2 (via git log | grep,
minus rps/rfs patches). I don't know anything about these, but they
sound related. If anybody with insight into the actual codebase could
take a look there ...


commit c377411f2494a931ff7facdbb3a6839b1266bcf6
Author: Eric Dumazet <eric.dumazet@gmail.com>
Date:   Tue Apr 27 15:13:20 2010 -0700

    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 <eric.dumazet@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 6cce09f87a04797fae5b947ef2626c14a78f0b49
Author: Eric Dumazet <eric.dumazet@gmail.com>
Date:   Sun Mar 7 23:21:57 2010 +0000

    tcp: Add SNMP counters for backlog and min_ttl drops
    
    Commit 6b03a53a (tcp: use limited socket backlog) added the possibility
    of dropping frames when backlog queue is full.
    
    Commit d218d111 (tcp: Generalized TTL Security Mechanism) added the
    possibility of dropping frames when TTL is under a given limit.
    
    This patch adds new SNMP MIB entries, named TCPBacklogDrop and
    TCPMinTTLDrop, published in /proc/net/netstat in TcpExt: line
    
    netstat -s | egrep "TCPBacklogDrop|TCPMinTTLDrop"
        TCPBacklogDrop: 0
        TCPMinTTLDrop: 0
    
    Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 4045635318538d3ddd2007720412fdc4b08f6a62
Author: Zhu Yi <yi.zhu@intel.com>
Date:   Sun Mar 7 16:21:39 2010 +0000

    net: add __must_check to sk_add_backlog
    
    Add the "__must_check" tag to sk_add_backlog() so that any failure to
    check and drop packets will be warned about.
    
    Signed-off-by: Zhu Yi <yi.zhu@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit b1faf5666438090a4dc4fceac8502edc7788b7e3
Author: Eric Dumazet <eric.dumazet@gmail.com>
Date:   Mon May 31 23:44:05 2010 -0700

    net: sock_queue_err_skb() dont mess with sk_forward_alloc
    
    Correct sk_forward_alloc handling for error_queue would need to use a
    backlog of frames that softirq handler could not deliver because socket
    is owned by user thread. Or extend backlog processing to be able to
    process normal and error packets.
    
    Another possibility is to not use mem charge for error queue, this is
    what I implemented in this patch.
    
    Note: this reverts commit 29030374
    (net: fix sk_forward_alloc corruptions), since we dont need to lock
    socket anymore.
    
    Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>


commit dee42870a423ad485129f43cddfe7275479f11d8
Author: Changli Gao <xiaosuo@gmail.com>
Date:   Sun May 2 05:42:16 2010 +0000

    net: fix softnet_stat
    
    Per cpu variable softnet_data.total was shared between IRQ and SoftIRQ context
    without any protection. And enqueue_to_backlog should update the netdev_rx_stat
    of the target CPU.
    
    This patch renames softnet_data.total to softnet_data.processed: the number of
    packets processed in uppper levels(IP stacks).
    
    softnet_stat data is moved into softnet_data.
    
    Signed-off-by: Changli Gao <xiaosuo@gmail.com>
    ----
     include/linux/netdevice.h |   17 +++++++----------
     net/core/dev.c            |   26 ++++++++++++--------------
     net/sched/sch_generic.c   |    2 +-
     3 files changed, 20 insertions(+), 25 deletions(-)
    Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 4b0b72f7dd617b13abd1b04c947e15873e011a24
Author: Eric Dumazet <eric.dumazet@gmail.com>
Date:   Wed Apr 28 14:35:48 2010 -0700

    net: speedup udp receive path
    
    Since commit 95766fff ([UDP]: Add memory accounting.),
    each received packet needs one extra sock_lock()/sock_release() pair.
    
    This added latency because of possible backlog handling. Then later,
    ticket spinlocks added yet another latency source in case of DDOS.
    
    This patch introduces lock_sock_bh() and unlock_sock_bh()
    synchronization primitives, avoiding one atomic operation and backlog
    processing.
    
    skb_free_datagram_locked() uses them instead of full blown
    lock_sock()/release_sock(). skb is orphaned inside locked section for
    proper socket memory reclaim, and finally freed outside of it.
    
    UDP receive path now take the socket spinlock only once.
    
    Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 6e7676c1a76aed6e957611d8d7a9e5592e23aeba
Author: Changli Gao <xiaosuo@gmail.com>
Date:   Tue Apr 27 15:07:33 2010 -0700

    net: batch skb dequeueing from softnet input_pkt_queue
    
    batch skb dequeueing from softnet input_pkt_queue to reduce potential lock
    contention when RPS is enabled.
    
    Note: in the worst case, the number of packets in a softnet_data may
    be double of netdev_max_backlog.
    
    Signed-off-by: Changli Gao <xiaosuo@gmail.com>
    Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 9958da0501fced47c1ac5c5a3a7731c87e45472c
Author: Eric Dumazet <eric.dumazet@gmail.com>
Date:   Sat Apr 17 04:17:02 2010 +0000

    net: remove time limit in process_backlog()
    
    - There is no point to enforce a time limit in process_backlog(), since
    other napi instances dont follow same rule. We can exit after only one
    packet processed...
    The normal quota of 64 packets per napi instance should be the norm, and
    net_rx_action() already has its own time limit.
    Note : /proc/net/core/dev_weight can be used to tune this 64 default
    value.
    
    - Use DEFINE_PER_CPU_ALIGNED for softnet_data definition.
    
    Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit e51d739ab79110c43ca03daf3ddb3c52dadd38b7
Author: Tom Herbert <therbert@google.com>
Date:   Tue Mar 23 13:39:19 2010 +0000

    net: Fix locking in flush_backlog
    
    Need to take spinlocks when dequeuing from input_pkt_queue in flush_backlog.
    Also, flush_backlog can now be called directly from netdev_run_todo.
    
    Signed-off-by: Tom Herbert <therbert@google.com>
    Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>


-- 
Lukas





Reply to: