From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938699AbcISDYH (ORCPT ); Sun, 18 Sep 2016 23:24:07 -0400 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:52783 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936454AbcISDYB (ORCPT ); Sun, 18 Sep 2016 23:24:01 -0400 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Mon, 19 Sep 2016 12:05:58 +0900 From: Byungchul Park To: Nilay Vaish Cc: peterz@infradead.org, mingo@kernel.org, tglx@linutronix.de, walken@google.com, boqun.feng@gmail.com, kirill@shutemov.name, Linux Kernel list , linux-mm@kvack.org, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, npiggin@gmail.com Subject: Re: [PATCH v3 03/15] lockdep: Refactor lookup_chain_cache() Message-ID: <20160919030558.GI2279@X58A-UD3R> References: <1473759914-17003-1-git-send-email-byungchul.park@lge.com> <1473759914-17003-4-git-send-email-byungchul.park@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 15, 2016 at 10:33:46AM -0500, Nilay Vaish wrote: > On 13 September 2016 at 04:45, Byungchul Park 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