Page MenuHomeFreeBSD

Break down swap_pager_swapoff function into small functions.

Authored by on Jun 7 2019, 1:08 AM.



Originally in D13484.
Simpler code refactoring is taken out from sensitive changes.

swp_pager_force_dirty() and swp_pager_force_launder() out of swp_pager_force_pagein().
swap_pager_swapoff_object() out of swap_pager_swapoff()

Test Plan

Regresssion - no functionality changes.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

1657 ↗(On Diff #58336)

This is an extra wakeup, after the wakeup in the caller.

1673 ↗(On Diff #58336)

Another duplicate wakeup.

1738 ↗(On Diff #58336)

No need to wrap this line to fit in 80 columns.

Move vm_object_pip_wakeup() and vm_pager_page_unswapped() back to swp_pager_force_pagein().

These 2 functions will be adjusted to handle multiple pages in D13484.

This revision is now accepted and ready to land.Jun 8 2019, 4:44 PM
kib added inline comments.
1736 ↗(On Diff #58350)

I believe that the patch is fine, but looking at it, I realized that swp_pager_force_pagein()->swap_pager_getpages() drops vm_object lock, which IMO allows sb to become invalid pointer. And even the busy state of the page around the unlock is not enough IIMO.

This revision was automatically updated to reflect the committed changes.