pan/midgard: Compute spill costs