These two locks are used to protect access to IP addresses lists. When system has many IP (v4 or v6) addresses rwlock shows poor performance on high packet rate when many CPU cores are used, because of high contention. If we compare how many times these locks are acquired for reading for each packet on traffic flow (in_localip, in6_localip, etc.), and for writing when we are changing IP addresses - it is better to use read-mostly lock here.
Details
Details
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage
Event Timeline
Comment Actions
I don't know of any other place in the kernel where we use a macro to declare a function local variable. Please revert that part to look like the rest of the kernel. The rest of the change looks fine to me.
Comment Actions
I used the macro to minimize the diff. Also, with such macro it is easy to switch back to rwlock, or some other type of lock. But ok, I'll update the patch.
Comment Actions
Don't use macro to declare rm_priotracker.
Pass it as argument to *RLOCK/RUNLOCK macros, also update IFP_TO_IA() macro.