Re: textsearch in module = BUG: scheduling while atomic

2007-11-05 Thread Jiri Slaby
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 ([EMAIL PROTECTED])
Faculty of Informatics, Masaryk University
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: textsearch in module = BUG: scheduling while atomic

2007-11-04 Thread Felipe Dias
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 <[EMAIL PROTECTED]> 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/0x0101/3827
> >>  [] __sched_text_start+0x56/0x7c8
> >>  [] autoremove_wake_function+0x14/0x33
> >>  [] __wake_up_common+0x35/0x53
> >>  [] __wake_up+0x32/0x43
> >>  [] wait_for_completion+0x6a/0x9f
> >>  [] default_wake_function+0x0/0xc
> >>  [] call_usermodehelper_keys+0xad/0xc5
> >>  [] 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.
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: textsearch in module = BUG: scheduling while atomic

2007-11-04 Thread Jiri Slaby
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/0x0101/3827
>>  [] __sched_text_start+0x56/0x7c8
>>  [] autoremove_wake_function+0x14/0x33
>>  [] __wake_up_common+0x35/0x53
>>  [] __wake_up+0x32/0x43
>>  [] wait_for_completion+0x6a/0x9f
>>  [] default_wake_function+0x0/0xc
>>  [] call_usermodehelper_keys+0xad/0xc5
>>  [] 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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: textsearch in module = BUG: scheduling while atomic

2007-11-04 Thread Jiri Slaby
On 11/04/2007 11:05 PM, Felipe Dias wrote:
> Ow sorry... the warning:
> 
> BUG: scheduling while atomic: gnome-cups-icon/0x0101/3827
>  [] __sched_text_start+0x56/0x7c8
>  [] autoremove_wake_function+0x14/0x33
>  [] __wake_up_common+0x35/0x53
>  [] __wake_up+0x32/0x43
>  [] wait_for_completion+0x6a/0x9f
>  [] default_wake_function+0x0/0xc
>  [] call_usermodehelper_keys+0xad/0xc5
>  [] 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.

>  [] __next_cpu+0x12/0x21
>  [] find_busiest_group+0x1d6/0x55a
>  [] textsearch_prepare+0x8c/0x11a
>  [] __find_get_block_slow+0x127/0x131
>  [] hook_test+0x4c/0xb6 [test_mod]
>  [] __find_get_block+0x13f/0x149
>  [] nf_iterate+0x38/0x6a
>  [] ip_rcv_finish+0x0/0x294
>  [] nf_hook_slow+0x4d/0xb5
>  [] ip_rcv_finish+0x0/0x294
>  [] ip_rcv+0x20b/0x4bd
>  [] ip_rcv_finish+0x0/0x294
>  [] search_by_key+0x17f/0xe87 [reiserfs]
>  [] del_timer_sync+0xa/0x14
>  [] schedule_timeout+0x79/0x8d
>  [] netif_receive_skb+0x2ef/0x309
>  [] __nla_put+0xe/0x25
>  [] process_backlog+0x7c/0xe9
>  [] net_rx_action+0x95/0x186
>  [] __do_softirq+0x6c/0xcf
>  [] do_softirq+0x32/0x36
>  [] local_bh_enable+0x7b/0x89
>  [] dev_queue_xmit+0x202/0x221
>  [] ip_output+0x269/0x2a3
>  [] ip_queue_xmit+0x358/0x39a
>  [] __alloc_pages+0x64/0x2a8
>  [] cache_alloc_refill+0x74/0x45f
>  [] tcp_v4_send_check+0x86/0xbc
>  [] tcp_transmit_skb+0x618/0x652
>  [] __alloc_skb+0x47/0x104
>  [] tcp_connect+0x2a3/0x31d
>  [] tcp_v4_connect+0x493/0x5a4
>  [] touch_atime+0x8b/0xac
>  [] inet_stream_connect+0x87/0x20d
>  [] copy_from_user+0x23/0x4f
>  [] sys_connect+0x82/0xad
>  [] _spin_lock_bh+0x8/0x18
>  [] _spin_lock_bh+0x8/0x18
>  [] release_sock+0x12/0x8c
>  [] tcp_setsockopt+0x309/0x321
>  [] d_alloc+0x14b/0x17e
>  [] d_instantiate+0x66/0x6a
>  [] sock_common_setsockopt+0x1d/0x22
>  [] sys_setsockopt+0x88/0xa7
>  [] sys_socketcall+0x8f/0x242
>  [] sysenter_past_esp+0x5f/0x85
>  ===

regards,
-- 
Jiri Slaby ([EMAIL PROTECTED])
Faculty of Informatics, Masaryk University
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: textsearch in module = BUG: scheduling while atomic

2007-11-04 Thread Felipe Dias
Ow sorry... the warning:

