lkml.org 
[lkml]   [2010]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[tip:core/rcu] idr: Apply lockdep-based diagnostics to rcu_dereference() uses
    Commit-ID:  96be753af91fc9d582450a84722f6a6721d218ad
    Gitweb: http://git.kernel.org/tip/96be753af91fc9d582450a84722f6a6721d218ad
    Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    AuthorDate: Mon, 22 Feb 2010 17:04:55 -0800
    Committer: Ingo Molnar <mingo@elte.hu>
    CommitDate: Thu, 25 Feb 2010 10:34:51 +0100

    idr: Apply lockdep-based diagnostics to rcu_dereference() uses

    Because idr can be used with any of a number of locks or with
    any flavor of RCU, just disable the lockdep-based diagnostics.
    If idr needs diagnostics, the check expression will need to be
    passed into the relevant idr primitives as an additional
    argument.

    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Cc: laijs@cn.fujitsu.com
    Cc: dipankar@in.ibm.com
    Cc: mathieu.desnoyers@polymtl.ca
    Cc: josh@joshtriplett.org
    Cc: dvhltc@us.ibm.com
    Cc: niv@us.ibm.com
    Cc: peterz@infradead.org
    Cc: rostedt@goodmis.org
    Cc: Valdis.Kletnieks@vt.edu
    Cc: dhowells@redhat.com
    LKML-Reference: <1266887105-1528-11-git-send-email-paulmck@linux.vnet.ibm.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
    ---
    lib/idr.c | 8 ++++----
    1 files changed, 4 insertions(+), 4 deletions(-)

    diff --git a/lib/idr.c b/lib/idr.c
    index 0dc7822..2eb1dca 100644
    --- a/lib/idr.c
    +++ b/lib/idr.c
    @@ -504,7 +504,7 @@ void *idr_find(struct idr *idp, int id)
    int n;
    struct idr_layer *p;

    - p = rcu_dereference(idp->top);
    + p = rcu_dereference_raw(idp->top);
    if (!p)
    return NULL;
    n = (p->layer+1) * IDR_BITS;
    @@ -519,7 +519,7 @@ void *idr_find(struct idr *idp, int id)
    while (n > 0 && p) {
    n -= IDR_BITS;
    BUG_ON(n != p->layer*IDR_BITS);
    - p = rcu_dereference(p->ary[(id >> n) & IDR_MASK]);
    + p = rcu_dereference_raw(p->ary[(id >> n) & IDR_MASK]);
    }
    return((void *)p);
    }
    @@ -552,7 +552,7 @@ int idr_for_each(struct idr *idp,
    struct idr_layer **paa = &pa[0];

    n = idp->layers * IDR_BITS;
    - p = rcu_dereference(idp->top);
    + p = rcu_dereference_raw(idp->top);
    max = 1 << n;

    id = 0;
    @@ -560,7 +560,7 @@ int idr_for_each(struct idr *idp,
    while (n > 0 && p) {
    n -= IDR_BITS;
    *paa++ = p;
    - p = rcu_dereference(p->ary[(id >> n) & IDR_MASK]);
    + p = rcu_dereference_raw(p->ary[(id >> n) & IDR_MASK]);
    }

    if (p) {

    \
     
     \ /
      Last update: 2010-02-25 11:15    [W:2.760 / U:0.260 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site