Re: [patch] POSIX advisory mode lock panic fix by Dfly

看板DFBSD_submit作者時間21年前 (2004/05/03 14:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串15/17 (看更多)
:I didn't have time to check the actual limits, but the patch :ftp://dragonflybsd.dyndns.org/lockf5.diff :implements the whole kern_lockf stuff, some adjusts to the global :interface and the resource limits. I'll do the rest later with the :new world at home. : :It passes the sys/kern/lockf regression test from NetBSD and boots fine. :I'm doing some more checks, moving the debug conditionals out of INVARIANTS :and add a general print function for struct lockf. But the functionality :itself should be working. : :What do you think? I got some feedback from Hiten and Devon already. :I suppose ref counting and allocation are as near as possible :) : :Joerg Well, I guess I can't convince people to change the counting scheme. Oh well, I tried :-) I guess you can go ahead and put it on a commit track. You've certainly done the work! I noticed one issue with the code, and that is the fact that since the malloc() can block and the locking operations appear to be called without a locked vnode (which is how we want to call them), there is a race where the lock list can get corrupted if malloc() blocks. I think the solution is to pre-allocate two lock structures at the beginning and then free whichever ones we wind up not using at the end. If you are worried about performance, you can implement a simple linked list in the per-cpu globaldata to cache free structures. For a first implementation, though, I'd simply use malloc(). -Matt
文章代碼(AID): #10bUTb00 (DFBSD_submit)
討論串 (同標題文章)
文章代碼(AID): #10bUTb00 (DFBSD_submit)