Two places in vm_phys.c iterate over free blocks of increasing size and put each block in a free list. The first of them is in vm_phys_enq_range; that's all that it does. The second is near the start of vm_phys_enqueue_contig. Replace that second instance with a call to vm_phys_enq_range.
Drop some unnecessary variable updating from vm_phys_enq_range.