Hello, On Wed, Jan 18, 2012 at 11:33 PM, Eric Dumazet <eric.dumazet@xxxxxxxxx> wrote: > Interesting, but should be a patch on its own. Yeap, agreed. > Maybe other idr users can benefit from your idea as well, if patch is > labeled "idr: allow idr_get_next() from rcu_read_lock" or something... > > I suggest introducing idr_get_next_rcu() helper to make the check about > rcu cleaner. > > idr_get_next_rcu(...) > { > WARN_ON_ONCE(!rcu_read_lock_held()); > return idr_get_next(...); > } Hmmm... I don't know. Does having a separate set of interface help much? It's easy to avoid/miss the test by using the other one. If we really worry about it, maybe indicating which locking is to be used during init is better? We can remember the lockdep map and trigger WARN_ON_ONCE() if neither the lock or RCU read lock is held. Thanks. -- tejun -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href