[PATCH] fix preempt_count overflow with brlocks
Now that brlocks loop over NR_CPUS, on SMP every br_lock/br_unlock results in the acquire/release of 32 locks. This incs/decs the preempt_count by 32. Since we only have 7 bits now for actually storing the lock depth, we cannot nest but 3 locks deep. I doubt we ever acquire three brlocks concurrently, but it is still a concern. Attached patch disables/enables preemption explicitly once and only once for each lock/unlock. This is also an optimization as it removes 31 incs, decs, and conditionals. :) Problem reported by Andrew Morton.
Showing
Please register or sign in to comment