Update a couple vm object lock assertions in the swap pager to reflect the new use of the vm object's lock to synchronize updates to a radix trie mapping per-vm object page indices to on-disk swap blocks.
Fix a typo in a nearby comment.
Differential D12134
Update vm object lock assertions in the swap pager alc on Aug 26 2017, 9:11 PM. Authored by Tags None Referenced Files
Subscribers None
Details Update a couple vm object lock assertions in the swap pager to reflect the new use of the vm object's lock to synchronize updates to a radix trie mapping per-vm object page indices to on-disk swap blocks. Fix a typo in a nearby comment.
Diff Detail
Event TimelineComment Actions This change reveals a problem: vm_fault_soft_fast() is (indirectly) calling vm_pager_page_unswapped() with only a read lock. Comment Actions My understanding is that this is a valid assert in the following situation: we have a swap object with a valid page which was swapped in and not dirtied. Then, on a write fault, any (fast or normal) fault handlers could free the swap space. It is possible because swap pager page-in leaves the backed swap space intact as (IMO very small) optimization. I think that as a solution we can leave the swap allocated. If the page going to swap later again, swp_pager_meta_build() correctly frees the old space. This causes some time-limited leak of the swap space, which is IMO acceptable. Comment Actions It might also be the case that we write fault on a just laundered page before it is reclaimed.
Agreed. |