Page MenuHomeFreeBSD

Be consistent with M_ZERO use when allocating ccbs
AcceptedPublic

Authored by benno on Mar 23 2015, 6:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 23, 5:32 AM
Unknown Object (File)
Thu, Jan 23, 5:04 AM
Unknown Object (File)
Jan 9 2025, 1:25 AM
Unknown Object (File)
Nov 21 2024, 1:45 PM
Unknown Object (File)
Nov 18 2024, 7:06 AM
Unknown Object (File)
Nov 18 2024, 12:58 AM
Unknown Object (File)
Nov 15 2024, 3:40 AM
Unknown Object (File)
Nov 11 2024, 12:07 PM
Subscribers

Details

Reviewers
scottl
imp
mav
Summary

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

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

benno retitled this revision from to Be consistent with M_ZERO use when allocating ccbs.
benno updated this object.
benno edited the test plan for this revision. (Show Details)
benno added reviewers: scottl, mav.
imp added a reviewer: imp.
imp added a subscriber: imp.

Don't see why this would cause problems, but get Scott or Mav to give the nod before committing.

This revision is now accepted and ready to land.Mar 23 2015, 6:37 PM
scottl edited edge metadata.

CCB structure is quite large. I worry that zeroing it on every request can be too heavy and pointless.

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.