- convert spin lock to def lock
- reading always happen in single thread, remove lock protection
Details
Details
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 2358 Build 2374: arc lint + arc unit
Event Timeline
sys/dev/hyperv/vmbus/hv_ring_buffer.c | ||
---|---|---|
357 | So this is nit picking, but do yo need memory barriers here if you intend to peek? the lock ends up being effectively a memory barrier.. |
Comment Actions
No. Since read/peek are happened in single thread, no mb is needed. Peek is just a normal read except it copies less data and doesn't advance the read position.
Comment Actions
I just double checked the code. It is not MPSAFE to process the recv ring w/o lock, e.g. storvsc_poll(), which could be called in another thread. I think the spinlock -> default mtx change should be fine.
Comment Actions
I think we could pass a flag down to the recv ring read/peek, so that we could do lockless read for other drivers.