10 Jan, 2012

1 commit


23 Dec, 2011

1 commit

  • We simply say that regular this_cpu use must be safe regardless of
    preemption and interrupt state. That has no material change for x86
    and s390 implementations of this_cpu operations. However, arches that
    do not provide their own implementation for this_cpu operations will
    now get code generated that disables interrupts instead of preemption.

    -tj: This is part of on-going percpu API cleanup. For detailed
    discussion of the subject, please refer to the following thread.

    http://thread.gmane.org/gmane.linux.kernel/1222078

    Signed-off-by: Christoph Lameter
    Signed-off-by: Tejun Heo
    LKML-Reference:

    Christoph Lameter
     

14 Nov, 2011

1 commit

  • Reading /proc/net/snmp6 on a machine with a lot of cpus is very
    expensive (can be ~88000 us).

    This is because ICMPV6MSG MIB uses 4096 bytes per cpu, and folding
    values for all possible cpus can read 16 Mbytes of memory (32MBytes on
    non x86 arches)

    ICMP messages are not considered as fast path on a typical server, and
    eventually few cpus handle them anyway. We can afford an atomic
    operation instead of using percpu data.

    This saves 4096 bytes per cpu and per network namespace.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

10 Nov, 2011

1 commit

  • Reading /proc/net/snmp on a machine with a lot of cpus is very expensive
    (can be ~88000 us).

    This is because ICMPMSG MIB uses 4096 bytes per cpu, and folding values
    for all possible cpus can read 16 Mbytes of memory.

    ICMP messages are not considered as fast path on a typical server, and
    eventually few cpus handle them anyway. We can afford an atomic
    operation instead of using percpu data.

    This saves 4096 bytes per cpu and per network namespace.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

12 Jun, 2011

1 commit

  • SNMP mibs use two percpu arrays, one used in BH context, another in USER
    context. With increasing number of cpus in machines, and fact that ipv6
    uses per network device ipstats_mib, this is consuming a lot of memory
    if many network devices are registered.

    commit be281e554e2a (ipv6: reduce per device ICMP mib sizes) shrinked
    percpu needs for ipv6, but we can reduce memory use a bit more.

    With recent percpu infrastructure (irqsafe_cpu_inc() ...), we no longer
    need this BH/USER separation since we can update counters in a single
    x86 instruction, regardless of the BH/USER context.

    Other arches than x86 might need to disable irq in their
    irqsafe_cpu_inc() implementation : If this happens to be a problem, we
    can make SNMP_ARRAY_SZ arch dependent, but a previous poll
    ( https://lkml.org/lkml/2011/3/17/174 ) to arch maintainers did not
    raise strong opposition.

    Only on 32bit arches, we need to disable BH for 64bit counters updates
    done from USER context (currently used for IP MIB)

    This also reduces vmlinux size :

    1) x86_64 build
    $ size vmlinux.before vmlinux.after
    text data bss dec hex filename
    7853650 1293772 1896448 11043870 a8841e vmlinux.before
    7850578 1293772 1896448 11040798 a8781e vmlinux.after

    2) i386 build
    $ size vmlinux.before vmlinux.afterpatch
    text data bss dec hex filename
    6039335 635076 3670016 10344427 9dd7eb vmlinux.before
    6037342 635076 3670016 10342434 9dd022 vmlinux.afterpatch

    Signed-off-by: Eric Dumazet
    CC: Andi Kleen
    CC: Ingo Molnar
    CC: Tejun Heo
    CC: Christoph Lameter
    CC: Benjamin Herrenschmidt

    Eric Dumazet
     

20 May, 2011

1 commit

  • ipv6 has per device ICMP SNMP counters, taking too much space because
    they use percpu storage.

    needed size per device is :
    (512+4)*sizeof(long)*number_of_possible_cpus*2

    On a 32bit kernel, 16 possible cpus, this wastes more than 64kbytes of
    memory per ipv6 enabled network device, taken in vmalloc pool.

    Since ICMP messages are rare, just use shared counters (atomic_long_t)

    Per network space ICMP counters are still using percpu memory, we might
    also convert them to shared counters in a future patch.

    Signed-off-by: Eric Dumazet
    CC: Denys Fedoryshchenko
    Signed-off-by: David S. Miller

    Eric Dumazet
     

