From 19e8d69c543f8f62050099892b138e981db952cc Mon Sep 17 00:00:00 2001 From: Alex Shi Date: Mon, 14 May 2012 14:15:31 -0700 Subject: net: replace percpu_xxx funcs with this_cpu_xxx or __this_cpu_xxx percpu_xxx funcs are duplicated with this_cpu_xxx funcs, so replace them for further code clean up. And in preempt safe scenario, __this_cpu_xxx funcs may has a bit better performance since __this_cpu_xxx has no redundant preempt_enable/preempt_disable on some architectures. Signed-off-by: Alex Shi Acked-by: Eric Dumazet Acked-by: David S. Miller Cc: Patrick McHardy Signed-off-by: Andrew Morton Signed-off-by: Tejun Heo --- net/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net/socket.c') diff --git a/net/socket.c b/net/socket.c index 851edcd6b098..08e873ac1609 100644 --- a/net/socket.c +++ b/net/socket.c @@ -479,7 +479,7 @@ static struct socket *sock_alloc(void) inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); - percpu_add(sockets_in_use, 1); + this_cpu_add(sockets_in_use, 1); return sock; } @@ -522,7 +522,7 @@ void sock_release(struct socket *sock) if (rcu_dereference_protected(sock->wq, 1)->fasync_list) printk(KERN_ERR "sock_release: fasync list not empty!\n"); - percpu_sub(sockets_in_use, 1); + this_cpu_sub(sockets_in_use, 1); if (!sock->file) { iput(SOCK_INODE(sock)); return; -- cgit v1.2.3-59-g8ed1b