02 Dec, 2009

10 commits

  • Take advantage of the new pernet automatic storage management,
    and stop using compatibility network namespace functions.

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

    Eric W. Biederman
     
  • Take advantage of the new pernet automatic storage management,
    and stop using compatibility network namespace functions.

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

    Eric W. Biederman
     
  • Take advantage of the new pernet automatic storage management,
    and stop using compatibility network namespace functions.

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

    Eric W. Biederman
     
  • - Defer dellink to net_cleanup() allowing for batching.
    - Fix comment.
    - Use for_each_netdev_safe again as dev_change_net_namespace touches
    at most one network device (unlike veth dellink).

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

    Eric W. Biederman
     
  • Defer calling unregister_netdevice_queue to cleanup_net. It's simpler
    and it allows the loopback device to land in the same batch as other
    network devices.

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

    Eric W. Biederman
     
  • To get the full benefit of batched network namespace cleanup netowrk
    device deletion needs to be performed by the generic code. When
    using register_pernet_gen_device and freeing the data in exit_net
    it is impossible to delay allocation until after exit_net has called
    as the device uninit methods are no longer safe.

    To correct this, and to simplify working with per network namespace data
    I have moved allocation and deletion of per network namespace data into
    the network namespace core. The core now frees the data only after
    all of the network namespace exit routines have run.

    Now it is only required to set the new fields .id and .size
    in the pernet_operations structure if you want network namespace
    data to be managed for you automatically.

    This makes the current register_pernet_gen_device and
    register_pernet_gen_subsys routines unnecessary. For the moment
    I have left them as compatibility wrappers in net_namespace.h
    They will be removed once all of the users have been updated.

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

    Eric W. Biederman
     
  • It is fairly common to kill several network namespaces at once. Either
    because they are nested one inside the other or because they are cooperating
    in multiple machine networking experiments. As the network stack control logic
    does not parallelize easily batch up multiple network namespaces existing
    together.

    To get the full benefit of batching the virtual network devices to be
    removed must be all removed in one batch. For that purpose I have added
    a loop after the last network device operations have run that batches
    up all remaining network devices and deletes them.

    An extra benefit is that the reorganization slightly shrinks the size
    of the per network namespace data structures replaceing a work_struct
    with a list_head.

    In a trivial test with 4K namespaces this change reduced the cost of
    a destroying 4K namespaces from 7+ minutes (at 12% cpu) to 44 seconds
    (at 60% cpu). The bulk of that 44s was spent in inet_twsk_purge.

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

    Eric W. Biederman
     
  • I will need this shortly to implement network namespace shutdown
    batching. For sanity sake network devices should be removed in
    the reverse order they were created in.

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

    Eric W. Biederman
     
  • The motivation for an additional notifier in batched netdevice
    notification (rt_do_flush) only needs to be called once per batch not
    once per namespace.

    For further batching improvements I need a guarantee that the
    netdevices are unregistered in order allowing me to unregister an all
    of the network devices in a network namespace at the same time with
    the guarantee that the loopback device is really and truly
    unregistered last.

    Additionally it appears that we moved the route cache flush after
    the final synchronize_net, which seems wrong and there was no
    explanation. So I have restored the original location of the final
    synchronize_net.

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

    Eric W. Biederman
     
  • Reported-by: Jean-Mickael Guerin
    Signed-off-by: Arnaldo Carvalho de Melo
    Acked-by: Ralf Baechle
    Signed-off-by: David S. Miller

    Arnaldo Carvalho de Melo
     

30 Nov, 2009

29 commits


29 Nov, 2009

1 commit

  • pktgen threads are bound to given CPU, we can allocate memory for
    these threads in a NUMA aware way.

    After a pktgen session on two threads, we can check flows memory was
    allocated on right node, instead of a not related one.

    # grep pktgen_thread_write /proc/vmallocinfo
    0xffffc90007204000-0xffffc90007385000 1576960 pktgen_thread_write+0x3a4/0x6b0 [pktgen] pages=384 vmalloc N0=384
    0xffffc90007386000-0xffffc90007507000 1576960 pktgen_thread_write+0x3a4/0x6b0 [pktgen] pages=384 vmalloc N1=384

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

    Eric Dumazet