Rather attempting to free invalid pages, accelerate their reclamation
by moving them near the head of the inactive queue. With this change,
bufspace threads don't touch the object lock.
Details
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 15700 Build 15728: arc lint + arc unit
Event Timeline
sys/kern/vfs_bio.c | ||
---|---|---|
2925–2936 | I think this can only race when multiple bufs reference the same page. It might be worth commenting on that specifically. |
sys/kern/vfs_bio.c | ||
---|---|---|
2925–2936 | Generally, what I like to see in these cases is a comment explaining why the race is benign. |
sys/kern/vfs_bio.c | ||
---|---|---|
2931 | How is the buffer lock stopping the VM system from changing the state of the valid field? Suppose that the containing object is logically mapped in an address space. In that case, it's not clear to me that everything that might affect the valid field is going to acquire a buffer lock. |
sys/kern/vfs_bio.c | ||
---|---|---|
2931 | It isn't. I guess "most cases" is misleading, but I added it because of the cases that you and Jeff described. How about, "The valid bits will be stable unless the page is mapped or referenced by multiple buffers, and we expect races to be rare in those cases." |
sys/kern/vfs_bio.c | ||
---|---|---|
2931 | Okay. I would suggest swapping the second and third sentences. In other words, I would talk about the likelihood of the race before talking about the consequences. |
sys/kern/vfs_bio.c | ||
---|---|---|
2928 | What do you mean by 'mapped' there ? And what is the difference with 'referenced' ? |
sys/kern/vfs_bio.c | ||
---|---|---|
2928 | "mapped into a process' address space" as opposed to having multiple buffers which contain pointers to the same page. I thought the latter is possible e.g., with sub-page FFS block fragments. |
sys/kern/vfs_bio.c | ||
---|---|---|
2928 | Then I miss something. Mapped page must be valid. Other part, about sub-page fragments, sounds correct. |
sys/kern/vfs_bio.c | ||
---|---|---|
2928 | "in the process of being mapped" is closer to what I meant. I think there is a possibility (perhaps impossible in practice) that a concurrent fault might mark the page valid. |
sys/kern/vfs_bio.c | ||
---|---|---|
2928 | So it is really any invalid page. But the page is still fine. |