diff -urN linux-2.5.12-percpu/net/socket.c linux/net/socket.c --- linux-2.5.12-percpu/net/socket.c Wed Apr 10 19:59:40 2002 +++ linux/net/socket.c Wed May 1 11:59:25 2002 @@ -74,6 +74,7 @@ #include #include #include +#include #if defined(CONFIG_KMOD) && defined(CONFIG_NET) #include @@ -181,10 +182,7 @@ * Statistics counters of the socket lists */ -static union { - int counter; - char __pad[SMP_CACHE_BYTES]; -} sockets_in_use[NR_CPUS] __cacheline_aligned = {{0}}; +static int __per_cpu_data sockets_in_use; /* * Support routines. Move socket addresses back and forth across the kernel/user @@ -498,7 +496,7 @@ inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; - sockets_in_use[smp_processor_id()].counter++; + this_cpu(sockets_in_use)++; return sock; } @@ -530,7 +528,7 @@ if (sock->fasync_list) printk(KERN_ERR "sock_release: fasync list not empty!\n"); - sockets_in_use[smp_processor_id()].counter--; + this_cpu(sockets_in_use)--; if (!sock->file) { iput(SOCK_INODE(sock)); return; @@ -1774,7 +1772,7 @@ int counter = 0; for (cpu=0; cpu