From: Christoph Lameter <clameter@sgi.com>
To: akpm@linux-foundation.org
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
David Miller <davem@davemloft.net>,
Eric Dumazet <dada1@cosmosbay.com>,
Peter Zijlstra <peterz@infradead.org>,
Rusty Russell <rusty@rustcorp.com.au>,
Mike Travis <travis@sgi.com>
Subject: [patch 26/41] cpu alloc: Convert mib handling to cpu alloc
Date: Thu, 29 May 2008 20:56:46 -0700 [thread overview]
Message-ID: <20080530040019.799353964@sgi.com> (raw)
In-Reply-To: 20080530035620.587204923@sgi.com
[-- Attachment #1: cpu_alloc_mib_handling_conversion --]
[-- Type: text/plain, Size: 9614 bytes --]
Use the cpu alloc functions for the mib handling functions in the net
layer. The API for snmp_mib_free() is changed to add a size parameter
since cpu_free() requires a size parameter.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
include/net/ip.h | 2 +-
include/net/snmp.h | 32 ++++++++------------------------
net/dccp/proto.c | 2 +-
net/ipv4/af_inet.c | 31 +++++++++++++++++--------------
net/ipv6/addrconf.c | 11 ++++++-----
net/ipv6/af_inet6.c | 20 +++++++++++---------
net/sctp/protocol.c | 2 +-
net/xfrm/xfrm_proc.c | 4 ++--
8 files changed, 47 insertions(+), 57 deletions(-)
Index: linux-2.6/include/net/ip.h
===================================================================
--- linux-2.6.orig/include/net/ip.h 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/include/net/ip.h 2008-05-29 20:15:34.000000000 -0700
@@ -170,7 +170,7 @@ DECLARE_SNMP_STAT(struct linux_mib, net_
extern unsigned long snmp_fold_field(void *mib[], int offt);
extern int snmp_mib_init(void *ptr[2], size_t mibsize);
-extern void snmp_mib_free(void *ptr[2]);
+extern void snmp_mib_free(void *ptr[2], size_t mibsize);
extern void inet_get_local_port_range(int *low, int *high);
Index: linux-2.6/include/net/snmp.h
===================================================================
--- linux-2.6.orig/include/net/snmp.h 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/include/net/snmp.h 2008-05-29 20:15:34.000000000 -0700
@@ -138,29 +138,13 @@ struct linux_xfrm_mib {
#define SNMP_STAT_BHPTR(name) (name[0])
#define SNMP_STAT_USRPTR(name) (name[1])
-#define SNMP_INC_STATS_BH(mib, field) \
- (per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field]++)
-#define SNMP_INC_STATS_USER(mib, field) \
- do { \
- per_cpu_ptr(mib[1], get_cpu())->mibs[field]++; \
- put_cpu(); \
- } while (0)
-#define SNMP_INC_STATS(mib, field) \
- do { \
- per_cpu_ptr(mib[!in_softirq()], get_cpu())->mibs[field]++; \
- put_cpu(); \
- } while (0)
-#define SNMP_DEC_STATS(mib, field) \
- do { \
- per_cpu_ptr(mib[!in_softirq()], get_cpu())->mibs[field]--; \
- put_cpu(); \
- } while (0)
-#define SNMP_ADD_STATS_BH(mib, field, addend) \
- (per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field] += addend)
-#define SNMP_ADD_STATS_USER(mib, field, addend) \
- do { \
- per_cpu_ptr(mib[1], get_cpu())->mibs[field] += addend; \
- put_cpu(); \
- } while (0)
+#define SNMP_INC_STATS_BH(mib, field) __CPU_INC(mib[0]->mibs[field])
+#define SNMP_INC_STATS_USER(mib, field) _CPU_INC(mib[1]->mibs[field])
+#define SNMP_INC_STATS(mib, field) _CPU_INC(mib[!in_softirq()]->mibs[field])
+#define SNMP_DEC_STATS(mib, field) _CPU_DEC(mib[!in_softirq()]->mibs[field])
+#define SNMP_ADD_STATS_BH(mib, field, addend) \
+ __CPU_ADD(mib[0]->mibs[field], addend)
+#define SNMP_ADD_STATS_USER(mib, field, addend) \
+ _CPU_ADD(mib[1]->mibs[field], addend)
#endif
Index: linux-2.6/net/ipv4/af_inet.c
===================================================================
--- linux-2.6.orig/net/ipv4/af_inet.c 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/net/ipv4/af_inet.c 2008-05-29 20:15:34.000000000 -0700
@@ -1279,8 +1279,8 @@ unsigned long snmp_fold_field(void *mib[
int i;
for_each_possible_cpu(i) {
- res += *(((unsigned long *) per_cpu_ptr(mib[0], i)) + offt);
- res += *(((unsigned long *) per_cpu_ptr(mib[1], i)) + offt);
+ res += *(((unsigned long *) CPU_PTR(mib[0], i)) + offt);
+ res += *(((unsigned long *) CPU_PTR(mib[1], i)) + offt);
}
return res;
}
@@ -1289,26 +1289,28 @@ EXPORT_SYMBOL_GPL(snmp_fold_field);
int snmp_mib_init(void *ptr[2], size_t mibsize)
{
BUG_ON(ptr == NULL);
- ptr[0] = __alloc_percpu(mibsize);
+ ptr[0] = cpu_alloc(mibsize, GFP_KERNEL | __GFP_ZERO,
+ L1_CACHE_BYTES);
if (!ptr[0])
goto err0;
- ptr[1] = __alloc_percpu(mibsize);
+ ptr[1] = cpu_alloc(mibsize, GFP_KERNEL | __GFP_ZERO,
+ L1_CACHE_BYTES);
if (!ptr[1])
goto err1;
return 0;
err1:
- free_percpu(ptr[0]);
+ cpu_free(ptr[0], mibsize);
ptr[0] = NULL;
err0:
return -ENOMEM;
}
EXPORT_SYMBOL_GPL(snmp_mib_init);
-void snmp_mib_free(void *ptr[2])
+void snmp_mib_free(void *ptr[2], size_t mibsize)
{
BUG_ON(ptr == NULL);
- free_percpu(ptr[0]);
- free_percpu(ptr[1]);
+ cpu_free(ptr[0], mibsize);
+ cpu_free(ptr[1], mibsize);
ptr[0] = ptr[1] = NULL;
}
EXPORT_SYMBOL_GPL(snmp_mib_free);
@@ -1370,17 +1372,18 @@ static int __init init_ipv4_mibs(void)
return 0;
err_udplite_mib:
- snmp_mib_free((void **)udp_statistics);
+ snmp_mib_free((void **)udp_statistics, sizeof(struct udp_mib));
err_udp_mib:
- snmp_mib_free((void **)tcp_statistics);
+ snmp_mib_free((void **)tcp_statistics, sizeof(struct tcp_mib));
err_tcp_mib:
- snmp_mib_free((void **)icmpmsg_statistics);
+ snmp_mib_free((void **)icmpmsg_statistics,
+ sizeof(struct icmpmsg_mib));
err_icmpmsg_mib:
- snmp_mib_free((void **)icmp_statistics);
+ snmp_mib_free((void **)icmp_statistics, sizeof(struct icmp_mib));
err_icmp_mib:
- snmp_mib_free((void **)ip_statistics);
+ snmp_mib_free((void **)ip_statistics, sizeof(struct ipstats_mib));
err_ip_mib:
- snmp_mib_free((void **)net_statistics);
+ snmp_mib_free((void **)net_statistics, sizeof(struct linux_mib));
err_net_mib:
return -ENOMEM;
}
Index: linux-2.6/net/ipv6/addrconf.c
===================================================================
--- linux-2.6.orig/net/ipv6/addrconf.c 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/net/ipv6/addrconf.c 2008-05-29 20:16:35.000000000 -0700
@@ -279,18 +279,19 @@ static int snmp6_alloc_dev(struct inet6_
return 0;
err_icmpmsg:
- snmp_mib_free((void **)idev->stats.icmpv6);
+ snmp_mib_free((void **)idev->stats.icmpv6, sizeof(struct icmpv6_mib));
err_icmp:
- snmp_mib_free((void **)idev->stats.ipv6);
+ snmp_mib_free((void **)idev->stats.ipv6, sizeof(struct ipstats_mib));
err_ip:
return -ENOMEM;
}
static void snmp6_free_dev(struct inet6_dev *idev)
{
- snmp_mib_free((void **)idev->stats.icmpv6msg);
- snmp_mib_free((void **)idev->stats.icmpv6);
- snmp_mib_free((void **)idev->stats.ipv6);
+ snmp_mib_free((void **)idev->stats.icmpv6msg,
+ sizeof(struct icmpv6msg_mib));
+ snmp_mib_free((void **)idev->stats.icmpv6, sizeof(struct icmpv6_mib));
+ snmp_mib_free((void **)idev->stats.ipv6, sizeof(struct ipstats_mib));
}
/* Nobody refers to this device, we may destroy it. */
Index: linux-2.6/net/ipv6/af_inet6.c
===================================================================
--- linux-2.6.orig/net/ipv6/af_inet6.c 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/net/ipv6/af_inet6.c 2008-05-29 20:17:39.000000000 -0700
@@ -822,13 +822,14 @@ static int __init init_ipv6_mibs(void)
return 0;
err_udplite_mib:
- snmp_mib_free((void **)udp_stats_in6);
+ snmp_mib_free((void **)udp_stats_in6, sizeof(struct udp_mib));
err_udp_mib:
- snmp_mib_free((void **)icmpv6msg_statistics);
+ snmp_mib_free((void **)icmpv6msg_statistics,
+ sizeof(struct icmpv6msg_mib));
err_icmpmsg_mib:
- snmp_mib_free((void **)icmpv6_statistics);
+ snmp_mib_free((void **)icmpv6_statistics, sizeof(struct icmpv6_mib));
err_icmp_mib:
- snmp_mib_free((void **)ipv6_statistics);
+ snmp_mib_free((void **)ipv6_statistics, sizeof(struct ipstats_mib));
err_ip_mib:
return -ENOMEM;
@@ -836,11 +837,12 @@ err_ip_mib:
static void cleanup_ipv6_mibs(void)
{
- snmp_mib_free((void **)ipv6_statistics);
- snmp_mib_free((void **)icmpv6_statistics);
- snmp_mib_free((void **)icmpv6msg_statistics);
- snmp_mib_free((void **)udp_stats_in6);
- snmp_mib_free((void **)udplite_stats_in6);
+ snmp_mib_free((void **)ipv6_statistics, sizeof(struct ipstats_mib));
+ snmp_mib_free((void **)icmpv6_statistics, sizeof(struct icmpv6_mib));
+ snmp_mib_free((void **)icmpv6msg_statistics,
+ sizeof(struct icmpv6msg_mib));
+ snmp_mib_free((void **)udp_stats_in6, sizeof(struct udp_mib));
+ snmp_mib_free((void **)udplite_stats_in6, sizeof(struct udp_mib));
}
static int inet6_net_init(struct net *net)
Index: linux-2.6/net/dccp/proto.c
===================================================================
--- linux-2.6.orig/net/dccp/proto.c 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/net/dccp/proto.c 2008-05-29 20:18:05.000000000 -0700
@@ -1016,7 +1016,7 @@ static inline int dccp_mib_init(void)
static inline void dccp_mib_exit(void)
{
- snmp_mib_free((void**)dccp_statistics);
+ snmp_mib_free((void **)dccp_statistics, sizeof(struct dccp_mib));
}
static int thash_entries;
Index: linux-2.6/net/sctp/protocol.c
===================================================================
--- linux-2.6.orig/net/sctp/protocol.c 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/net/sctp/protocol.c 2008-05-29 20:18:21.000000000 -0700
@@ -981,7 +981,7 @@ static inline int init_sctp_mibs(void)
static inline void cleanup_sctp_mibs(void)
{
- snmp_mib_free((void**)sctp_statistics);
+ snmp_mib_free((void **)sctp_statistics, sizeof(struct sctp_mib));
}
static void sctp_v4_pf_init(void)
Index: linux-2.6/net/xfrm/xfrm_proc.c
===================================================================
--- linux-2.6.orig/net/xfrm/xfrm_proc.c 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/net/xfrm/xfrm_proc.c 2008-05-29 20:19:10.000000000 -0700
@@ -51,8 +51,8 @@ fold_field(void *mib[], int offt)
int i;
for_each_possible_cpu(i) {
- res += *(((unsigned long *)per_cpu_ptr(mib[0], i)) + offt);
- res += *(((unsigned long *)per_cpu_ptr(mib[1], i)) + offt);
+ res += *(((unsigned long *)CPU_PTR(mib[0], i)) + offt);
+ res += *(((unsigned long *)CPU_PTR(mib[1], i)) + offt);
}
return res;
}
--
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Lameter <clameter@sgi.com>
To: akpm@linux-foundation.org
Cc: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: David Miller <davem@davemloft.net>
Cc: Eric Dumazet <dada1@cosmosbay.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Mike Travis <travis@sgi.com>
Subject: [patch 26/41] cpu alloc: Convert mib handling to cpu alloc
Date: Thu, 29 May 2008 20:56:46 -0700 [thread overview]
Message-ID: <20080530040019.799353964@sgi.com> (raw)
In-Reply-To: 20080530035620.587204923@sgi.com
[-- Attachment #1: cpu_alloc_mib_handling_conversion --]
[-- Type: text/plain, Size: 9614 bytes --]
Use the cpu alloc functions for the mib handling functions in the net
layer. The API for snmp_mib_free() is changed to add a size parameter
since cpu_free() requires a size parameter.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
include/net/ip.h | 2 +-
include/net/snmp.h | 32 ++++++++------------------------
net/dccp/proto.c | 2 +-
net/ipv4/af_inet.c | 31 +++++++++++++++++--------------
net/ipv6/addrconf.c | 11 ++++++-----
net/ipv6/af_inet6.c | 20 +++++++++++---------
net/sctp/protocol.c | 2 +-
net/xfrm/xfrm_proc.c | 4 ++--
8 files changed, 47 insertions(+), 57 deletions(-)
Index: linux-2.6/include/net/ip.h
===================================================================
--- linux-2.6.orig/include/net/ip.h 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/include/net/ip.h 2008-05-29 20:15:34.000000000 -0700
@@ -170,7 +170,7 @@ DECLARE_SNMP_STAT(struct linux_mib, net_
extern unsigned long snmp_fold_field(void *mib[], int offt);
extern int snmp_mib_init(void *ptr[2], size_t mibsize);
-extern void snmp_mib_free(void *ptr[2]);
+extern void snmp_mib_free(void *ptr[2], size_t mibsize);
extern void inet_get_local_port_range(int *low, int *high);
Index: linux-2.6/include/net/snmp.h
===================================================================
--- linux-2.6.orig/include/net/snmp.h 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/include/net/snmp.h 2008-05-29 20:15:34.000000000 -0700
@@ -138,29 +138,13 @@ struct linux_xfrm_mib {
#define SNMP_STAT_BHPTR(name) (name[0])
#define SNMP_STAT_USRPTR(name) (name[1])
-#define SNMP_INC_STATS_BH(mib, field) \
- (per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field]++)
-#define SNMP_INC_STATS_USER(mib, field) \
- do { \
- per_cpu_ptr(mib[1], get_cpu())->mibs[field]++; \
- put_cpu(); \
- } while (0)
-#define SNMP_INC_STATS(mib, field) \
- do { \
- per_cpu_ptr(mib[!in_softirq()], get_cpu())->mibs[field]++; \
- put_cpu(); \
- } while (0)
-#define SNMP_DEC_STATS(mib, field) \
- do { \
- per_cpu_ptr(mib[!in_softirq()], get_cpu())->mibs[field]--; \
- put_cpu(); \
- } while (0)
-#define SNMP_ADD_STATS_BH(mib, field, addend) \
- (per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field] += addend)
-#define SNMP_ADD_STATS_USER(mib, field, addend) \
- do { \
- per_cpu_ptr(mib[1], get_cpu())->mibs[field] += addend; \
- put_cpu(); \
- } while (0)
+#define SNMP_INC_STATS_BH(mib, field) __CPU_INC(mib[0]->mibs[field])
+#define SNMP_INC_STATS_USER(mib, field) _CPU_INC(mib[1]->mibs[field])
+#define SNMP_INC_STATS(mib, field) _CPU_INC(mib[!in_softirq()]->mibs[field])
+#define SNMP_DEC_STATS(mib, field) _CPU_DEC(mib[!in_softirq()]->mibs[field])
+#define SNMP_ADD_STATS_BH(mib, field, addend) \
+ __CPU_ADD(mib[0]->mibs[field], addend)
+#define SNMP_ADD_STATS_USER(mib, field, addend) \
+ _CPU_ADD(mib[1]->mibs[field], addend)
#endif
Index: linux-2.6/net/ipv4/af_inet.c
===================================================================
--- linux-2.6.orig/net/ipv4/af_inet.c 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/net/ipv4/af_inet.c 2008-05-29 20:15:34.000000000 -0700
@@ -1279,8 +1279,8 @@ unsigned long snmp_fold_field(void *mib[
int i;
for_each_possible_cpu(i) {
- res += *(((unsigned long *) per_cpu_ptr(mib[0], i)) + offt);
- res += *(((unsigned long *) per_cpu_ptr(mib[1], i)) + offt);
+ res += *(((unsigned long *) CPU_PTR(mib[0], i)) + offt);
+ res += *(((unsigned long *) CPU_PTR(mib[1], i)) + offt);
}
return res;
}
@@ -1289,26 +1289,28 @@ EXPORT_SYMBOL_GPL(snmp_fold_field);
int snmp_mib_init(void *ptr[2], size_t mibsize)
{
BUG_ON(ptr == NULL);
- ptr[0] = __alloc_percpu(mibsize);
+ ptr[0] = cpu_alloc(mibsize, GFP_KERNEL | __GFP_ZERO,
+ L1_CACHE_BYTES);
if (!ptr[0])
goto err0;
- ptr[1] = __alloc_percpu(mibsize);
+ ptr[1] = cpu_alloc(mibsize, GFP_KERNEL | __GFP_ZERO,
+ L1_CACHE_BYTES);
if (!ptr[1])
goto err1;
return 0;
err1:
- free_percpu(ptr[0]);
+ cpu_free(ptr[0], mibsize);
ptr[0] = NULL;
err0:
return -ENOMEM;
}
EXPORT_SYMBOL_GPL(snmp_mib_init);
-void snmp_mib_free(void *ptr[2])
+void snmp_mib_free(void *ptr[2], size_t mibsize)
{
BUG_ON(ptr == NULL);
- free_percpu(ptr[0]);
- free_percpu(ptr[1]);
+ cpu_free(ptr[0], mibsize);
+ cpu_free(ptr[1], mibsize);
ptr[0] = ptr[1] = NULL;
}
EXPORT_SYMBOL_GPL(snmp_mib_free);
@@ -1370,17 +1372,18 @@ static int __init init_ipv4_mibs(void)
return 0;
err_udplite_mib:
- snmp_mib_free((void **)udp_statistics);
+ snmp_mib_free((void **)udp_statistics, sizeof(struct udp_mib));
err_udp_mib:
- snmp_mib_free((void **)tcp_statistics);
+ snmp_mib_free((void **)tcp_statistics, sizeof(struct tcp_mib));
err_tcp_mib:
- snmp_mib_free((void **)icmpmsg_statistics);
+ snmp_mib_free((void **)icmpmsg_statistics,
+ sizeof(struct icmpmsg_mib));
err_icmpmsg_mib:
- snmp_mib_free((void **)icmp_statistics);
+ snmp_mib_free((void **)icmp_statistics, sizeof(struct icmp_mib));
err_icmp_mib:
- snmp_mib_free((void **)ip_statistics);
+ snmp_mib_free((void **)ip_statistics, sizeof(struct ipstats_mib));
err_ip_mib:
- snmp_mib_free((void **)net_statistics);
+ snmp_mib_free((void **)net_statistics, sizeof(struct linux_mib));
err_net_mib:
return -ENOMEM;
}
Index: linux-2.6/net/ipv6/addrconf.c
===================================================================
--- linux-2.6.orig/net/ipv6/addrconf.c 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/net/ipv6/addrconf.c 2008-05-29 20:16:35.000000000 -0700
@@ -279,18 +279,19 @@ static int snmp6_alloc_dev(struct inet6_
return 0;
err_icmpmsg:
- snmp_mib_free((void **)idev->stats.icmpv6);
+ snmp_mib_free((void **)idev->stats.icmpv6, sizeof(struct icmpv6_mib));
err_icmp:
- snmp_mib_free((void **)idev->stats.ipv6);
+ snmp_mib_free((void **)idev->stats.ipv6, sizeof(struct ipstats_mib));
err_ip:
return -ENOMEM;
}
static void snmp6_free_dev(struct inet6_dev *idev)
{
- snmp_mib_free((void **)idev->stats.icmpv6msg);
- snmp_mib_free((void **)idev->stats.icmpv6);
- snmp_mib_free((void **)idev->stats.ipv6);
+ snmp_mib_free((void **)idev->stats.icmpv6msg,
+ sizeof(struct icmpv6msg_mib));
+ snmp_mib_free((void **)idev->stats.icmpv6, sizeof(struct icmpv6_mib));
+ snmp_mib_free((void **)idev->stats.ipv6, sizeof(struct ipstats_mib));
}
/* Nobody refers to this device, we may destroy it. */
Index: linux-2.6/net/ipv6/af_inet6.c
===================================================================
--- linux-2.6.orig/net/ipv6/af_inet6.c 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/net/ipv6/af_inet6.c 2008-05-29 20:17:39.000000000 -0700
@@ -822,13 +822,14 @@ static int __init init_ipv6_mibs(void)
return 0;
err_udplite_mib:
- snmp_mib_free((void **)udp_stats_in6);
+ snmp_mib_free((void **)udp_stats_in6, sizeof(struct udp_mib));
err_udp_mib:
- snmp_mib_free((void **)icmpv6msg_statistics);
+ snmp_mib_free((void **)icmpv6msg_statistics,
+ sizeof(struct icmpv6msg_mib));
err_icmpmsg_mib:
- snmp_mib_free((void **)icmpv6_statistics);
+ snmp_mib_free((void **)icmpv6_statistics, sizeof(struct icmpv6_mib));
err_icmp_mib:
- snmp_mib_free((void **)ipv6_statistics);
+ snmp_mib_free((void **)ipv6_statistics, sizeof(struct ipstats_mib));
err_ip_mib:
return -ENOMEM;
@@ -836,11 +837,12 @@ err_ip_mib:
static void cleanup_ipv6_mibs(void)
{
- snmp_mib_free((void **)ipv6_statistics);
- snmp_mib_free((void **)icmpv6_statistics);
- snmp_mib_free((void **)icmpv6msg_statistics);
- snmp_mib_free((void **)udp_stats_in6);
- snmp_mib_free((void **)udplite_stats_in6);
+ snmp_mib_free((void **)ipv6_statistics, sizeof(struct ipstats_mib));
+ snmp_mib_free((void **)icmpv6_statistics, sizeof(struct icmpv6_mib));
+ snmp_mib_free((void **)icmpv6msg_statistics,
+ sizeof(struct icmpv6msg_mib));
+ snmp_mib_free((void **)udp_stats_in6, sizeof(struct udp_mib));
+ snmp_mib_free((void **)udplite_stats_in6, sizeof(struct udp_mib));
}
static int inet6_net_init(struct net *net)
Index: linux-2.6/net/dccp/proto.c
===================================================================
--- linux-2.6.orig/net/dccp/proto.c 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/net/dccp/proto.c 2008-05-29 20:18:05.000000000 -0700
@@ -1016,7 +1016,7 @@ static inline int dccp_mib_init(void)
static inline void dccp_mib_exit(void)
{
- snmp_mib_free((void**)dccp_statistics);
+ snmp_mib_free((void **)dccp_statistics, sizeof(struct dccp_mib));
}
static int thash_entries;
Index: linux-2.6/net/sctp/protocol.c
===================================================================
--- linux-2.6.orig/net/sctp/protocol.c 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/net/sctp/protocol.c 2008-05-29 20:18:21.000000000 -0700
@@ -981,7 +981,7 @@ static inline int init_sctp_mibs(void)
static inline void cleanup_sctp_mibs(void)
{
- snmp_mib_free((void**)sctp_statistics);
+ snmp_mib_free((void **)sctp_statistics, sizeof(struct sctp_mib));
}
static void sctp_v4_pf_init(void)
Index: linux-2.6/net/xfrm/xfrm_proc.c
===================================================================
--- linux-2.6.orig/net/xfrm/xfrm_proc.c 2008-05-29 19:41:20.000000000 -0700
+++ linux-2.6/net/xfrm/xfrm_proc.c 2008-05-29 20:19:10.000000000 -0700
@@ -51,8 +51,8 @@ fold_field(void *mib[], int offt)
int i;
for_each_possible_cpu(i) {
- res += *(((unsigned long *)per_cpu_ptr(mib[0], i)) + offt);
- res += *(((unsigned long *)per_cpu_ptr(mib[1], i)) + offt);
+ res += *(((unsigned long *)CPU_PTR(mib[0], i)) + offt);
+ res += *(((unsigned long *)CPU_PTR(mib[1], i)) + offt);
}
return res;
}
--
next prev parent reply other threads:[~2008-05-30 4:00 UTC|newest]
Thread overview: 204+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-30 3:56 [patch 00/41] cpu alloc / cpu ops v3: Optimize per cpu access Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 01/41] cpu_alloc: Increase percpu area size to 128k Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-06-02 17:58 ` Luck, Tony
2008-06-02 17:58 ` Luck, Tony
2008-06-02 23:48 ` Rusty Russell
2008-06-10 17:22 ` Christoph Lameter
2008-06-10 19:54 ` Luck, Tony
2008-06-10 19:54 ` Luck, Tony
2008-05-30 3:56 ` [patch 02/41] cpu alloc: The allocator Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 4:58 ` Andrew Morton
2008-05-30 5:10 ` Christoph Lameter
2008-05-30 5:31 ` Andrew Morton
2008-06-02 9:29 ` Paul Jackson
2008-05-30 5:56 ` KAMEZAWA Hiroyuki
2008-05-30 6:16 ` Christoph Lameter
2008-06-04 14:48 ` Mike Travis
2008-05-30 5:04 ` Eric Dumazet
2008-05-30 5:20 ` Christoph Lameter
2008-05-30 5:52 ` Rusty Russell
2008-06-04 15:30 ` Mike Travis
2008-06-05 23:48 ` Rusty Russell
2008-05-30 5:54 ` Eric Dumazet
2008-06-04 14:58 ` Mike Travis
2008-06-04 15:11 ` Eric Dumazet
2008-06-06 0:32 ` Rusty Russell
2008-06-10 17:33 ` Christoph Lameter
2008-06-10 18:05 ` Eric Dumazet
2008-06-10 18:28 ` Christoph Lameter
2008-05-30 5:46 ` Rusty Russell
2008-06-04 15:04 ` Mike Travis
2008-06-10 17:34 ` Christoph Lameter
2008-05-31 20:58 ` Pavel Machek
2008-05-30 3:56 ` [patch 03/41] cpu alloc: Use cpu allocator instead of the builtin modules per cpu allocator Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 4:58 ` Andrew Morton
2008-05-30 5:14 ` Christoph Lameter
2008-05-30 5:34 ` Andrew Morton
2008-05-30 6:08 ` Rusty Russell
2008-05-30 6:21 ` Christoph Lameter
2008-05-30 3:56 ` [patch 04/41] cpu ops: Core piece for generic atomic per cpu operations Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 4:58 ` Andrew Morton
2008-05-30 5:17 ` Christoph Lameter
2008-05-30 5:38 ` Andrew Morton
2008-05-30 6:12 ` Christoph Lameter
2008-05-30 7:08 ` Rusty Russell
2008-05-30 18:00 ` Christoph Lameter
2008-06-02 2:00 ` Rusty Russell
2008-06-04 18:18 ` Mike Travis
2008-06-05 23:59 ` Rusty Russell
2008-06-09 19:00 ` Christoph Lameter
2008-06-09 23:27 ` Rusty Russell
2008-06-09 23:54 ` Christoph Lameter
2008-06-10 2:56 ` Rusty Russell
2008-06-10 3:18 ` Christoph Lameter
2008-06-11 0:03 ` Rusty Russell
2008-06-11 0:15 ` Christoph Lameter
2008-06-09 23:09 ` Christoph Lameter
2008-06-10 17:42 ` Christoph Lameter
2008-06-11 11:10 ` Rusty Russell
2008-06-11 23:39 ` Christoph Lameter
2008-06-12 0:58 ` Nick Piggin
2008-06-12 2:44 ` Rusty Russell
2008-06-12 3:40 ` Nick Piggin
2008-06-12 9:37 ` Martin Peschke
2008-06-12 11:21 ` Nick Piggin
2008-06-12 17:19 ` Christoph Lameter
2008-06-13 0:38 ` Rusty Russell
2008-06-13 2:27 ` Christoph Lameter
2008-06-15 10:33 ` Rusty Russell
2008-06-16 14:52 ` Christoph Lameter
2008-06-17 0:24 ` Rusty Russell
2008-06-17 2:29 ` Christoph Lameter
2008-06-17 14:21 ` Mike Travis
2008-05-30 7:05 ` Rusty Russell
2008-05-30 6:32 ` Rusty Russell
2008-05-30 3:56 ` [patch 05/41] cpu alloc: Percpu_counter conversion Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 6:47 ` Rusty Russell
2008-05-30 17:54 ` Christoph Lameter
2008-05-30 3:56 ` [patch 06/41] cpu alloc: crash_notes conversion Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 07/41] cpu alloc: Workqueue conversion Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 08/41] cpu alloc: ACPI cstate handling conversion Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 09/41] cpu alloc: Genhd statistics conversion Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 10/41] cpu alloc: blktrace conversion Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 11/41] cpu alloc: SRCU cpu alloc conversion Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 12/41] cpu alloc: XFS counter conversion Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 13/41] cpu alloc: NFS statistics Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 14/41] cpu alloc: Neigbour statistics Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 15/41] cpu_alloc: Convert ip route statistics Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 16/41] cpu alloc: Tcp statistics conversion Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 17/41] cpu alloc: Convert scratches to cpu alloc Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 18/41] cpu alloc: Dmaengine conversion Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 19/41] cpu alloc: Convert loopback statistics Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 20/41] cpu alloc: Veth conversion Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 21/41] cpu alloc: Chelsio statistics conversion Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 22/41] cpu alloc: Convert network sockets inuse counter Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 23/41] cpu alloc: Use it for infiniband Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 24/41] cpu alloc: Use in the crypto subsystem Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 25/41] cpu alloc: scheduler: Convert cpuusage to cpu_alloc Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter [this message]
2008-05-30 3:56 ` [patch 26/41] cpu alloc: Convert mib handling to cpu alloc Christoph Lameter
2008-05-30 6:47 ` Eric Dumazet
2008-05-30 18:01 ` Christoph Lameter
2008-05-30 3:56 ` [patch 27/41] cpu alloc: Remove the allocpercpu functionality Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 4:58 ` Andrew Morton
2008-05-30 3:56 ` [patch 28/41] Module handling: Use CPU_xx ops to dynamically allocate counters Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 29/41] x86_64: Use CPU ops for nmi alert counter Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 30/41] Remove local_t support Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 31/41] VM statistics: Use CPU ops Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 32/41] cpu alloc: Use in slub Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 33/41] cpu alloc: Remove slub fields Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 34/41] cpu alloc: Page allocator conversion Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 35/41] Support for CPU ops Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 4:58 ` Andrew Morton
2008-05-30 5:18 ` Christoph Lameter
2008-05-30 3:56 ` [patch 36/41] Zero based percpu: Infrastructure to rebase the per cpu area to zero Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 37/41] x86_64: Fold pda into per cpu area Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 38/41] x86: Extend percpu ops to 64 bit Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:56 ` [patch 39/41] x86: Replace cpu_pda() using percpu logic and get rid of _cpu_pda() Christoph Lameter
2008-05-30 3:56 ` Christoph Lameter
2008-05-30 3:57 ` [patch 40/41] x86: Replace xxx_pda() operations with x86_xx_percpu() Christoph Lameter
2008-05-30 3:57 ` Christoph Lameter
2008-05-30 3:57 ` [patch 41/41] x86_64: Support for cpu ops Christoph Lameter
2008-05-30 3:57 ` Christoph Lameter
2008-05-30 4:58 ` [patch 00/41] cpu alloc / cpu ops v3: Optimize per cpu access Andrew Morton
2008-05-30 5:03 ` Christoph Lameter
2008-05-30 5:21 ` Andrew Morton
2008-05-30 5:27 ` Christoph Lameter
2008-05-30 5:49 ` Andrew Morton
2008-05-30 6:16 ` Christoph Lameter
2008-05-30 6:51 ` KAMEZAWA Hiroyuki
2008-05-30 14:38 ` Mike Travis
2008-05-30 17:50 ` Christoph Lameter
2008-05-30 18:00 ` Matthew Wilcox
2008-05-30 18:12 ` Christoph Lameter
2008-05-30 6:01 ` Eric Dumazet
2008-05-30 6:16 ` Andrew Morton
2008-05-30 6:22 ` Christoph Lameter
2008-05-30 6:37 ` Andrew Morton
2008-05-30 11:32 ` Matthew Wilcox
2008-06-04 15:07 ` Mike Travis
2008-06-06 5:33 ` Eric Dumazet
2008-06-06 13:08 ` Mike Travis
2008-06-08 6:00 ` Rusty Russell
2008-06-09 18:44 ` Christoph Lameter
2008-06-09 19:11 ` Andi Kleen
2008-06-09 20:15 ` Eric Dumazet
2008-05-30 9:12 ` Peter Zijlstra
2008-05-30 9:18 ` Ingo Molnar
2008-05-30 18:11 ` Christoph Lameter
2008-05-30 18:40 ` Peter Zijlstra
2008-05-30 18:56 ` Christoph Lameter
2008-05-30 19:13 ` Peter Zijlstra
2008-06-01 3:25 ` Christoph Lameter
2008-06-01 8:19 ` Peter Zijlstra
2008-05-30 18:06 ` Christoph Lameter
2008-05-30 18:19 ` Peter Zijlstra
2008-05-30 18:26 ` Christoph Lameter
2008-05-30 18:47 ` Peter Zijlstra
2008-05-30 19:10 ` Christoph Lameter
2008-05-30 19:21 ` Peter Zijlstra
2008-05-30 19:35 ` Peter Zijlstra
2008-06-01 3:27 ` Christoph Lameter
2008-05-30 18:08 ` Christoph Lameter
2008-05-30 18:39 ` Peter Zijlstra
2008-05-30 18:51 ` Christoph Lameter
2008-05-30 19:00 ` Peter Zijlstra
2008-05-30 19:11 ` Christoph Lameter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080530040019.799353964@sgi.com \
--to=clameter@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rusty@rustcorp.com.au \
--cc=travis@sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.