[pso] [Tema5][Linux]inconsistent lock state

Cosmin Ratiu cosminratiu at gmail.com
Mon Apr 7 15:59:34 EEST 2008


Salut, Codrin.

Mesajele astea s-ar putea sa fie alarme false de-ale lock checker-ului. M-am
uitat peste codul tau si pare ok partea de locking. Pt. a scapa de mesaj,
incearca sa folosesti _bh peste tot, chiar si in hook-uri, sau incearca
variantele cu _irqsave si _irqrestore, poate il fac sa taca.

Apropo, interesant ghidul lui Rusty despre locking. Era in lab 3 un link la
"resurse utile".

Cosmin.

On Mon, Apr 7, 2008 at 4:08 AM, Codrin Alexandru Grajdeanu <
grcodal at gmail.com> wrote:

> Pe site imi apare o problema la stabilirea conexiunii in tema5, totusi
> trece toate testele, mentionez ca pe masina mea nu apare aceasta
> problema.
> Se pare ca atunci cand hookul de iesire vede mesajul de initiere de
> conexiune catre outside, si adauga noua regula in lista facand
> write_lock pe lockul pt sincronizare, intra si hookul de intrare pt
> pachetul primit de la outside (ca raspuns la inceput de conexiune) -
> hook care verifica daca pachetul se regaseste in lista facand
> read_lock pe lockul pt sincronizare. Eu zic ca am facut bine
> sincronizarea, in context proces folosesc read_lock_bh, write_lock_bh,
> deci n-ar trb sa interfereze contextul proces cu cel din intreruperi,
> iar sincronizarea in softirq ar trebui sa mearga cu read_lock si
> write_lock. Am incercat si cu spin_lock normal si acelasi mesaj de
> kernel apare.
> Orice sugestie e binevenita :D
>
> =================================
> [ INFO: inconsistent lock state ]
> 2.6.24.2 #14
> ---------------------------------
> inconsistent {softirq-on-W} -> {in-softirq-R} usage.
> test/2560 [HC0[0]:SC1[1]:HE1:SE0] takes:
>  (&fwr_lock){---?}, at: [<c8840434>] hook_func_in+0x64/0x160 [ipdriver]
> {softirq-on-W} state was registered at:
>  [<c0137bec>] __lock_acquire+0x69c/0x1080
>  [<c0138642>] lock_acquire+0x72/0xa0
>  [<c032aa66>] _write_lock+0x36/0x50
>  [<c8840154>] add_rule+0x74/0xa0 [ipdriver]
>  [<c88406af>] hook_func_out+0x17f/0x190 [ipdriver]
>  [<c02da665>] nf_iterate+0x65/0x90
>  [<c02da70e>] nf_hook_slow+0x7e/0x120
>  [<c02e551e>] ip_queue_xmit+0x29e/0x3d0
>  [<c02f550c>] tcp_transmit_skb+0x3bc/0x750
>  [<c02f813a>] tcp_connect+0x2aa/0x330
>  [<c02fb3e0>] tcp_v4_connect+0x370/0x6d0
>  [<c0308b1f>] inet_stream_connect+0x1df/0x270
>  [<c02ba87d>] sys_connect+0x5d/0x90
>  [<c02bbfd4>] sys_socketcall+0x94/0x260
>  [<c0102c82>] sysenter_past_esp+0x6b/0xc1
>  [<ffffffff>] 0xffffffff
> irq event stamp: 2422
> hardirqs last  enabled at (2422): [<c0165a4a>] kmem_cache_free+0x9a/0xd0
> hardirqs last disabled at (2421): [<c01659df>] kmem_cache_free+0x2f/0xd0
> softirqs last  enabled at (2408): [<c02c9037>] dev_queue_xmit+0xd7/0x310
> softirqs last disabled at (2409): [<c0104cdf>] do_softirq+0xaf/0x110
>
> other info that might help us debug this:
> 4 locks held by test/2560:
>  #0:  (sk_lock-AF_INET){--..}, at: [<c0308963>]
> inet_stream_connect+0x23/0x270
>  #1:  (rcu_read_lock){..--}, at: [<c02c87a9>] net_rx_action+0x59/0x250
>  #2:  (rcu_read_lock){..--}, at: [<c02c6001>] netif_receive_skb+0xf1/0x2e0
>  #3:  (rcu_read_lock){..--}, at: [<c02da690>] nf_hook_slow+0x0/0x120
>
> stack backtrace:
> Pid: 2560, comm: test Not tainted 2.6.24.2 #14
>  [<c0103d3a>] show_trace_log_lvl+0x1a/0x30
>  [<c01046e2>] show_trace+0x12/0x20
>  [<c0104a4c>] dump_stack+0x6c/0x80
>  [<c0135e63>] print_usage_bug+0x153/0x160
>  [<c0136dfb>] mark_lock+0x60b/0x620
>  [<c0137c08>] __lock_acquire+0x6b8/0x1080
>  [<c0138642>] lock_acquire+0x72/0xa0
>  [<c032abb6>] _read_lock+0x36/0x50
>  [<c8840434>] hook_func_in+0x64/0x160 [ipdriver]
>  [<c02da665>] nf_iterate+0x65/0x90
>  [<c02da70e>] nf_hook_slow+0x7e/0x120
>  [<c02e100c>] ip_local_deliver+0x8c/0xa0
>  [<c02e083b>] ip_rcv_finish+0xdb/0x310
>  [<c02e0eab>] ip_rcv+0x16b/0x240
>  [<c02c613b>] netif_receive_skb+0x22b/0x2e0
>  [<c02c8e58>] process_backlog+0x88/0xe0
>  [<c02c88d7>] net_rx_action+0x187/0x250
>  [<c011c092>] __do_softirq+0x62/0xd0
>  [<c0104cdf>] do_softirq+0xaf/0x110
>  =======================
>
> PS  Cautand solutii am dat si de un doc interesant despre kernel
> locking:
> http://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/
> _______________________________________________
> pso mailing list
> pso at cursuri.cs.pub.ro
> http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cursuri.cs.pub.ro/pipermail/pso/attachments/20080407/432bf2d0/attachment.html 


More information about the pso mailing list