[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] ebtables locking issue


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Abhinav Srivastava <abhinavs_iitkgp@xxxxxxxxxxx>
  • Date: Tue, 14 Aug 2007 18:22:47 +0100 (BST)
  • Delivery-date: Tue, 14 Aug 2007 10:23:13 -0700
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=LsJDL9AeSWCgtss6dAcHOjN3h96EBSNoLx99236Ni5wwR9XAavNTFuQBMupaRqhnBhsbhdqAF0P7PFwnRBMuwtDuBvVEGOmqzvLFwHJlVahIHtq/wNK2MIM6m9evpwaVBM0TkicWX7tNE+C8qSg9cQeHnm6pjFXEADW3EWbfPR4=;
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>


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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.