commit c42ad7c77628946986ebe688966638371d09b734 Merge: 43f0f23 0856a30 Author: Stephen Rothwell Date: Fri Aug 26 11:50:02 2011 +1000 Merge remote-tracking branch 'net/master' Conflicts: arch/powerpc/configs/40x/hcu4_defconfig drivers/net/Kconfig drivers/net/Makefile commit 0856a304091b33a8e8f9f9c98e776f425af2b625 Author: Tim Chen Date: Mon Aug 22 14:57:26 2011 +0000 Scm: Remove unnecessary pid & credential references in Unix socket's send and receive path Patch series 109f6e39..7361c36c back in 2.6.36 added functionality to allow credentials to work across pid namespaces for packets sent via UNIX sockets. However, the atomic reference counts on pid and credentials caused plenty of cache bouncing when there are numerous threads of the same pid sharing a UNIX socket. This patch mitigates the problem by eliminating extraneous reference counts on pid and credentials on both send and receive path of UNIX sockets. I found a 2x improvement in hackbench's threaded case. On the receive path in unix_dgram_recvmsg, currently there is an increment of reference count on pid and credentials in scm_set_cred. Then there are two decrement of the reference counts. Once in scm_recv and once when skb_free_datagram call skb->destructor function unix_destruct_scm. One pair of increment and decrement of ref count on pid and credentials can be eliminated from the receive path. Until we destroy the skb, we already set a reference when we created the skb on the send side. On the send path, there are two increments of ref count on pid and credentials, once in scm_send and once in unix_scm_to_skb. Then there is a decrement of the reference counts in scm_destroy's call to scm_destroy_cred at the end of unix_dgram_sendmsg functions. One pair of increment and decrement of the reference counts can be removed so we only need to increment the ref counts once. By incorporating these changes, for hackbench running on a 4 socket NHM-EX machine with 40 cores, the execution of hackbench on 50 groups of 20 threads sped up by factor of 2. Hackbench command used for testing: ./hackbench 50 thread 2000 Signed-off-by: Tim Chen Signed-off-by: David S. Miller