From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752225AbcC3LHk (ORCPT ); Wed, 30 Mar 2016 07:07:40 -0400 Received: from mail-vk0-f52.google.com ([209.85.213.52]:35711 "EHLO mail-vk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750749AbcC3LHi (ORCPT ); Wed, 30 Mar 2016 07:07:38 -0400 MIME-Version: 1.0 Reply-To: sedat.dilek@gmail.com In-Reply-To: <20160330103601.GT3408@twins.programming.kicks-ass.net> References: <20160327204810.GW6356@twins.programming.kicks-ass.net> <20160329084701.GA9393@gmail.com> <20160330093659.GS3408@twins.programming.kicks-ass.net> <20160330095954.GB14352@fixme-laptop.cn.ibm.com> <20160330103601.GT3408@twins.programming.kicks-ass.net> Date: Wed, 30 Mar 2016 13:07:37 +0200 Message-ID: Subject: Re: [Linux-v4.6-rc1] ext4: WARNING: CPU: 2 PID: 2692 at kernel/locking/lockdep.c:2017 __lock_acquire+0x180e/0x2260 From: Sedat Dilek To: Peter Zijlstra Cc: Boqun Feng , Ingo Molnar , Alfredo Alvarez Fernandez , Linus Torvalds , "Theodore Ts'o" , linux-fsdevel , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 30, 2016 at 12:36 PM, Peter Zijlstra wrote: > On Wed, Mar 30, 2016 at 05:59:54PM +0800, Boqun Feng wrote: >> > @@ -3164,6 +3181,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, >> > hlock->acquire_ip = ip; >> > hlock->instance = lock; >> > hlock->nest_lock = nest_lock; >> > + hlock->irq_context = 2*(!!curr->hardirq_context) + !!curr->softirq_context; >> > hlock->trylock = trylock; >> > hlock->read = read; >> > hlock->check = check; >> >> This is just for cleaning up, right? However ->hardirq_context and >> ->softirq_context only defined when CONFIG_TRACE_IRQFLAGS=y. > > Ah, that is the reason it was in a 'funny' place. > > The other reason is that we're careful to reduce hardirq_context to 0,1 > but don't do so for softirq_context. > >> So we should use macro like current_hardirq_context() here? Or >> considering the two helpers introduced in my RFC: >> >> http://lkml.kernel.org/g/1455602265-16490-2-git-send-email-boqun.feng@gmail.com >> >> if you don't think that overkills ;-) > > Yeah, that might work, although I would like to keep the !! on both, > makes me worry less. Can you CC me on any new patches in this area? Thanks. - Sedat -