Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751995AbdGRB0r (ORCPT ); Mon, 17 Jul 2017 21:26:47 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:52410 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751440AbdGRB0p (ORCPT ); Mon, 17 Jul 2017 21:26:45 -0400 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Tue, 18 Jul 2017 10:25:55 +0900 From: Byungchul Park 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, akpm@linux-foundation.org, willy@infradead.org, npiggin@gmail.com, kernel-team@lge.com Subject: Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite Message-ID: <20170718012554.GL20323@X58A-UD3R> References: <1495616389-29772-1-git-send-email-byungchul.park@lge.com> <1495616389-29772-7-git-send-email-byungchul.park@lge.com> <20170711161232.GB28975@worktop> <20170712020053.GB20323@X58A-UD3R> <20170712075617.o2jds2giuoqxjqic@hirez.programming.kicks-ass.net> <20170713020745.GG20323@X58A-UD3R> <20170713081442.GA439@worktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170713081442.GA439@worktop> 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 Content-Length: 721 Lines: 30 On Thu, Jul 13, 2017 at 10:14:42AM +0200, Peter Zijlstra wrote: > +static void __crossrelease_end(unsigned int *stamp) > +{ [snip] > + > + /* > + * If we rewind past the tail; all of history is lost. > + */ > + if ((current->xhlock_idx_max - *stamp) < MAX_XHLOCKS_NR) > + return; > + > + /* > + * Invalidate the entire history.. > + */ > + for (i = 0; i < MAX_XHLOCKS_NR; i++) > + invalidate_xhlock(&xhlock(i)); > + > + current->xhlock_idx = 0; > + current->xhlock_idx_hard = 0; > + current->xhlock_idx_soft = 0; > + current->xhlock_idx_hist = 0; > + current->xhlock_idx_max = 0; I don't understand why you introduced this code, yet. Do we need this? The other of your suggestion looks very good though.. > +}