Hi there,
I am new to ebtables code and looking for some help related to locking and
atomicity. I am using Xen 3.0.4 in bridge mode and interested in looking into
the packets intercepted by dom0 ebtables code, extract some information, pass
this information to userspace, wait for userspace response and then pass the
result back to ebtable code.
Everything seemed to be working fine until i encountered locking issues. In the
ebt_do_table code there is a "read_lock_bh" is used. When i try to
wait inside this code path after sending info to my userspace tool and before
returning NF_ACCEPT or NF_DROP, either the CPU hangs or i get an error
"schedule while atomic". I tried out different methods for waiting
like "wait_event_timeout" or busy while loop etc. The problem that I
understood is that since read_lock_bh disables CPU preemption and do
"local_bh_disable", if i wait with something that try to call
schedule() I get "schedule while atomic" error. And, if i do busy
waiting it means am stuck for ever as preemption is disabled anyways.
It is like chicken and egg problem. I want to wait and let my userspace process
schedule so that I could get response from it but the code path is atomic so i
cannot schedule my process. After trying out everything I am clueless as what to
do.
Any help in this regard would be really appreciated.
Thanks,
Abhinav
---------------------------------
Once upon a time there was 1 GB storage in your inbox. Click here for happy
ending.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel