RE: thread funnel and sbplio -solution
RE: thread funnel and sbplio -solution
- Subject: RE: thread funnel and sbplio -solution
- From: "George Andre" <email@hidden>
- Date: Mon, 22 Jul 2002 21:05:02 +0200
Ok guys,
I found the solution and the cause to my problem.
I had left in code that used KUNCExecute() to spawn
and execute an external program. So, in some mysterious
way, most of the VOP_, vn_ and namei() worked even if
the thread funnel was null, when this API was executed
before.
Now I got rid of the code using KUNCExecute and called
thread_funnel_set() from start() and stop() and everything
works correctly now, alltogether.
This seems to me like material for a bug report, where does
someone send these kinds of reports?
Thanks for the assistance,
George.
>
-----Original Message-----
>
From: email@hidden
>
[mailto:email@hidden]On Behalf Of George Andre
>
Sent: den 22 juli 2002 20:03
>
To: Brian Bergstrand; email@hidden;
>
email@hidden
>
Subject: RE: thread funnel and sbplio
>
>
>
> >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.
_______________________________________________
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.