Reordered condition to avoid calling allow_migrate() if unneeded.