From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1164723AbdDXEiR (ORCPT ); Mon, 24 Apr 2017 00:38:17 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:39954 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164670AbdDXEiN (ORCPT ); Mon, 24 Apr 2017 00:38:13 -0400 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 165.244.249.23 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Mon, 24 Apr 2017 13:36:56 +0900 From: Byungchul Park To: Peter Zijlstra CC: , , , , , , , , , , , Subject: Re: [PATCH v6 05/15] lockdep: Implement crossrelease feature Message-ID: <20170424043656.GI21430@X58A-UD3R> References: <1489479542-27030-1-git-send-email-byungchul.park@lge.com> <1489479542-27030-6-git-send-email-byungchul.park@lge.com> <20170419150835.f2nky5qda5ooqfhy@hirez.programming.kicks-ass.net> MIME-Version: 1.0 In-Reply-To: <20170419150835.f2nky5qda5ooqfhy@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB01/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/04/24 13:38:04, Serialize by Router on LGEKRMHUB01/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/04/24 13:38:04, Serialize complete at 2017/04/24 13:38:04 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 Wed, Apr 19, 2017 at 05:08:35PM +0200, Peter Zijlstra wrote: > 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; > } D'oh, thank you.