The following kernel bug is observed due to Android patches to the
linux kernel adding UID_STAT support.

kernel: BUG: sleeping function called from invalid context at /srv/
users/mattp/gingerbread/linux-gingerbread/projects/android/build-
output /linux-2.6.36.3/mm/slub.c:1701
kernel: in_atomic(): 1, irqs_disabled(): 0, pid: 611, name:
RILReceiver
kernel: [<c002f98c>] (unwind_backtrace+0x0/0xe4) from [<c00e2880>]
(kmem_cache_alloc+0x30/0xb0)
kernel: [<c00e2880>] (kmem_cache_alloc+0x30/0xb0) from [<c022b8b0>]
(create_stat+0x18/0x118)
kernel: [<c022b8b0>] (create_stat+0x18/0x118) from [<c022ba30>]
(uid_stat_tcp_rcv+0x28/0x58)
kernel: [<c022ba30>] (uid_stat_tcp_rcv+0x28/0x58) from [<c0345684>]
(tcp_read_sock+0x210/0x220)
kernel: [<c0345684>] (tcp_read_sock+0x210/0x220) from [<c03e9654>]
(xs_tcp_data_ready+0x80/0xb4)
kernel: [<c03e9654>] (xs_tcp_data_ready+0x80/0xb4) from [<c034d434>]
(tcp_rcv_established+0x480/0x60c)
kernel: [<c034d434>] (tcp_rcv_established+0x480/0x60c) from
[<c0353004>] (tcp_v4_do_rcv+0x24/0x104)
kernel: [<c0353004>] (tcp_v4_do_rcv+0x24/0x104) from [<c0354fe8>]
(tcp_v4_rcv+0x4b0/0x838)
kernel: [<c0354fe8>] (tcp_v4_rcv+0x4b0/0x838) from [<c0336e00>]
(ip_local_deliver_finish+0x12c/0x258)
kernel: [<c0336e00>] (ip_local_deliver_finish+0x12c/0x258) from
[<c0336cb8>] (ip_rcv_finish+0x304/0x320)
kernel: [<c0336cb8>] (ip_rcv_finish+0x304/0x320) from [<c02f0b80>]
(__netif_receive_skb+0x35c/0x3b4)
kernel: [<c02f0b80>] (__netif_receive_skb+0x35c/0x3b4) from
[<bf085e98>] (bcmhana_net_poll+0x5b8/0x660 [bcmhana_net])
kernel: [<bf085e98>] (bcmhana_net_poll+0x5b8/0x660 [bcmhana_net]) from
[<c02f0f18>] (net_rx_action+0x5c/0x148)
kernel: [<c02f0f18>] (net_rx_action+0x5c/0x148) from [<c007eddc>]
(__do_softirq+0xa4/0x170)
kernel: [<c007eddc>] (__do_softirq+0xa4/0x170) from [<c007f2c4>]
(irq_exit+0x80/0xf4)
kernel: [<c007f2c4>] (irq_exit+0x80/0xf4) from [<c002a0c8>] (asm_do_IRQ
+0xc8/0xf8)
kernel: [<c002a0c8>] (asm_do_IRQ+0xc8/0xf8) from [<c002aa08>]
(__irq_svc+0x48/0x9c)


It looks like the problem is from the Android patch. tcp_read_sock
cannot block (it even says so in the code comment above tcp_read_sock)
but the Android patch makes it call uid_stat_tcp_rcv within
tcp_read_sock. uid_stat_tcp_rcv does block when it calls create_stat,
which calls kmalloc to create UID specific entry for tracking the
stats.

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel

Reply via email to