* textsearch in module = BUG: scheduling while atomic
@ 2007-11-04 17:15 Felipe Dias
2007-11-04 17:57 ` Jiri Slaby
0 siblings, 1 reply; 7+ messages in thread
From: Felipe Dias @ 2007-11-04 17:15 UTC (permalink / raw)
To: linux-kernel
hi, i have a short module in kernel 2.6.22 with uses textsearch to
search strings in network packages, and i have this erros in dmesg:
--------------
BUG: scheduling while atomic: apache2/0x10000101/3710
[<c02aefe6>] __sched_text_start+0x56/0x7c8
[<c0119284>] __wake_up_common+0x35/0x53
[<c01197f6>] __wake_up+0x32/0x43
[<c028ba0f>] tcp_v4_send_check+0x86/0xbc
[<c011bc98>] __cond_resched+0x18/0x29
[<c02af7be>] cond_resched+0x26/0x31
[<c015e711>] __kmalloc+0x38/0x6e
[<f8f6e0fa>] bm_init+0x28/0x1c9 [ts_bm]
[<c0256fe4>] __alloc_skb+0x47/0x104
[<c01ba6da>] textsearch_prepare+0xf4/0x11a
[<f91af451>] hook_test+0x4c/0xb6 [test_mod]
[<c028d416>] tcp_v4_rcv+0x84c/0x8aa
[<c026ef84>] nf_iterate+0x38/0x6a
[<c0273f1c>] ip_rcv_finish+0x0/0x294
[<c026f0c1>] nf_hook_slow+0x4d/0xb5
[<c0273f1c>] ip_rcv_finish+0x0/0x294
[<c027462f>] ip_rcv+0x20b/0x4bd
[<c0273f1c>] ip_rcv_finish+0x0/0x294
[<c025aee2>] netif_receive_skb+0x2ef/0x309
[<c025ca16>] process_backlog+0x7c/0xe9
[<c025cbe6>] net_rx_action+0x95/0x186
[<c012469f>] __do_softirq+0x6c/0xcf
[<c0124734>] do_softirq+0x32/0x36
[<c0124900>] local_bh_enable+0x7b/0x89
[<c025ced9>] dev_queue_xmit+0x202/0x221
[<c0279686>] ip_output+0x269/0x2a3
[<c0278d95>] ip_queue_xmit+0x358/0x39a
[<f8cd15a9>] journal_end+0xba/0xc2 [reiserfs]
[<f8cc2c16>] reiserfs_dirty_inode+0x78/0x7e [reiserfs]
[<c0286f8f>] tcp_transmit_skb+0x618/0x652
[<c0288906>] __tcp_push_pending_frames+0x71c/0x7cc
[<f8cbe957>] reiserfs_file_write+0x1841/0x1871 [reiserfs]
[<c0256fe4>] __alloc_skb+0x47/0x104
[<c027ec8b>] tcp_sendmsg+0x91b/0x9f0
[<c0258623>] skb_copy_datagram_iovec+0x53/0x1d0
[<c027fcbb>] tcp_recvmsg+0x8e5/0x9f0
[<c0251227>] sock_aio_write+0xf3/0xfb
[<c0160e8a>] do_sync_readv_writev+0xc0/0x103
[<c0130125>] autoremove_wake_function+0x0/0x33
[<c0252bc2>] sys_getsockname+0x9f/0xb0
[<c01b6856>] copy_from_user+0x23/0x4f
[<c0160d40>] rw_copy_check_uvector+0x50/0xaa
[<c0161566>] do_readv_writev+0xbc/0x187
[<c0251134>] sock_aio_write+0x0/0xfb
[<c0118731>] do_page_fault+0x273/0x516
[<c016166e>] vfs_writev+0x3d/0x48
[<c0161a6a>] sys_writev+0x41/0x67
[<c0103d16>] sysenter_past_esp+0x5f/0x85
=======================
My module part with find the string with textsearch:
-------------------------------
int pos, err;
struct ts_config *conf;
struct ts_state state;
list_for_each_entry_safe(entry, next, &head, list) {
conf = textsearch_prepare("bm", entry->content,
strlen(entry->content), GFP_KERNEL, TS_AUTOLOAD);
if (IS_ERR(conf))
err = PTR_ERR(conf);
pos = textsearch_find_continuous(conf, &state,
sb->data, sb->len);
if (pos != -1)
printk("%s: Contet: %s match!\n", MODULE_NAME,
entry->content);
textsearch_destroy(conf);
}
-------------------------------
What is this message ? somebody can help-me ?
Please send-me the correct mail list if this is wrong place to this question.
Att.
Felipe Dias
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: textsearch in module = BUG: scheduling while atomic 2007-11-04 17:15 textsearch in module = BUG: scheduling while atomic Felipe Dias @ 2007-11-04 17:57 ` Jiri Slaby [not found] ` <3c16e8dc0711041222w6bc67b3fn8320e982ffd723b0@mail.gmail.com> 0 siblings, 1 reply; 7+ messages in thread From: Jiri Slaby @ 2007-11-04 17:57 UTC (permalink / raw) To: Felipe Dias; +Cc: linux-kernel On 11/04/2007 06:15 PM, Felipe Dias wrote: > hi, i have a short module in kernel 2.6.22 with uses textsearch to > search strings in network packages, and i have this erros in dmesg: > > -------------- > BUG: scheduling while atomic: apache2/0x10000101/3710 > [<c02aefe6>] __sched_text_start+0x56/0x7c8 > [<c0119284>] __wake_up_common+0x35/0x53 > [<c01197f6>] __wake_up+0x32/0x43 > [<c028ba0f>] tcp_v4_send_check+0x86/0xbc > [<c011bc98>] __cond_resched+0x18/0x29 > [<c02af7be>] cond_resched+0x26/0x31 > [<c015e711>] __kmalloc+0x38/0x6e > [<f8f6e0fa>] bm_init+0x28/0x1c9 [ts_bm] > [<c0256fe4>] __alloc_skb+0x47/0x104 > [<c01ba6da>] textsearch_prepare+0xf4/0x11a > [<f91af451>] hook_test+0x4c/0xb6 [test_mod] > [<c028d416>] tcp_v4_rcv+0x84c/0x8aa > [<c026ef84>] nf_iterate+0x38/0x6a > [<c0273f1c>] ip_rcv_finish+0x0/0x294 > [<c026f0c1>] nf_hook_slow+0x4d/0xb5 > [<c0273f1c>] ip_rcv_finish+0x0/0x294 > [<c027462f>] ip_rcv+0x20b/0x4bd > [<c0273f1c>] ip_rcv_finish+0x0/0x294 > [<c025aee2>] netif_receive_skb+0x2ef/0x309 > [<c025ca16>] process_backlog+0x7c/0xe9 > [<c025cbe6>] net_rx_action+0x95/0x186 > [<c012469f>] __do_softirq+0x6c/0xcf > [<c0124734>] do_softirq+0x32/0x36 > [<c0124900>] local_bh_enable+0x7b/0x89 > [<c025ced9>] dev_queue_xmit+0x202/0x221 > [<c0279686>] ip_output+0x269/0x2a3 > [<c0278d95>] ip_queue_xmit+0x358/0x39a > [<f8cd15a9>] journal_end+0xba/0xc2 [reiserfs] > [<f8cc2c16>] reiserfs_dirty_inode+0x78/0x7e [reiserfs] > [<c0286f8f>] tcp_transmit_skb+0x618/0x652 > [<c0288906>] __tcp_push_pending_frames+0x71c/0x7cc > [<f8cbe957>] reiserfs_file_write+0x1841/0x1871 [reiserfs] > [<c0256fe4>] __alloc_skb+0x47/0x104 > [<c027ec8b>] tcp_sendmsg+0x91b/0x9f0 > [<c0258623>] skb_copy_datagram_iovec+0x53/0x1d0 > [<c027fcbb>] tcp_recvmsg+0x8e5/0x9f0 > [<c0251227>] sock_aio_write+0xf3/0xfb > [<c0160e8a>] do_sync_readv_writev+0xc0/0x103 > [<c0130125>] autoremove_wake_function+0x0/0x33 > [<c0252bc2>] sys_getsockname+0x9f/0xb0 > [<c01b6856>] copy_from_user+0x23/0x4f > [<c0160d40>] rw_copy_check_uvector+0x50/0xaa > [<c0161566>] do_readv_writev+0xbc/0x187 > [<c0251134>] sock_aio_write+0x0/0xfb > [<c0118731>] do_page_fault+0x273/0x516 > [<c016166e>] vfs_writev+0x3d/0x48 > [<c0161a6a>] sys_writev+0x41/0x67 > [<c0103d16>] sysenter_past_esp+0x5f/0x85 > ======================= > > My module part with find the string with textsearch: > ------------------------------- > int pos, err; > struct ts_config *conf; > struct ts_state state; > > list_for_each_entry_safe(entry, next, &head, list) { > > conf = textsearch_prepare("bm", entry->content, > strlen(entry->content), GFP_KERNEL, TS_AUTOLOAD); I guess you want GFP_ATOMIC while calling it from (soft)irq. regards, -- Jiri Slaby (jirislaby@gmail.com) Faculty of Informatics, Masaryk University ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <3c16e8dc0711041222w6bc67b3fn8320e982ffd723b0@mail.gmail.com>]
[parent not found: <472E346E.90309@gmail.com>]
* Re: textsearch in module = BUG: scheduling while atomic [not found] ` <472E346E.90309@gmail.com> @ 2007-11-04 22:05 ` Felipe Dias 2007-11-04 22:16 ` Jiri Slaby 0 siblings, 1 reply; 7+ messages in thread From: Felipe Dias @ 2007-11-04 22:05 UTC (permalink / raw) To: Jiri Slaby; +Cc: linux-kernel Ow sorry... the warning: BUG: scheduling while atomic: gnome-cups-icon/0x00000101/3827 [<c02aefe6>] __sched_text_start+0x56/0x7c8 [<c0130139>] autoremove_wake_function+0x14/0x33 [<c0119284>] __wake_up_common+0x35/0x53 [<c01197f6>] __wake_up+0x32/0x43 [<c02af847>] wait_for_completion+0x6a/0x9f [<c011b6ae>] default_wake_function+0x0/0xc [<c012cdff>] call_usermodehelper_keys+0xad/0xc5 [<c012ceec>] request_module+0xd5/0xe6 [<c01b2762>] __next_cpu+0x12/0x21 [<c0119e54>] find_busiest_group+0x1d6/0x55a [<c01ba672>] textsearch_prepare+0x8c/0x11a [<c017c11d>] __find_get_block_slow+0x127/0x131 [<f9198451>] hook_test+0x4c/0xb6 [test_mod] [<c017c3f0>] __find_get_block+0x13f/0x149 [<c026ef84>] nf_iterate+0x38/0x6a [<c0273f1c>] ip_rcv_finish+0x0/0x294 [<c026f0c1>] nf_hook_slow+0x4d/0xb5 [<c0273f1c>] ip_rcv_finish+0x0/0x294 [<c027462f>] ip_rcv+0x20b/0x4bd [<c0273f1c>] ip_rcv_finish+0x0/0x294 [<f8ccd2ad>] search_by_key+0x17f/0xe87 [reiserfs] [<c0127b32>] del_timer_sync+0xa/0x14 [<c02afdfb>] schedule_timeout+0x79/0x8d [<c025aee2>] netif_receive_skb+0x2ef/0x309 [<c026e201>] __nla_put+0xe/0x25 [<c025ca16>] process_backlog+0x7c/0xe9 [<c025cbe6>] net_rx_action+0x95/0x186 [<c012469f>] __do_softirq+0x6c/0xcf [<c0124734>] do_softirq+0x32/0x36 [<c0124900>] local_bh_enable+0x7b/0x89 [<c025ced9>] dev_queue_xmit+0x202/0x221 [<c0279686>] ip_output+0x269/0x2a3 [<c0278d95>] ip_queue_xmit+0x358/0x39a [<c014b589>] __alloc_pages+0x64/0x2a8 [<c015e2ee>] cache_alloc_refill+0x74/0x45f [<c028ba0f>] tcp_v4_send_check+0x86/0xbc [<c0286f8f>] tcp_transmit_skb+0x618/0x652 [<c0256fe4>] __alloc_skb+0x47/0x104 [<c0289319>] tcp_connect+0x2a3/0x31d [<c028c0cd>] tcp_v4_connect+0x493/0x5a4 [<c0171eb3>] touch_atime+0x8b/0xac [<c0296f23>] inet_stream_connect+0x87/0x20d [<c01b6856>] copy_from_user+0x23/0x4f [<c02518b5>] sys_connect+0x82/0xad [<c02b0c6c>] _spin_lock_bh+0x8/0x18 [<c02b0c6c>] _spin_lock_bh+0x8/0x18 [<c02538c3>] release_sock+0x12/0x8c [<c027d938>] tcp_setsockopt+0x309/0x321 [<c016fb25>] d_alloc+0x14b/0x17e [<c016f9d6>] d_instantiate+0x66/0x6a [<c02532a4>] sock_common_setsockopt+0x1d/0x22 [<c0251814>] sys_setsockopt+0x88/0xa7 [<c0252e33>] sys_socketcall+0x8f/0x242 [<c0103d16>] sysenter_past_esp+0x5f/0x85 ======================= Thanks, Felipe Dias On 11/4/07, Jiri Slaby <jirislaby@gmail.com> wrote: > On 11/04/2007 09:22 PM, Felipe Dias wrote: > > Hi, thanks for your fast reply, I try, I put GFP_ATOMIC. > > The error remains, but with less frequency. The sometimes appears, is > > not where he does the checking. Any ideia ? > > Post the trace (the BUG warning) with the GFP_ATOMIC used. > > regards, > -- > Jiri Slaby (jirislaby@gmail.com) > Faculty of Informatics, Masaryk University > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: textsearch in module = BUG: scheduling while atomic 2007-11-04 22:05 ` Felipe Dias @ 2007-11-04 22:16 ` Jiri Slaby 2007-11-04 22:19 ` Jiri Slaby 0 siblings, 1 reply; 7+ messages in thread From: Jiri Slaby @ 2007-11-04 22:16 UTC (permalink / raw) To: Felipe Dias; +Cc: linux-kernel On 11/04/2007 11:05 PM, Felipe Dias wrote: > Ow sorry... the warning: > > BUG: scheduling while atomic: gnome-cups-icon/0x00000101/3827 > [<c02aefe6>] __sched_text_start+0x56/0x7c8 > [<c0130139>] autoremove_wake_function+0x14/0x33 > [<c0119284>] __wake_up_common+0x35/0x53 > [<c01197f6>] __wake_up+0x32/0x43 > [<c02af847>] wait_for_completion+0x6a/0x9f > [<c011b6ae>] default_wake_function+0x0/0xc > [<c012cdff>] call_usermodehelper_keys+0xad/0xc5 > [<c012ceec>] request_module+0xd5/0xe6 Seems like it is not inteded for using in atomic at all (you probably passed an unknown algo here to the prepare function). You seem to have to use a workqueue if it is possible or prepare the serach before the interrupt occurs. Post your code if you want more appropriate answer. > [<c01b2762>] __next_cpu+0x12/0x21 > [<c0119e54>] find_busiest_group+0x1d6/0x55a > [<c01ba672>] textsearch_prepare+0x8c/0x11a > [<c017c11d>] __find_get_block_slow+0x127/0x131 > [<f9198451>] hook_test+0x4c/0xb6 [test_mod] > [<c017c3f0>] __find_get_block+0x13f/0x149 > [<c026ef84>] nf_iterate+0x38/0x6a > [<c0273f1c>] ip_rcv_finish+0x0/0x294 > [<c026f0c1>] nf_hook_slow+0x4d/0xb5 > [<c0273f1c>] ip_rcv_finish+0x0/0x294 > [<c027462f>] ip_rcv+0x20b/0x4bd > [<c0273f1c>] ip_rcv_finish+0x0/0x294 > [<f8ccd2ad>] search_by_key+0x17f/0xe87 [reiserfs] > [<c0127b32>] del_timer_sync+0xa/0x14 > [<c02afdfb>] schedule_timeout+0x79/0x8d > [<c025aee2>] netif_receive_skb+0x2ef/0x309 > [<c026e201>] __nla_put+0xe/0x25 > [<c025ca16>] process_backlog+0x7c/0xe9 > [<c025cbe6>] net_rx_action+0x95/0x186 > [<c012469f>] __do_softirq+0x6c/0xcf > [<c0124734>] do_softirq+0x32/0x36 > [<c0124900>] local_bh_enable+0x7b/0x89 > [<c025ced9>] dev_queue_xmit+0x202/0x221 > [<c0279686>] ip_output+0x269/0x2a3 > [<c0278d95>] ip_queue_xmit+0x358/0x39a > [<c014b589>] __alloc_pages+0x64/0x2a8 > [<c015e2ee>] cache_alloc_refill+0x74/0x45f > [<c028ba0f>] tcp_v4_send_check+0x86/0xbc > [<c0286f8f>] tcp_transmit_skb+0x618/0x652 > [<c0256fe4>] __alloc_skb+0x47/0x104 > [<c0289319>] tcp_connect+0x2a3/0x31d > [<c028c0cd>] tcp_v4_connect+0x493/0x5a4 > [<c0171eb3>] touch_atime+0x8b/0xac > [<c0296f23>] inet_stream_connect+0x87/0x20d > [<c01b6856>] copy_from_user+0x23/0x4f > [<c02518b5>] sys_connect+0x82/0xad > [<c02b0c6c>] _spin_lock_bh+0x8/0x18 > [<c02b0c6c>] _spin_lock_bh+0x8/0x18 > [<c02538c3>] release_sock+0x12/0x8c > [<c027d938>] tcp_setsockopt+0x309/0x321 > [<c016fb25>] d_alloc+0x14b/0x17e > [<c016f9d6>] d_instantiate+0x66/0x6a > [<c02532a4>] sock_common_setsockopt+0x1d/0x22 > [<c0251814>] sys_setsockopt+0x88/0xa7 > [<c0252e33>] sys_socketcall+0x8f/0x242 > [<c0103d16>] sysenter_past_esp+0x5f/0x85 > ======================= regards, -- Jiri Slaby (jirislaby@gmail.com) Faculty of Informatics, Masaryk University ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: textsearch in module = BUG: scheduling while atomic 2007-11-04 22:16 ` Jiri Slaby @ 2007-11-04 22:19 ` Jiri Slaby 2007-11-04 22:57 ` Felipe Dias 0 siblings, 1 reply; 7+ messages in thread From: Jiri Slaby @ 2007-11-04 22:19 UTC (permalink / raw) To: Felipe Dias; +Cc: linux-kernel On 11/04/2007 11:16 PM, Jiri Slaby wrote: > On 11/04/2007 11:05 PM, Felipe Dias wrote: >> Ow sorry... the warning: >> >> BUG: scheduling while atomic: gnome-cups-icon/0x00000101/3827 >> [<c02aefe6>] __sched_text_start+0x56/0x7c8 >> [<c0130139>] autoremove_wake_function+0x14/0x33 >> [<c0119284>] __wake_up_common+0x35/0x53 >> [<c01197f6>] __wake_up+0x32/0x43 >> [<c02af847>] wait_for_completion+0x6a/0x9f >> [<c011b6ae>] default_wake_function+0x0/0xc >> [<c012cdff>] call_usermodehelper_keys+0xad/0xc5 >> [<c012ceec>] request_module+0xd5/0xe6 > > Seems like it is not inteded for using in atomic at all (you probably passed an > unknown algo here to the prepare function). You seem to have to use a workqueue > if it is possible or prepare the serach before the interrupt occurs. Or pass 0 instead of TS_AUTOLOAD. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: textsearch in module = BUG: scheduling while atomic 2007-11-04 22:19 ` Jiri Slaby @ 2007-11-04 22:57 ` Felipe Dias 2007-11-05 14:02 ` Jiri Slaby 0 siblings, 1 reply; 7+ messages in thread From: Felipe Dias @ 2007-11-04 22:57 UTC (permalink / raw) To: Jiri Slaby; +Cc: linux-kernel I change the algo, from "bm" to "kmp" and probably resolve. I will make more tests and if error occour i post latter... Thanks so much. Felipe Dias On 11/4/07, Jiri Slaby <jirislaby@gmail.com> wrote: > On 11/04/2007 11:16 PM, Jiri Slaby wrote: > > On 11/04/2007 11:05 PM, Felipe Dias wrote: > >> Ow sorry... the warning: > >> > >> BUG: scheduling while atomic: gnome-cups-icon/0x00000101/3827 > >> [<c02aefe6>] __sched_text_start+0x56/0x7c8 > >> [<c0130139>] autoremove_wake_function+0x14/0x33 > >> [<c0119284>] __wake_up_common+0x35/0x53 > >> [<c01197f6>] __wake_up+0x32/0x43 > >> [<c02af847>] wait_for_completion+0x6a/0x9f > >> [<c011b6ae>] default_wake_function+0x0/0xc > >> [<c012cdff>] call_usermodehelper_keys+0xad/0xc5 > >> [<c012ceec>] request_module+0xd5/0xe6 > > > > Seems like it is not inteded for using in atomic at all (you probably passed an > > unknown algo here to the prepare function). You seem to have to use a workqueue > > if it is possible or prepare the serach before the interrupt occurs. > > Or pass 0 instead of TS_AUTOLOAD. > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: textsearch in module = BUG: scheduling while atomic 2007-11-04 22:57 ` Felipe Dias @ 2007-11-05 14:02 ` Jiri Slaby 0 siblings, 0 replies; 7+ messages in thread From: Jiri Slaby @ 2007-11-05 14:02 UTC (permalink / raw) To: Felipe Dias; +Cc: linux-kernel On 11/04/2007 11:57 PM, Felipe Dias wrote: > I change the algo, from "bm" to "kmp" and probably resolve. I will > make more tests and if error occour i post latter... Anyway, you should do what I suggested before -- pass 0 instead of TS_AUTOLOAD. If somebody doesn't have kmp module loaded it will spit out the warnings again, because the kernel will try to load it (and it's not atomic operation). regards, -- Jiri Slaby (jirislaby@gmail.com) Faculty of Informatics, Masaryk University ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-11-05 14:02 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-04 17:15 textsearch in module = BUG: scheduling while atomic Felipe Dias
2007-11-04 17:57 ` Jiri Slaby
[not found] ` <3c16e8dc0711041222w6bc67b3fn8320e982ffd723b0@mail.gmail.com>
[not found] ` <472E346E.90309@gmail.com>
2007-11-04 22:05 ` Felipe Dias
2007-11-04 22:16 ` Jiri Slaby
2007-11-04 22:19 ` Jiri Slaby
2007-11-04 22:57 ` Felipe Dias
2007-11-05 14:02 ` Jiri Slaby
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox