Re: sema replacement

看板DFBSD_kernel作者時間21年前 (2005/02/09 07:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/4 (看更多)
It looks like the code queues up a request and then uses sema_wait() to sleep until the request either completes or fails. In both cases, the code calls sema_post(). Maybe this is a better fit for messaging - i.e. sema_wait would map to lwkt_waitport() and sema_post would map to lwkt_sendmsg()? Matthew Dillon wrote: > :FreeBSD's new ATA code makes use of kernel counting semaphores (sema(9)) > :in the queuing code which don't seem to exist in DragonFly*. I think the > :serializing tokens are the replacement and wanted to see if a) that was > :the right approach and if so, b) do you use lockmgr or is it preferable > :to use the tokens directly. TIA > : > :* though, there does seem to be a private implementation in ffs_softdep.c > : > :-- > :Chuck Tuffli > :Agilent Technologies > > I would say we want to use tokens for now. The ATA driver core should > be mostly non-blocking, at least presuming that sos hasn't added > mallocs in the middle of the code (like existed in the original 4.x > driver). This makes the token model a better fit. > > I won't even ask why they are using yet another (this is like the > 8th or 9th now) locking API. Semaphores don't really fit the model for > the type of locking they need. > > -Matt > Matthew Dillon > <dillon@backplane.com> -- Chuck Tuffli Agilent Technologies
文章代碼(AID): #122Klr00 (DFBSD_kernel)
文章代碼(AID): #122Klr00 (DFBSD_kernel)