[PATCH] [1/2] Skip empty hash buckets faster in /proc/net/tcp

2008-01-30 Thread Andi Kleen
On most systems most of the TCP established/time-wait hash buckets are empty. When walking the hash table for /proc/net/tcp their read locks would always be aquired just to find out they're empty. This patch changes the code to check first if the buckets have any entries before taking the lock,

Re: [PATCH] [1/2] Skip empty hash buckets faster in /proc/net/tcp

2008-01-30 Thread Roland Dreier
On a 2GB Core2 system here I see a time cat /proc/net/tcp /dev/null constently dropping from 0.44s to 0.4-0.8s system time with this change. Seems like there must be a typo in either the before or after times you report here? -- To unsubscribe from this list: send the line unsubscribe netdev

Re: [PATCH] [1/2] Skip empty hash buckets faster in /proc/net/tcp

2008-01-30 Thread Andi Kleen
On Wed, Jan 30, 2008 at 09:03:16AM -0800, Roland Dreier wrote: On a 2GB Core2 system here I see a time cat /proc/net/tcp /dev/null constently dropping from 0.44s to 0.4-0.8s system time with this change. Seems like there must be a typo in either the before or after times you report