From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH] Code clean up for percpu_xxx() functions Date: Thu, 20 Oct 2011 07:08:01 +0200 Message-ID: <1319087281.8416.45.camel@edumazet-laptop> References: <1318237851.27949.190.camel@debian> <1318324774.27949.693.camel@debian> <1318382964.27949.782.camel@debian> <1318428673.29699.13.camel@debian> <1318908091.23426.52.camel@debian> <1319016218.23426.104.camel@debian> <1319078687.23426.146.camel@debian> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Christoph Lameter , "tj@kernel.org" , "linux-kernel@vger.kernel.org" , "Huang, Ying" , Thomas Gleixner , "mingo@redhat.com" , "avi@redhat.com" , "akpm@linux-foundation.org" , David Miller , "kaber@trash.net" , "a.p.zijlstra@chello.nl" , "kvm@vger.kernel.org" , "jeremy@xensource.com" To: "Alex,Shi" Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:64636 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751869Ab1JTFIK (ORCPT ); Thu, 20 Oct 2011 01:08:10 -0400 In-Reply-To: <1319078687.23426.146.camel@debian> Sender: kvm-owner@vger.kernel.org List-ID: Le jeudi 20 octobre 2011 =C3=A0 10:44 +0800, Alex,Shi a =C3=A9crit : > > Acked-by: Christoph Lameter >=20 > Thanks, Christoph!=20 > and resend for code style problem correction.=20 >=20 Sorry this huge patch brings too many potential bugs. I ask you a separate patch for the networking part, because I dont want to Ack all the other parts. > diff --git a/net/socket.c b/net/socket.c > index ffe92ca..2845d38 100644 > --- a/net/socket.c > +++ b/net/socket.c > @@ -479,7 +479,7 @@ static struct socket *sock_alloc(void) > inode->i_uid =3D current_fsuid(); > inode->i_gid =3D current_fsgid(); > =20 > - percpu_add(sockets_in_use, 1); > + __this_cpu_add(sockets_in_use, 1); No, we are in process context, you need this_cpu_add(sockets_in_use, 1); > return sock; > } > =20 > @@ -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"); > =20 > - percpu_sub(sockets_in_use, 1); > + __this_cpu_sub(sockets_in_use, 1); this_cpu_sub(); > if (!sock->file) { > iput(SOCK_INODE(sock)); > return;