diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 02:30:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 02:30:30 -0500 |
commit | 5e30025a319910695f5010dc0fb53a23299da14d (patch) | |
tree | 4292bcf78de221c7de1774ccf5ad0ac5a9315c26 /net/ipv4 | |
parent | 7971e23a66c94f1b9bd2d64a3e86dfbfa8c60121 (diff) | |
parent | 90d3839b90fe379557dae4a44735a6af78f42885 (diff) |
Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull core locking changes from Ingo Molnar:
"The biggest changes:
- add lockdep support for seqcount/seqlocks structures, this
unearthed both bugs and required extra annotation.
- move the various kernel locking primitives to the new
kernel/locking/ directory"
* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits)
block: Use u64_stats_init() to initialize seqcounts
locking/lockdep: Mark __lockdep_count_forward_deps() as static
lockdep/proc: Fix lock-time avg computation
locking/doc: Update references to kernel/mutex.c
ipv6: Fix possible ipv6 seqlock deadlock
cpuset: Fix potential deadlock w/ set_mems_allowed
seqcount: Add lockdep functionality to seqcount/seqlock structures
net: Explicitly initialize u64_stats_sync structures for lockdep
locking: Move the percpu-rwsem code to kernel/locking/
locking: Move the lglocks code to kernel/locking/
locking: Move the rwsem code to kernel/locking/
locking: Move the rtmutex code to kernel/locking/
locking: Move the semaphore core to kernel/locking/
locking: Move the spinlock code to kernel/locking/
locking: Move the lockdep code to kernel/locking/
locking: Move the mutex code to kernel/locking/
hung_task debugging: Add tracepoint to report the hang
x86/locking/kconfig: Update paravirt spinlock Kconfig description
lockstat: Report avg wait and hold times
lockdep, x86/alternatives: Drop ancient lockdep fixup message
...
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/af_inet.c | 14 | ||||
-rw-r--r-- | net/ipv4/ip_tunnel.c | 8 |
2 files changed, 21 insertions, 1 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 68af9aac91d0..70011e029ac1 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1503,6 +1503,7 @@ int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align) | |||
1503 | ptr[0] = __alloc_percpu(mibsize, align); | 1503 | ptr[0] = __alloc_percpu(mibsize, align); |
1504 | if (!ptr[0]) | 1504 | if (!ptr[0]) |
1505 | return -ENOMEM; | 1505 | return -ENOMEM; |
1506 | |||
1506 | #if SNMP_ARRAY_SZ == 2 | 1507 | #if SNMP_ARRAY_SZ == 2 |
1507 | ptr[1] = __alloc_percpu(mibsize, align); | 1508 | ptr[1] = __alloc_percpu(mibsize, align); |
1508 | if (!ptr[1]) { | 1509 | if (!ptr[1]) { |
@@ -1547,6 +1548,8 @@ static const struct net_protocol icmp_protocol = { | |||
1547 | 1548 | ||
1548 | static __net_init int ipv4_mib_init_net(struct net *net) | 1549 | static __net_init int ipv4_mib_init_net(struct net *net) |
1549 | { | 1550 | { |
1551 | int i; | ||
1552 | |||
1550 | if (snmp_mib_init((void __percpu **)net->mib.tcp_statistics, | 1553 | if (snmp_mib_init((void __percpu **)net->mib.tcp_statistics, |
1551 | sizeof(struct tcp_mib), | 1554 | sizeof(struct tcp_mib), |
1552 | __alignof__(struct tcp_mib)) < 0) | 1555 | __alignof__(struct tcp_mib)) < 0) |
@@ -1555,6 +1558,17 @@ static __net_init int ipv4_mib_init_net(struct net *net) | |||
1555 | sizeof(struct ipstats_mib), | 1558 | sizeof(struct ipstats_mib), |
1556 | __alignof__(struct ipstats_mib)) < 0) | 1559 | __alignof__(struct ipstats_mib)) < 0) |
1557 | goto err_ip_mib; | 1560 | goto err_ip_mib; |
1561 | |||
1562 | for_each_possible_cpu(i) { | ||
1563 | struct ipstats_mib *af_inet_stats; | ||
1564 | af_inet_stats = per_cpu_ptr(net->mib.ip_statistics[0], i); | ||
1565 | u64_stats_init(&af_inet_stats->syncp); | ||
1566 | #if SNMP_ARRAY_SZ == 2 | ||
1567 | af_inet_stats = per_cpu_ptr(net->mib.ip_statistics[1], i); | ||
1568 | u64_stats_init(&af_inet_stats->syncp); | ||
1569 | #endif | ||
1570 | } | ||
1571 | |||
1558 | if (snmp_mib_init((void __percpu **)net->mib.net_statistics, | 1572 | if (snmp_mib_init((void __percpu **)net->mib.net_statistics, |
1559 | sizeof(struct linux_mib), | 1573 | sizeof(struct linux_mib), |
1560 | __alignof__(struct linux_mib)) < 0) | 1574 | __alignof__(struct linux_mib)) < 0) |
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index 63a6d6d6b875..caf01176a5e4 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c | |||
@@ -976,13 +976,19 @@ int ip_tunnel_init(struct net_device *dev) | |||
976 | { | 976 | { |
977 | struct ip_tunnel *tunnel = netdev_priv(dev); | 977 | struct ip_tunnel *tunnel = netdev_priv(dev); |
978 | struct iphdr *iph = &tunnel->parms.iph; | 978 | struct iphdr *iph = &tunnel->parms.iph; |
979 | int err; | 979 | int i, err; |
980 | 980 | ||
981 | dev->destructor = ip_tunnel_dev_free; | 981 | dev->destructor = ip_tunnel_dev_free; |
982 | dev->tstats = alloc_percpu(struct pcpu_tstats); | 982 | dev->tstats = alloc_percpu(struct pcpu_tstats); |
983 | if (!dev->tstats) | 983 | if (!dev->tstats) |
984 | return -ENOMEM; | 984 | return -ENOMEM; |
985 | 985 | ||
986 | for_each_possible_cpu(i) { | ||
987 | struct pcpu_tstats *ipt_stats; | ||
988 | ipt_stats = per_cpu_ptr(dev->tstats, i); | ||
989 | u64_stats_init(&ipt_stats->syncp); | ||
990 | } | ||
991 | |||
986 | err = gro_cells_init(&tunnel->gro_cells, dev); | 992 | err = gro_cells_init(&tunnel->gro_cells, dev); |
987 | if (err) { | 993 | if (err) { |
988 | free_percpu(dev->tstats); | 994 | free_percpu(dev->tstats); |