For example, record the cycle count when getting the lock and when releasing the lock, record the difference as N. The next lock spinner in line should ideally wait N+1 cycles before checking the lock.
Then on the next kernel build use those profile numbers and record them in each spinlock structure.
This would work perfectly if it weren't for the pesky problems of unexpected cache line misses, CPU interrupts and other interference.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds