Chuck Silvers <c...@chuq.com> wrote: > In your new diff, the pageq lock is still used by the pagedaemon > (for uvmpd_trylockowner() as you noted in the comment). > It would be good not to have a global lock involved in changing page > identity, and with the pageq's now protected by a separate lock, we > should be able to eliminate the need for the pageq lock when freeing a > page with an RCUy thing to prevent freeing uvm_object and uvm_anon > structures while the pagedaemon might still be accessing them via the > vm_page fields. We should be able to improve the locking for > pg->loan_count with a similar RCUy thing... my recollection is that the > only reason loan_count uses the pageq lock currently is to stabilize the > page identity while locking the owning object. It might make sense to > have pg->wire_count protected by the pdpol lock too (though I have some > thoughts about changing the nature of wire_count that would probaby make > that not make sense, I haven't had time to think that through yet).
Just a small note: since vm_page::wire_count and vm_page::loan_count are kind of mutually exclusive, I think suggestion by yamt@ (long time ago) to merge them (positive value meaning wired count and negative -- loan) is a useful one. It would also free up those 16-bits, since Andrew seems to be in need of some. -- Mindaugas