On Fri, Jun 21, 2013 at 04:30:44PM +0100, Joerg Roedel wrote:
On Fri, Jun 21, 2013 at 04:00:06PM +0100, Will Deacon wrote:
quoted
Damn, I was hoping to avoid locking on the map path. In fact, this is a good
argument to go with your suggestion below (otherwise I'd need to use
reader/writer locks which seem to be frowned on).
You should look into using rcu-lists instead. You still need a lock, but
only when you actually manipulating the lists. For traversing them it is
sufficient to take the rcu_read_lock() which has very low overhead.
Indeed, I'd got RCU-protected lists mixed up with the _safe iterators.
However, if I construct a compound output_mask as you suggest, all the
locking is on the slow path (add/attach of devices) so it's no longer an
issue.
I'll post a v2 next week.
Will