RE: thread funnel and sbplio
RE: thread funnel and sbplio
- Subject: RE: thread funnel and sbplio
- From: "George Andre" <email@hidden>
- Date: Mon, 22 Jul 2002 20:02:36 +0200
>
>I'm getting a nasty panic while doing a VOP_GETATTR().
>
>It says that "splbio() not under funnel". Traced that
>
>down to splbio() which checks for the current thread funnel.
>
>I put some debug prints before the VOP_GETATTR() call and
>
>the thread has no funnel held. So what I did was add a:
>
See below.
>
>thread_funnel_set(kernel_flock,TRUE)
>
>respective
>
>thread_funnel_set(kernel_flock,FALSE) around the VOP_GETATTR()
>
>call, still with the same result...
>
>
This should work. Are you sure you aren't making other calls
>
requiring the kernel funnel after releasing it?
>
Hi Brian,
Yes, the panic is traced to the VOP_GETATTR call (commenting it out
doesn't crash the kernel).
>
Where in your code are you trying to call this. The kernel usually
>
makes sure that you are under the correct funnel (which is probably
>
why your other VOP calls work fine). Places where you don't
>
automatically have the funnel and must acquire it yourself are: 1)
>
Your kmod start/stop entry points, 2) Any new thread entry point, and
>
3) any timer callback.
Well this is funny but I don't have the kernel funnel at all when
calling the other stuff and it works perfectly. All this stuff
is called from the start() method of a KEXT (actually 2 levels down).
I have 4 functions I've implemented (kfread, kfclose, kfopen and kfsize).
kfopen,close and kfread work ok (with NO funnel, checked by debug printing
the value returned by thread_funnel_get()). These functions use the NDINIT,
vn_open, VOP_UNLOCK, vn_rdwr, vn_close, without any failures and I'm able
to read from the file what I want.. What I can't do however is call
VOP_GETATTR safely in kfsize().
I've even put the whole kfsize() function inbetween thread_funnel_set's,
with exactly the same result.
What I don't obviously do is have thread_funnel_set called first in my
start() and stop(). I'll try that immediately, but logically, it should
be the same as making sure the funnel is acquired for one operation, right?
I also read somewhere that funnels are released at rescheduling and
reacquired after. Can that have something to do with my situation?
>
PS. Please don't crosspost. Pick one list and send to that. If you
>
don't get a response, try another list.
'Aight. :)
Thanks,
George.
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.