Re: [PATCH v3 03/15] lockdep: Refactor lookup_chain_cache()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 15, 2016 at 10:33:46AM -0500, Nilay Vaish wrote:
> On 13 September 2016 at 04:45, Byungchul Park <byungchul.park@xxxxxxx> 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?

Hello,

No, I don't think so.
It will be done in add_chain_cache().

Thank you,
Byungchul

> 
> --
> Nilay

--
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/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]