22 Mar, 2011

1 commit


03 Dec, 2010

2 commits


01 Jul, 2010

1 commit

  • /proc/net/snmp and /proc/net/netstat expose SNMP counters.

    Width of these counters is either 32 or 64 bits, depending on the size
    of "unsigned long" in kernel.

    This means user program parsing these files must already be prepared to
    deal with 64bit values, regardless of user program being 32 or 64 bit.

    This patch introduces 64bit snmp values for IPSTAT mib, where some
    counters can wrap pretty fast if they are 32bit wide.

    # netstat -s|egrep "InOctets|OutOctets"
    InOctets: 244068329096
    OutOctets: 244069348848

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

24 Jun, 2010

1 commit

  • commit aa2ea0586d9d (tcp: fix outsegs stat for TSO segments) incorrectly
    assumed SNMP_ADD_STATS() was used from BH context.

    Fix this using mib[!in_softirq()] instead of mib[0]

    Signed-off-by: Eric Dumazet
    CC: Tom Herbert
    Signed-off-by: David S. Miller

    Eric Dumazet
     

23 Apr, 2010

1 commit


22 Mar, 2010

1 commit

  • There is no point to align or pad mibs to cache lines, they are per cpu
    allocated with a 8 bytes alignment anyway.
    This wastes space for no gain. This patch removes __SNMP_MIB_ALIGN__

    Since SNMP mibs contain "unsigned long" fields only, we can relax the
    allocation alignment from "unsigned long long" to "unsigned long"

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

17 Feb, 2010

1 commit

  • Add __percpu sparse annotations to net.

    These annotations are to make sparse consider percpu variables to be
    in a different address space and warn if accessed without going
    through percpu accessors. This patch doesn't affect normal builds.

    The macro and type tricks around snmp stats make things a bit
    interesting. DEFINE/DECLARE_SNMP_STAT() macros mark the target field
    as __percpu and SNMP_UPD_PO_STATS() macro is updated accordingly. All
    snmp_mib_*() users which used to cast the argument to (void **) are
    updated to cast it to (void __percpu **).

    Signed-off-by: Tejun Heo
    Acked-by: David S. Miller
    Cc: Patrick McHardy
    Cc: Arnaldo Carvalho de Melo
    Cc: Vlad Yasevich
    Cc: netdev@vger.kernel.org
    Signed-off-by: David S. Miller

    Tejun Heo
     

23 Jan, 2010

1 commit


03 Oct, 2009

1 commit


27 Apr, 2009

1 commit

  • The IP MIB (RFC 4293) defines stats for InOctets, OutOctets, InMcastOctets and
    OutMcastOctets:
    http://tools.ietf.org/html/rfc4293
    But it seems we don't track those in any way that easy to separate from other
    protocols. This patch adds those missing counters to the stats file. Tested
    successfully by me

    With help from Eric Dumazet.

    Signed-off-by: Neil Horman
    Signed-off-by: David S. Miller

    Neil Horman
     

12 Jun, 2008

1 commit


29 Jan, 2008

3 commits

  • This statistics is shown factor dropped by transformation
    at /proc/net/xfrm_stat for developer.
    It is a counter designed from current transformation source code
    and defined as linux private MIB.

    See Documentation/networking/xfrm_proc.txt for the detail.

    Signed-off-by: Masahide NAKAMURA
    Signed-off-by: David S. Miller

    Masahide NAKAMURA
     
  • The SNMP macros use raw_smp_processor_id() in process context
    which is illegal because the process may be preempted and then
    migrated to another CPU.

    This patch makes it use get_cpu/put_cpu to disable preemption.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • The SNMP_INC_STATS_OFFSET_BH is used only by ICMP6_INC_STATS_OFFSET_BH.
    The ICMP6_INC_STATS_OFFSET_BH is unused.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     

11 Oct, 2007

