Skip to content

: namespace refcounting cleanup

Denis V. Lunev containers netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8: Make netns refconting debug like a socket one.include/net/net_namespace.h net/core/net_namespace.c+30 -162 replies
2/8: Add netns refcnt debug for kernel sockets.include/net/sock.h net/core/sock.c+2 -10 replies
3/8: Add netns refcnt debug for timewait buckets.net/ipv4/inet_timewait_sock.c+2 -10 replies
4/8: Add netns refcnt debug into fib_info.net/ipv4/fib_semantics.c+2 -10 replies
5/8: Add netns refcnt debug for inet bind buckets.net/ipv4/inet_hashtables.c+2 -10 replies
6/8: Add netns refcnt debug for dst ops.net/ipv6/route.c+3 -10 replies
7/8: Add netns refcnt debug to fib rules.include/net/fib_rules.h net/core/fib_rules.c+4 -20 replies
8/8: Add netns refcnt debug for network devices.include/linux/netdevice.h net/core/dev.c+4 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/8 net-2.6.26] [NETNS]: namespace refcounting cleanup

Network namespace has two referrence counters:
- count
- use_count.
The namespace is scheduled to destruction automatically when the count becomes 0.

There are several SLAB objects with a pointer to a namespace on them. These objects are cleaned up during namespace stop. Some of them increment use_count, some don't. This set fixes this discrepancy, i.e. now all such objects increment the use_count.

Though, the use_count itself is used in a very debug manner and checked only during namespace stop. So, I have placed it under NETNS_REFCNT_DEBUG definition exactly like this is done for socket refcounting code to remove extra atomic from any possible fast paths.