20 Oct, 2007

1 commit

  • remove asm/bitops.h includes

    including asm/bitops directly may cause compile errors. don't include it
    and include linux/bitops instead. next patch will deny including asm header
    directly.

    Cc: Adrian Bunk
    Signed-off-by: Jiri Slaby
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     

11 Oct, 2007

4 commits

  • This concerns the ipv4 and ipv6 code mostly, but also the netlink
    and unix sockets.

    The netlink code is an example of how to use the __seq_open_private()
    call - it saves the net namespace on this private.

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

    Pavel Emelyanov
     
  • This patch makes /proc/net per network namespace. It modifies the global
    variables proc_net and proc_net_stat to be per network namespace.
    The proc_net file helpers are modified to take a network namespace argument,
    and all of their callers are fixed to pass &init_net for that argument.
    This ensures that all of the /proc/net files are only visible and
    usable in the initial network namespace until the code behind them
    has been updated to be handle multiple network namespaces.

    Making /proc/net per namespace is necessary as at least some files
    in /proc/net depend upon the set of network devices which is per
    network namespace, and even more files in /proc/net have contents
    that are relevant to a single network namespace.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     
  • This patch converts the messy macro for MASK_PFX to inline function
    and expands TKEY_GET_MASK in the one place it is used.

    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • Try this out:
    * replace macro's with inlines
    * get rid of places doing multiple evaluations of NODE_PARENT

    [akpm@linux-foundation.org: rcu_dereference wants an lval]

    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

20 Jul, 2007

1 commit

  • Slab destructors were no longer supported after Christoph's
    c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been
    BUGs for both slab and slub, and slob never supported them
    either.

    This rips out support for the dtor pointer from kmem_cache_create()
    completely and fixes up every single callsite in the kernel (there were
    about 224, not including the slab allocator definitions themselves,
    or the documentation references).

    Signed-off-by: Paul Mundt

    Paul Mundt
     

25 May, 2007

1 commit


26 Apr, 2007

4 commits

  • The threshold for root node can be more aggressive set to get
    better tree compression. The new setting mekes the root grow
    from 16 to 19 bits and substansial improvemnt in Aver depth
    this with the current table of 214393 prefixes

    But really the dynamic resize should need more investigation
    both in terms convergence and performance and maybe it should
    be possible to change...

    Maybe just for the brave to start with or we may have to back
    this out.

    Robert Olsson
     
  • The patch below adds break condition for the resize operations. If
    we don't achieve the desired fill factor a warning is printed. Trie
    should still be operational but new thresholds should be considered.

    Signed-off-by: Robert Olsson
    Signed-off-by: David S. Miller

    Robert Olsson
     
  • The seq_file operations stuff can be marked constant to
    get it out of dirty cache.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • Add whitespace around keywords.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

27 Mar, 2007

1 commit

  • Paul E. McKenney writes:

    > Those of use who dive into networking only occasionally would much
    > appreciate this. ;-)

    No problem here...

    Acked-by: Robert Olsson
    Signed-off-by: Paul E. McKenney (but trivial)
    Signed-off-by: David S. Miller

    Robert Olsson
     

17 Mar, 2007

1 commit

  • Hello, Just discussed this Patrick...

    We have two users of trie_leaf_remove, fn_trie_flush and fn_trie_delete
    both are holding RTNL. So there shouldn't be need for this preempt stuff.
    This is assumed to a leftover from an older RCU-take.

    > Mhh .. I think I just remembered something - me incorrectly suggesting
    > to add it there while we were talking about this at OLS :) IIRC the
    > idea was to make sure tnode_free (which at that time didn't use
    > call_rcu) wouldn't free memory while still in use in a rcu read-side
    > critical section. It should have been synchronize_rcu of course,
    > but with tnode_free using call_rcu it seems to be completely
    > unnecessary. So I guess we can simply remove it.

    Signed-off-by: Robert Olsson
    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Robert Olsson
     

15 Feb, 2007

1 commit

  • After Al Viro (finally) succeeded in removing the sched.h #include in module.h
    recently, it makes sense again to remove other superfluous sched.h includes.
    There are quite a lot of files which include it but don't actually need
    anything defined in there. Presumably these includes were once needed for
    macros that used to live in sched.h, but moved to other header files in the
    course of cleaning it up.

    To ease the pain, this time I did not fiddle with any header files and only
    removed #includes from .c-files, which tend to cause less trouble.

    Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
    arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
    allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
    configs in arch/arm/configs on arm. I also checked that no new warnings were
    introduced by the patch (actually, some warnings are removed that were emitted
    by unnecessarily included header files).

    Signed-off-by: Tim Schmielau
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     

13 Feb, 2007

