Subject: Re: WARNING: at net/ipv4/tcp_input.c:2927 tcp_ack+0xd55/0x1991()

From: Jarek Poplawski <[email-masked]>
Date: Mon, 30 Mar 2009 08:51:07 +0000

On 28-03-2009 14:56, Jonathan Corbet wrote:
> On Sat, 28 Mar 2009 10:55:14 +0100
> Markus Trippelsdorf <[email-masked]> wrote:
> 
>> Yes, you might be right, because running with CONFIG_PROVE_LOCKING and 
>> CONFIG_DETECT_SOFTLOCKUP enabled points to a possible bug in the BKL
>> removal patches (fasync) by Jonathan Corbet. (I wasn't able so far to
>> reproduce the original WARNING.)
>>
>> Here is one example:
>>
>> =========================================================
>> [ INFO: possible irq lock inversion dependency detected ]
>> 2.6.29-03321-gbe0ea69 #7
>> ---------------------------------------------------------
>> swapper/0 just changed the state of lock:
>>  (fasync_lock){..+.}, at: [<ffffffff8028a2ac>] kill_fasync+0x24/0x45
>> but this lock took another, hard-irq-unsafe lock in the past:
>>  (&f->f_lock){--..}
> 
> That's not a bug; f_lock will never be taken in IRQ mode.  There's a
> fix for the warning in linux-next now; my plan is to get it upstream
> before -rc1.

Probably I miss something, but generally in a case like this "a_lock"
doesn't have to be taken in IRQ mode to be dangerous. Eg. if one cpu
is trying to take this lock after fasync_lock (with IRQs disabled),
while another cpu is waiting for fasync_lock in IRQ, which preempted
such "a_lock".

Could you give some details of this fix?

Thanks,
Jarek P.