Hi coders,

I know a beter place is the the kernel-development list but its netfilter 
related


I created my own logging system for netfilter but sometimes i run into a 
deadlock and i think i found it but i'm not sure...


My netfilter log calls are on various places in netfilter and those funtions 
post messages to MyQueue this queue is threadsafe and at the otherside of 
MyQueue a scheduled task is active that do some processing before it sees 
daylight in userspace.

So lets concentrate on MyQueue.
On one site, the netfilter stuff (running bottom half?) and on the otherside 
a task that is scheduled every 100ms to process MyQueue (via schedule_task() 
)

I made MyQueue threadsafe with a mutex and it results in a deadlock of the 
complete kernel. I assume the scheduled task is in the mutex of MyQueue and 
than an interrupt comes that results in netfilter activity which i want to 
log and that hits the mutex of MyQueue that is in use by my scheduled task. 
Before the netfilter can go further first the schedule stask have to finish 
but there is no context switch since the netfilter is bottomhalf (am i 
right?)

I tried it also with spinlocks and using spin_lock and spin_unlock calls but 
this make no sense for my single processor machine, it even lock faster and 
harder. I would use the spin_lock_bh and the spin_unlock_bh but this 
resulted in a compilor error "undefined reference to: local_bh_disable"

I would like to know how to synchonize between netfilter (bottomhalf) and 
the scheduled task, without disabling all the interrupts.


Thanx for your help,
Andre


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


Reply via email to