1 commit

  • Many struct file_operations in the kernel can be "const". Marking them const
    moves these to the .rodata section, which avoids false sharing with potential
    dirty data. In addition it'll catch accidental writes at compile time to
    these shared resources.

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

    Arjan van de Ven
     

11 Feb, 2007

1 commit


27 Jan, 2007

1 commit


25 Jan, 2007

1 commit

  • In a kernel with trie routing enabled I had a simple routing setup
    with only a single route to the outside world and no default
    route. "ip route table list main" showed my the route just fine but
    /proc/net/route was an empty file. What was going on?

    Thinking it was a bug in something I did and I looked deeper. Eventually
    I setup a second route and everything looked correct, huh? Finally I
    realized that the it was just the iterator pair in fib_trie_get_first,
    fib_trie_get_next just could not handle a routing table with a single entry.

    So to save myself and others further confusion, here is a simple fix for
    the fib proc iterator so it works even when there is only a single route
    in a routing table.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Robert Olsson
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

08 Dec, 2006

2 commits

  • Replace all uses of kmem_cache_t with struct kmem_cache.

    The patch was generated using the following script:

    #!/bin/sh
    #
    # Replace one string by another in all the kernel sources.
    #

    set -e

    for file in `find * -name "*.c" -o -name "*.h"|xargs grep -l $1`; do
    quilt add $file
    sed -e "1,\$s/$1/$2/g" $file >/tmp/$$
    mv /tmp/$$ $file
    quilt refresh
    done

    The script was run like this

    sh replace kmem_cache_t "struct kmem_cache"

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • SLAB_KERNEL is an alias of GFP_KERNEL.

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

29 Sep, 2006

1 commit


23 Sep, 2006

4 commits


20 Sep, 2006

1 commit


13 Jul, 2006

1 commit


01 Jul, 2006

1 commit


10 Apr, 2006

1 commit

  • Seems like leaf (end-nodes) has been freed by __tnode_free_rcu and not
    by __leaf_free_rcu. This fixes the problem. Only tnode_free is now
    used which checks for appropriate node type. free_leaf can be removed.

    Signed-off-by: Robert Olsson
    Signed-off-by: David S. Miller

    Robert Olsson
     

21 Mar, 2006

2 commits


04 Jan, 2006

2 commits


21 Nov, 2005

1 commit


26 Oct, 2005

1 commit

  • This patch kills a redundant rcu_dereference on fa->fa_info in fib_trie.c.
    As this dereference directly follows a list_for_each_entry_rcu line, we
    have already taken a read barrier with respect to getting an entry from
    the list.

    This read barrier guarantees that all values read out of fa are valid.
    In particular, the contents of structure pointed to by fa->fa_info is
    initialised before fa->fa_info is actually set (see fn_trie_insert);
    the setting of fa->fa_info itself is further separated with a write
    barrier from the insertion of fa into the list.

    Therefore by taking a read barrier after obtaining fa from the list
    (which is given by list_for_each_entry_rcu), we can be sure that
    fa->fa_info contains a valid pointer, as well as the fact that the
    data pointed to by fa->fa_info is itself valid.

    Signed-off-by: Herbert Xu
    Acked-by: Paul E. McKenney
    Signed-off-by: David S. Miller
    Signed-off-by: Arnaldo Carvalho de Melo

    Herbert Xu
     

05 Oct, 2005

1 commit

  • The patch below introduces special thresholds to keep root node in the trie
    large. This gives a flatter tree at the cost of a modest memory increase.
    Overall it seems to be gain and this was also proposed by one the authors
    of the paper in recent a seminar.

    Main table after loading 123 k routes.

    Aver depth: 3.30
    Max depth: 9
    Root-node size 12 bits
    Total size: 4044 kB

    With the patch:
    Aver depth: 2.78
    Max depth: 8
    Root-node size 15 bits
    Total size: 4150 kB

    An increase of 8-10% was seen in forwading performance for an rDoS attack.

    Signed-off-by: Robert Olsson
    Signed-off-by: David S. Miller

    Robert Olsson
     

21 Sep, 2005

1 commit

  • Cleanup the printk's in fib_trie:
    * Convert a couple of places in the dump code to BUG_ON
    * Put log level's on each message
    The version message really needed the message since it leaks out
    on the pretty Fedora bootup.

    Signed-off-by: Stephen Hemminger
    Acked-by: Robert Olsson ,
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

20 Sep, 2005

2 commits


10 Sep, 2005

1 commit

  • Create one iterator for walking over FIB trie, and use it
    for all the /proc functions. Add a /proc/net/route
    output for backwards compatibility with old applications.

    Make initialization of fib_trie same as fib_hash so no #ifdef
    is needed in af_inet.c

    Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=5209

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger