The final product isn't here to test. What is here is a patch that shouldn't affect anything but performance, a little, but that should log something to help figure out how to tune the code that will trim freed swap space. So, any sort of test that exercises plenty of swap space is good. What is needed from it is the log entries generated from this line:
CTR4(KTR_SPARE5, "swapdev_trim: cursor %p alloc %d trimmer %p trimsize %d",
(void*)sp->sw_cursor, alloc_npages, (void*)sp->sw_trimmer, nblks);
Whenever you have the time to exercise this code, Peter, please do.