Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1484324
| From | Nilay Vaish <nilayvaish@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 03/15] lockdep: Refactor lookup_chain_cache() |
| Date | 2016-09-15 17:40 +0200 |
| Message-ID | <shGVz-ku-5@gated-at.bofh.it> (permalink) |
| References | <sgSvL-8uI-5@gated-at.bofh.it> <sgSFs-6J-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 03/15] lockdep: Refactor lookup_chain_cache() Byungchul Park <byungchul.park@lge.com> - 2016-09-13 12:00 +0200
Re: [PATCH v3 03/15] lockdep: Refactor lookup_chain_cache() Nilay Vaish <nilayvaish@gmail.com> - 2016-09-15 17:40 +0200
Re: [PATCH v3 03/15] lockdep: Refactor lookup_chain_cache() Byungchul Park <byungchul.park@lge.com> - 2016-09-19 05:30 +0200
Re: [PATCH v3 03/15] lockdep: Refactor lookup_chain_cache() Nilay Vaish <nilayvaish@gmail.com> - 2016-09-19 18:40 +0200
Re: [PATCH v3 03/15] lockdep: Refactor lookup_chain_cache() Byungchul Park <byungchul.park@lge.com> - 2016-09-20 04:10 +0200
csiph-web