2 commits

  • Background: RFC 4293 deprecates existing individual, named ICMP
    type counters to be replaced with the ICMPMsgStatsTable. This table
    includes entries for both IPv4 and IPv6, and requires counting of all
    ICMP types, whether or not the machine implements the type.

    These patches "remove" (but not really) the existing counters, and
    replace them with the ICMPMsgStats tables for v4 and v6.
    It includes the named counters in the /proc places they were, but gets the
    values for them from the new tables. It also counts packets generated
    from raw socket output (e.g., OutEchoes, MLD queries, RA's from
    radvd, etc).

    Changes:
    1) create icmpmsg_statistics mib
    2) create icmpv6msg_statistics mib
    3) modify existing counters to use these
    4) modify /proc/net/snmp to add "IcmpMsg" with all ICMP types
    listed by number for easy SNMP parsing
    5) modify /proc/net/snmp printing for "Icmp" to get the named data
    from new counters.

    Signed-off-by: David L Stevens
    Signed-off-by: David S. Miller

    David L Stevens
     
  • Background: RFC 4293 deprecates existing individual, named ICMP
    type counters to be replaced with the ICMPMsgStatsTable. This table
    includes entries for both IPv4 and IPv6, and requires counting of all
    ICMP types, whether or not the machine implements the type.

    These patches "remove" (but not really) the existing counters, and
    replace them with the ICMPMsgStats tables for v4 and v6.
    It includes the named counters in the /proc places they were, but gets the
    values for them from the new tables. It also counts packets generated
    from raw socket output (e.g., OutEchoes, MLD queries, RA's from
    radvd, etc).

    Changes:
    1) create icmpmsg_statistics mib
    2) create icmpv6msg_statistics mib
    3) modify existing counters to use these
    4) modify /proc/net/snmp to add "IcmpMsg" with all ICMP types
    listed by number for easy SNMP parsing
    5) modify /proc/net/snmp printing for "Icmp" to get the named data
    from new counters.
    [new to 2nd revision]
    6) support per-interface ICMP stats
    7) use common macro for per-device stat macros

    Signed-off-by: David L Stevens
    Signed-off-by: David S. Miller

    David L Stevens
     

23 Sep, 2006

1 commit

  • This patch adds more statistics info under /proc/net/sctp/snmp
    that should be useful for debugging. The additional events that
    are counted now include timer expirations, retransmits, packet
    and data chunk discards.

    The Data chunk discards include all the cases where a data chunk
    is discarded including high tsn, bad stream, dup tsn and the most
    useful one(out of receive buffer/rwnd).

    Also moved the SCTP MIB data structures from the generic include
    directories to include/sctp/sctp.h.

    Signed-off-by: Sridhar Samudrala
    Signed-off-by: David S. Miller

    Sridhar Samudrala
     

22 Jun, 2005

1 commit

  • This patch implements a number of smp_processor_id() cleanup ideas that
    Arjan van de Ven and I came up with.

    The previous __smp_processor_id/_smp_processor_id/smp_processor_id API
    spaghetti was hard to follow both on the implementational and on the
    usage side.

    Some of the complexity arose from picking wrong names, some of the
    complexity comes from the fact that not all architectures defined
    __smp_processor_id.

    In the new code, there are two externally visible symbols:

    - smp_processor_id(): debug variant.

    - raw_smp_processor_id(): nondebug variant. Replaces all existing
    uses of _smp_processor_id() and __smp_processor_id(). Defined
    by every SMP architecture in include/asm-*/smp.h.

    There is one new internal symbol, dependent on DEBUG_PREEMPT:

    - debug_smp_processor_id(): internal debug variant, mapped to
    smp_processor_id().

    Also, i moved debug_smp_processor_id() from lib/kernel_lock.c into a new
    lib/smp_processor_id.c file. All related comments got updated and/or
    clarified.

    I have build/boot tested the following 8 .config combinations on x86:

    {SMP,UP} x {PREEMPT,!PREEMPT} x {DEBUG_PREEMPT,!DEBUG_PREEMPT}

    I have also build/boot tested x64 on UP/PREEMPT/DEBUG_PREEMPT. (Other
    architectures are untested, but should work just fine.)

    Signed-off-by: Ingo Molnar
    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds