Re: cat /proc/net/tcp takes 0.5 seconds on x86_64
From: Andi Kleen <hidden>
Date: 2008-08-28 07:43:01
From: Andi Kleen <hidden>
Date: 2008-08-28 07:43:01
When scanning route cache hash table, we can avoid taking locks for empty buckets.
I'm not sure it's worth it in this case. A rcu_read_lock() is a nop (on non preemptible kernel) to very cheap (non atomic increment/decrement in cached task_struct) If you really wanted to make it faster I think a better strategy would be to not take it every bucket, but maybe only every 100th or so. That would still keep preempt off times reasonably low, but even help when the table is filled. But not sure it would be even measurable, really it should be quite cheap. -Andi