There are four places, all in cam_xpt.c, where ccbs are malloc'ed. Two use M_ZERO and two don't. Use M_ZERO in all cases.
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
Don't see why this would cause problems, but get Scott or Mav to give the nod before committing.
Comment Actions
CCB structure is quite large. I worry that zeroing it on every request can be too heavy and pointless.
Comment Actions
For the sake of safety, it needs to be done. It's likely to not be as expensive as you fear, though. Many of the data fields get written to immediately after the allocation and zeroing, so the multiple writes will collect and collapse together in the caches.
What needs to be done long-term is for the CCB allocation scheduler to go away so that CCBs can be allocated based on the needed sub-type, and thus have a dynamic size. That allocation can then be moved to a custom UMA zone with a constructor that zeros fields in a more intelligent way.