xen: don't free percpu areas during suspend

Instead of freeing percpu areas during suspend and allocating them
again when resuming keep them. Only free an area in case a cpu didn't
come up again when resuming.

It should be noted that there is a potential change in behaviour as
the percpu areas are no longer zeroed out during suspend/resume. While
I have checked the called cpu notifier hooks to cope with that there
might be some well hidden dependency on the previous behaviour. OTOH
a component not registering itself for cpu down/up and expecting to
see a zeroed percpu variable after suspend/resume is kind of broken
already. And the opposite case, where a component is not registered
to be called for cpu down/up and is not expecting a percpu variable
suddenly to be zero due to suspend/resume is much more probable,
especially as the suspend/resume functionality seems not to be tested
that often.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Juergen Gross authored and Andrew Cooper committed 2019-04-04 11:10:12 +01:00
1 parent 51c79e943f
commit aca2a985a5
1 file changed
+2 -1
+2 -1
View File
@@ -76,7 +76,8 @@ static int cpu_percpu_callback(
break;
case CPU_UP_CANCELED:
case CPU_DEAD:
if ( !park_offline_cpus )
case CPU_RESUME_FAILED:
if ( !park_offline_cpus && system_state != SYS_STATE_suspend )
free_percpu_area(cpu);
break;
case CPU_REMOVE:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.