Problem
Registry.populateDSO in dso/map.go holds an exclusive sync.Mutex for the entire function duration, including the expensive binaryParser.Parse(ctx, f) ELF parsing operation:
dso.bpfAllocationMutex.Lock()
defer dso.bpfAllocationMutex.Unlock()
// ... fast allocation check ...
analysis, err := d.binaryParser.Parse(ctx, f) // slow — held under lock
This serialises all concurrent DSO loads on a single binary parse, which can be significant at agent startup when many processes are discovered simultaneously.
Proposed fix
- Change
sync.Mutex → sync.RWMutex
- Fast path (check + MoveFromCache/Release) stays under exclusive lock — remains fast
binaryParser.Parse runs without any lock
- Write lock re-acquired to store result, with double-check guard against concurrent population
Files affected
perforator/agent/collector/pkg/dso/map.go
Problem
Registry.populateDSOindso/map.goholds an exclusivesync.Mutexfor the entire function duration, including the expensivebinaryParser.Parse(ctx, f)ELF parsing operation:This serialises all concurrent DSO loads on a single binary parse, which can be significant at agent startup when many processes are discovered simultaneously.
Proposed fix
sync.Mutex→sync.RWMutexbinaryParser.Parseruns without any lockFiles affected
perforator/agent/collector/pkg/dso/map.go