lkml.org 
[lkml]   [2016]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v3 03/15] lockdep: Refactor lookup_chain_cache()
    On 13 September 2016 at 04:45, Byungchul Park <byungchul.park@lge.com> wrote:
    > @@ -2215,6 +2178,75 @@ cache_hit:
    > return 1;
    > }
    >
    > +/*
    > + * Look up a dependency chain.
    > + */
    > +static inline struct lock_chain *lookup_chain_cache(u64 chain_key)
    > +{
    > + struct hlist_head *hash_head = chainhashentry(chain_key);
    > + struct lock_chain *chain;
    > +
    > + /*
    > + * We can walk it lock-free, because entries only get added
    > + * to the hash:
    > + */
    > + hlist_for_each_entry_rcu(chain, hash_head, entry) {
    > + if (chain->chain_key == chain_key) {
    > + debug_atomic_inc(chain_lookup_hits);
    > + return chain;
    > + }
    > + }
    > + return NULL;
    > +}

    Byungchul, do you think we should increment chain_lookup_misses
    before returning NULL from the above function?

    --
    Nilay

    \
     
     \ /
      Last update: 2016-09-17 09:59    [W:3.525 / U:0.156 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site