Messages in this thread | | | Subject | Re: [PATCH] Code clean up for percpu_xxx() functions | From | Eric Dumazet <> | Date | Thu, 20 Oct 2011 07:08:01 +0200 |
| |
Le jeudi 20 octobre 2011 à 10:44 +0800, Alex,Shi a écrit : > > Acked-by: Christoph Lameter <cl@gentwo.org> > > Thanks, Christoph! > and resend for code style problem correction. >
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 = current_fsuid(); > inode->i_gid = current_fsgid(); > > - 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; > } > > @@ -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);
this_cpu_sub();
> if (!sock->file) { > iput(SOCK_INODE(sock)); > return;
-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |