lkml.org 
[lkml]   [2012]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] memcg: restore ss->id_lock to spinlock, using RCU for next
From
Hello,

On Wed, Jan 18, 2012 at 11:33 PM, Eric Dumazet <eric.dumazet@gmail.com> 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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-01-19 13:31    [W:0.094 / U:1.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site