Defer and aggregate swap_pager_meta_build frees
Needs ReviewPublic

Authored by dougm_rice.edu on Sun, Dec 31, 5:03 AM.

Details

Reviewers
alc
kib
markj
Summary

Before swp_pager_meta_build replaces an old swapblk with an new one, it frees the old one. To allow such freeing of blocks to be aggregated, have swp_pager_meta_build return the old swap block, and make the caller responsible for freeing it.

Define a pair of short static functions, swp_pager_init_freerange and swp_pager_update_freerange, to do the initialization and updating of blk addresses and counters used in aggregating blocks to be freed.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
dougm_rice.edu created this revision.

Add missing declaration.

kib accepted this revision.Sat, Jan 13, 12:46 PM
kib added inline comments.
sys/vm/swap_pager.c
414

Blank line is needed after '{'.

421

Same. Also please put {} around then case.

1416–1417

De-split this line, please. There is a lot of free space left, the call does not need to take 5 lines.

This revision is now accepted and ready to land.Sat, Jan 13, 12:46 PM
dougm_rice.edu marked 3 inline comments as done.

Apply reviewer suggestions.

This revision now requires review to proceed.Sat, Jan 13, 5:08 PM
markj accepted this revision.Sun, Jan 14, 5:22 PM
markj added inline comments.
sys/vm/swap_pager.c
991

"source block"?

This revision is now accepted and ready to land.Sun, Jan 14, 5:22 PM

Add recommended space to one comment.

This revision now requires review to proceed.Sun, Jan 14, 5:37 PM