pv chunks are kept on a global list, they can be iterated instead when needed.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 26892
Event Timeline
Well, this relies on the pv chunks list consistency. In other words, if any CPU in the system modifies pv lru list, minidump would hang/crash.
More, you are locking the mutex, which is either nop or hangs as well.
This can be modified to use CK_* macros which make it safe to traverse in face of modification performed at the same time.
Then this can only be a problem if the list gets corrupted and that's what we have to traverse. Should this be of concern, pv chunk can grow a 'magic' field to verify the next element is of the right type. I verified there is 16 bytes of unused space in there.
This still can run into loops, which again can be handled in at least two ways: either stop the traversal after n entries or maintain a global counter (per-cpu based).
No matter what though, there should be on reason to actively maintain the bitmap.
This struct should start getting cached, which will have a side effect of not wandering to the minidump array this often.