lkml.org 
[lkml]   [2008]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 16/41] cpu alloc: Tcp statistics conversion
Convert tcp statistics to cpu alloc.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
net/ipv4/tcp.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

Index: linux-2.6/net/ipv4/tcp.c
===================================================================
--- linux-2.6.orig/net/ipv4/tcp.c 2008-04-29 14:55:55.000000000 -0700
+++ linux-2.6/net/ipv4/tcp.c 2008-05-21 21:46:54.000000000 -0700
@@ -2456,7 +2456,7 @@
{
int cpu;
for_each_possible_cpu(cpu) {
- struct tcp_md5sig_pool *p = *per_cpu_ptr(pool, cpu);
+ struct tcp_md5sig_pool *p = *CPU_PTR(pool, cpu);
if (p) {
if (p->md5_desc.tfm)
crypto_free_hash(p->md5_desc.tfm);
@@ -2464,7 +2464,7 @@
p = NULL;
}
}
- free_percpu(pool);
+ CPU_FREE(pool);
}

void tcp_free_md5sig_pool(void)
@@ -2488,7 +2488,7 @@
int cpu;
struct tcp_md5sig_pool **pool;

- pool = alloc_percpu(struct tcp_md5sig_pool *);
+ pool = CPU_ALLOC(struct tcp_md5sig_pool *, GFP_KERNEL);
if (!pool)
return NULL;

@@ -2499,7 +2499,7 @@
p = kzalloc(sizeof(*p), GFP_KERNEL);
if (!p)
goto out_free;
- *per_cpu_ptr(pool, cpu) = p;
+ *CPU_PTR(pool, cpu) = p;

hash = crypto_alloc_hash("md5", 0, CRYPTO_ALG_ASYNC);
if (!hash || IS_ERR(hash))
@@ -2564,7 +2564,7 @@
if (p)
tcp_md5sig_users++;
spin_unlock_bh(&tcp_md5sig_pool_lock);
- return (p ? *per_cpu_ptr(p, cpu) : NULL);
+ return (p ? *CPU_PTR(p, cpu) : NULL);
}

EXPORT_SYMBOL(__tcp_get_md5sig_pool);
--


\
 
 \ /
  Last update: 2008-05-30 06:17    [W:0.364 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site