Record as much bits from curthread into busy_lock. Low bits for struct thread * representation are zero due to struct and zone alignment, and they leave space for busy flags (perhaps except statically allocated thread0). Upper bits are not very interesting for assert, and in most practical situations recorded value should allow to identify the owner with certainty.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
I used 'tid' for debugging in the past. You can get the whole tid in. We can do somewhat more meaningful asserts with that but we'd have to deal with I/O ala BUF_KERNPROC
I don't know what the significance of the R postfix on "EXCLUSIVER" means. If you are going to change these macros I would suggest we rename it to EXCLUSIVE.
Is there a bug you are chasing?
I considered using tid, and I did not like it. The bit pattern for curthread allows to immediately recognize the value, while tid would need to be extracted. Also, tid could be reused, while struct thread is type-stable.
I don't know what the significance of the R postfix on "EXCLUSIVER" means. If you are going to change these macros I would suggest we rename it to EXCLUSIVE.
Ok.
Is there a bug you are chasing?
I principle yes, but I am not sure that this would directly points the finger. Still it should be useful.
sys/vm/vm_page.h | ||
---|---|---|
692 ↗ | (On Diff #64125) | This assert may not work in all cases as written due to busy being released in a different thread than the one that acquired it. |
sys/vm/vm_page.h | ||
---|---|---|
692 ↗ | (On Diff #64125) | I do not remember such places. I think I will introduce weaker asserts in addition to this stronger kind. |
sys/vm/vm_page.h | ||
---|---|---|
692 ↗ | (On Diff #64125) | I only know of specific examples with sbusy. I'm not 100% sure it does happen with xbusy. If it passes stress tests it's probably ok. |
Weaken asserts when pages are unbusy in context of io completion handlers.
This variant passed stress2 testing.