From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765485AbdDSPIt (ORCPT ); Wed, 19 Apr 2017 11:08:49 -0400 Received: from merlin.infradead.org ([205.233.59.134]:60002 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765470AbdDSPIo (ORCPT ); Wed, 19 Apr 2017 11:08:44 -0400 Date: Wed, 19 Apr 2017 17:08:35 +0200 From: Peter Zijlstra To: Byungchul Park 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 Subject: Re: [PATCH v6 05/15] lockdep: Implement crossrelease feature Message-ID: <20170419150835.f2nky5qda5ooqfhy@hirez.programming.kicks-ass.net> References: <1489479542-27030-1-git-send-email-byungchul.park@lge.com> <1489479542-27030-6-git-send-email-byungchul.park@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1489479542-27030-6-git-send-email-byungchul.park@lge.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 14, 2017 at 05:18:52PM +0900, Byungchul Park wrote: > +/* > + * Only access local task's data, so irq disable is only required. > + */ > +static int same_context_xhlock(struct hist_lock *xhlock) > +{ > + struct task_struct *curr = current; > + > + /* In the case of hardirq context */ > + if (curr->hardirq_context) { > + if (xhlock->hlock.irq_context & 2) /* 2: bitmask for hardirq */ > + return 1; > + /* In the case of softriq context */ > + } else if (curr->softirq_context) { > + if (xhlock->hlock.irq_context & 1) /* 1: bitmask for softirq */ > + return 1; > + /* In the case of process context */ > + } else { > + if (xhlock->work_id == curr->work_id) > + return 1; > + } > + return 0; > +} static bool same_context_xhlock(struct hist_lock *xhlock) { return xhlock->hlock.irq_context == task_irq_context(current) && xhlock->work_id == current->work_id; }