• Ingo Molnar's avatar
    [PATCH] sched: net: fix scheduling latencies in netstat · 6ecee34d
    Ingo Molnar authored
    The attached patch fixes long scheduling latencies caused by access to the
    /proc/net/tcp file.  The seqfile functions keep softirqs disabled for a
    very long time (i've seen reports of 20+ msecs, if there are enough sockets
    in the system).  With the attached patch it's below 100 usecs.
    
    The cond_resched_softirq() relies on the implicit knowledge that this code
    executes in process context and runs with softirqs disabled.
    
    Potentially enabling softirqs means that the socket list might change
    between buckets - but this is not an issue since seqfiles have a 4K
    iteration granularity anyway and /proc/net/tcp is often (much) larger than
    that.
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    6ecee34d
tcp_ipv4.c 64.6 KB