BUG: scheduling while atomic: gnome-cups-icon/0x0101/3827
 [] __sched_text_start+0x56/0x7c8
 [] autoremove_wake_function+0x14/0x33
 [] __wake_up_common+0x35/0x53
 [] __wake_up+0x32/0x43
 [] wait_for_completion+0x6a/0x9f
 [] default_wake_function+0x0/0xc
 [] call_usermodehelper_keys+0xad/0xc5
 [] request_module+0xd5/0xe6
 [] __next_cpu+0x12/0x21
 [] find_busiest_group+0x1d6/0x55a
 [] textsearch_prepare+0x8c/0x11a
 [] __find_get_block_slow+0x127/0x131
 [] hook_test+0x4c/0xb6 [test_mod]
 [] __find_get_block+0x13f/0x149
 [] nf_iterate+0x38/0x6a
 [] ip_rcv_finish+0x0/0x294
 [] nf_hook_slow+0x4d/0xb5
 [] ip_rcv_finish+0x0/0x294
 [] ip_rcv+0x20b/0x4bd
 [] ip_rcv_finish+0x0/0x294
 [] search_by_key+0x17f/0xe87 [reiserfs]
 [] del_timer_sync+0xa/0x14
 [] schedule_timeout+0x79/0x8d
 [] netif_receive_skb+0x2ef/0x309
 [] __nla_put+0xe/0x25
 [] process_backlog+0x7c/0xe9
 [] net_rx_action+0x95/0x186
 [] __do_softirq+0x6c/0xcf
 [] do_softirq+0x32/0x36
 [] local_bh_enable+0x7b/0x89
 [] dev_queue_xmit+0x202/0x221
 [] ip_output+0x269/0x2a3
 [] ip_queue_xmit+0x358/0x39a
 [] __alloc_pages+0x64/0x2a8
 [] cache_alloc_refill+0x74/0x45f
 [] tcp_v4_send_check+0x86/0xbc
 [] tcp_transmit_skb+0x618/0x652
 [] __alloc_skb+0x47/0x104
 [] tcp_connect+0x2a3/0x31d
 [] tcp_v4_connect+0x493/0x5a4
 [] touch_atime+0x8b/0xac
 [] inet_stream_connect+0x87/0x20d
 [] copy_from_user+0x23/0x4f
 [] sys_connect+0x82/0xad
 [] _spin_lock_bh+0x8/0x18
 [] _spin_lock_bh+0x8/0x18
 [] release_sock+0x12/0x8c
 [] tcp_setsockopt+0x309/0x321
 [] d_alloc+0x14b/0x17e
 [] d_instantiate+0x66/0x6a
 [] sock_common_setsockopt+0x1d/0x22
 [] sys_setsockopt+0x88/0xa7
 [] sys_socketcall+0x8f/0x242
 [] sysenter_past_esp+0x5f/0x85
 ===


Thanks,
Felipe Dias

On 11/4/07, Jiri Slaby <[EMAIL PROTECTED]> 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 ([EMAIL PROTECTED])
> Faculty of Informatics, Masaryk University
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: textsearch in module = BUG: scheduling while atomic

2007-11-04 Thread Jiri Slaby
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/0x1101/3710
>  [] __sched_text_start+0x56/0x7c8
>  [] __wake_up_common+0x35/0x53
>  [] __wake_up+0x32/0x43
>  [] tcp_v4_send_check+0x86/0xbc
>  [] __cond_resched+0x18/0x29
>  [] cond_resched+0x26/0x31
>  [] __kmalloc+0x38/0x6e
>  [] bm_init+0x28/0x1c9 [ts_bm]
>  [] __alloc_skb+0x47/0x104
>  [] textsearch_prepare+0xf4/0x11a
>  [] hook_test+0x4c/0xb6 [test_mod]
>  [] tcp_v4_rcv+0x84c/0x8aa
>  [] nf_iterate+0x38/0x6a
>  [] ip_rcv_finish+0x0/0x294
>  [] nf_hook_slow+0x4d/0xb5
>  [] ip_rcv_finish+0x0/0x294
>  [] ip_rcv+0x20b/0x4bd
>  [] ip_rcv_finish+0x0/0x294
>  [] netif_receive_skb+0x2ef/0x309
>  [] process_backlog+0x7c/0xe9
>  [] net_rx_action+0x95/0x186
>  [] __do_softirq+0x6c/0xcf
>  [] do_softirq+0x32/0x36
>  [] local_bh_enable+0x7b/0x89
>  [] dev_queue_xmit+0x202/0x221
>  [] ip_output+0x269/0x2a3
>  [] ip_queue_xmit+0x358/0x39a
>  [] journal_end+0xba/0xc2 [reiserfs]
>  [] reiserfs_dirty_inode+0x78/0x7e [reiserfs]
>  [] tcp_transmit_skb+0x618/0x652
>  [] __tcp_push_pending_frames+0x71c/0x7cc
>  [] reiserfs_file_write+0x1841/0x1871 [reiserfs]
>  [] __alloc_skb+0x47/0x104
>  [] tcp_sendmsg+0x91b/0x9f0
>  [] skb_copy_datagram_iovec+0x53/0x1d0
>  [] tcp_recvmsg+0x8e5/0x9f0
>  [] sock_aio_write+0xf3/0xfb
>  [] do_sync_readv_writev+0xc0/0x103
>  [] autoremove_wake_function+0x0/0x33
>  [] sys_getsockname+0x9f/0xb0
>  [] copy_from_user+0x23/0x4f
>  [] rw_copy_check_uvector+0x50/0xaa
>  [] do_readv_writev+0xbc/0x187
>  [] sock_aio_write+0x0/0xfb
>  [] do_page_fault+0x273/0x516
>  [] vfs_writev+0x3d/0x48
>  [] sys_writev+0x41/0x67
>  [] 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 ([EMAIL PROTECTED])
Faculty of Informatics, Masaryk University
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/