From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1169037AbdDYHCn (ORCPT ); Tue, 25 Apr 2017 03:02:43 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:43818 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1167308AbdDYHCd (ORCPT ); Tue, 25 Apr 2017 03:02:33 -0400 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 165.244.249.26 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Tue, 25 Apr 2017 15:59:43 +0900 From: Byungchul Park To: Peter Zijlstra CC: , , , , , , , , , , , Subject: Re: [PATCH v6 05/15] lockdep: Implement crossrelease feature Message-ID: <20170425065943.GL21430@X58A-UD3R> References: <1489479542-27030-1-git-send-email-byungchul.park@lge.com> <1489479542-27030-6-git-send-email-byungchul.park@lge.com> <20170419171954.tqp5tkxlsg4jp2xz@hirez.programming.kicks-ass.net> <20170424030412.GG21430@X58A-UD3R> <20170424093051.imizyhpifqf4t6bc@hirez.programming.kicks-ass.net> MIME-Version: 1.0 In-Reply-To: <20170424093051.imizyhpifqf4t6bc@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB06/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/04/25 16:00:56, Serialize by Router on LGEKRMHUB06/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/04/25 16:00:56, Serialize complete at 2017/04/25 16:00:56 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 24, 2017 at 11:30:51AM +0200, Peter Zijlstra wrote: > +static void add_xhlock(struct held_lock *hlock) > +{ > + unsigned int idx = current->xhlock_idx++; > + struct hist_lock *xhlock = &xhlock(idx); > > Yes, I misread that. Then '0' has the oldest entry, which is slightly > weird. Should we change that? I will just follow your decision. Do you think I should change it so that 'xhlock_idx' points to newest one, or ok to keep it unchanged? > > > > > > + > > > > + if (!xhlock_used(xhlock)) > > > > + break; > > > > + > > > > + if (before(xhlock->hlock.gen_id, xlock->hlock.gen_id)) > > > > + break; > > > > + > > > > + if (same_context_xhlock(xhlock) && > > > > + !commit_xhlock(xlock, xhlock)) > > > > > > return with graph_lock held? > > > > No. When commit_xhlock() returns 0, the lock was already unlocked. > > Please add a comment, because I completely missed that. That's at least > 2 functions deeper. Yes, I will add a comment. Thank you. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id 0B83C6B02E1 for ; Tue, 25 Apr 2017 03:02:34 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id p81so23435671pfd.12 for ; Tue, 25 Apr 2017 00:02:34 -0700 (PDT) Received: from lgeamrelo13.lge.com (LGEAMRELO13.lge.com. [156.147.23.53]) by mx.google.com with ESMTP id j61si14346841plb.85.2017.04.25.00.02.32 for ; Tue, 25 Apr 2017 00:02:32 -0700 (PDT) Date: Tue, 25 Apr 2017 15:59:43 +0900 From: Byungchul Park Subject: Re: [PATCH v6 05/15] lockdep: Implement crossrelease feature Message-ID: <20170425065943.GL21430@X58A-UD3R> References: <1489479542-27030-1-git-send-email-byungchul.park@lge.com> <1489479542-27030-6-git-send-email-byungchul.park@lge.com> <20170419171954.tqp5tkxlsg4jp2xz@hirez.programming.kicks-ass.net> <20170424030412.GG21430@X58A-UD3R> <20170424093051.imizyhpifqf4t6bc@hirez.programming.kicks-ass.net> MIME-Version: 1.0 In-Reply-To: <20170424093051.imizyhpifqf4t6bc@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: owner-linux-mm@kvack.org List-ID: To: Peter Zijlstra Cc: mingo@kernel.org, tglx@linutronix.de, walken@google.com, boqun.feng@gmail.com, kirill@shutemov.name, linux-kernel@vger.kernel.org, linux-mm@kvack.org, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, willy@infradead.org, npiggin@gmail.com, kernel-team@lge.com On Mon, Apr 24, 2017 at 11:30:51AM +0200, Peter Zijlstra wrote: > +static void add_xhlock(struct held_lock *hlock) > +{ > + unsigned int idx = current->xhlock_idx++; > + struct hist_lock *xhlock = &xhlock(idx); > > Yes, I misread that. Then '0' has the oldest entry, which is slightly > weird. Should we change that? I will just follow your decision. Do you think I should change it so that 'xhlock_idx' points to newest one, or ok to keep it unchanged? > > > > > > + > > > > + if (!xhlock_used(xhlock)) > > > > + break; > > > > + > > > > + if (before(xhlock->hlock.gen_id, xlock->hlock.gen_id)) > > > > + break; > > > > + > > > > + if (same_context_xhlock(xhlock) && > > > > + !commit_xhlock(xlock, xhlock)) > > > > > > return with graph_lock held? > > > > No. When commit_xhlock() returns 0, the lock was already unlocked. > > Please add a comment, because I completely missed that. That's at least > 2 functions deeper. Yes, I will add a comment. Thank you. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org