Skip to content

Commit 465dda9

Browse files
hmynenimpe
authored andcommitted
powerpc/pseries: Move vas_migration_handler early during migration
When the migration is initiated, the hypervisor changes VAS mappings as part of pre-migration event. Then the OS gets the migration event which closes all VAS windows before the migration starts. NX generates continuous faults until windows are closed and the user space can not differentiate these NX faults coming from the actual migration. So to reduce this time window, close VAS windows first in pseries_migrate_partition(). Signed-off-by: Haren Myneni <haren@linux.ibm.com> Reviewed-by: Nathan Lynch <nathanl@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/d8efade91dda831c9ed4abb226dab627da594c5f.camel@linux.ibm.com
1 parent 1da5351 commit 465dda9

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

arch/powerpc/platforms/pseries/mobility.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -740,11 +740,19 @@ static int pseries_migrate_partition(u64 handle)
740740
#ifdef CONFIG_PPC_WATCHDOG
741741
factor = nmi_wd_lpm_factor;
742742
#endif
743+
/*
744+
* When the migration is initiated, the hypervisor changes VAS
745+
* mappings to prepare before OS gets the notification and
746+
* closes all VAS windows. NX generates continuous faults during
747+
* this time and the user space can not differentiate these
748+
* faults from the migration event. So reduce this time window
749+
* by closing VAS windows at the beginning of this function.
750+
*/
751+
vas_migration_handler(VAS_SUSPEND);
752+
743753
ret = wait_for_vasi_session_suspending(handle);
744754
if (ret)
745-
return ret;
746-
747-
vas_migration_handler(VAS_SUSPEND);
755+
goto out;
748756

749757
if (factor)
750758
watchdog_nmi_set_timeout_pct(factor);
@@ -765,6 +773,7 @@ static int pseries_migrate_partition(u64 handle)
765773
if (factor)
766774
watchdog_nmi_set_timeout_pct(0);
767775

776+
out:
768777
vas_migration_handler(VAS_RESUME);
769778

770779
return ret;

0 commit comments

Comments
 (0)