New loop now takes into account pages not physically contiguous. Also some minor improvements, e.g. make the spin_lock used more locally, reuse a group we had if we had one, etc.