[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 17/19] xen: don't free percpu areas during suspend


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Fri, 7 Oct 2022 10:32:51 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1qf6AA5NEbLzd3qFM2Qjj9M0bqVZ+Q4ALQBxoGny/l0=; b=LXv/oSQ38HhL8GAMS9Acsrxdzq8iPJqeX238udgugmjX8Y2vsH8aOs5qAORBS9O3h6UbjKnRnqm4Fil2I5PhyPlQVXN2xTIna5MQWxw9XH93f9ZVUuQJpTbhZCUFyPdIQf74gp1NTbwXDYBSMlIMDHWkoyZ7HKNW+oni7Pv62ZncpLmEIrXD5M+msgCWc9+etwTaLG9d/fbiOaFo/+MFZ+csM/XvGW6thGV/KbzJO4yR8QuTy1gZY511c30uE2hQxQZTeqxW+tc0D5GYhOsKNhgGNkIPpwxZg4cYqrsIkqqAPsBWzk74Ot44bKQN5Ox70im1CuOZAVdwlV0PUnSI4g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EkzCvlc+0u3GZIlM4U++d39+MIe3yuwa1arWJwKL+3AwyZjJz1HsX6FTU4rfDwW2DsXezKGGNCpjvCyV6UnjcWW6RTLSdMhz9iJu8TzD59muekLSTImpIf8K4rLQ9wbwwbr8E0BEyIFQutC37dG1pspzb811xdUJcsw5qbxP36ie81DYH/KUsPiMLQ26ORRJsIF66XmrA9qe298uM+RuVfZqVPwqIYUtkbZo6UPCWEz2QoJmhlf7H1SpOi2yHfsDqlxRa50xq6ggcS6Er/OMguXECcsWboJHdbiMo/qqfhTzKLMKqWBxRUzNzK8+/+Cp52KMCNrkQLZ568+77ayhzQ==
  • Cc: Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>
  • Delivery-date: Fri, 07 Oct 2022 10:33:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHY2jgm2f/PHlobT0esfUs820FvAw==
  • Thread-topic: [PATCH 17/19] xen: don't free percpu areas during suspend

From: Juergen Gross <jgross@xxxxxxxx>

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@xxxxxxxx>
Reviewed-by: Dario Faggioli <dfaggioli@xxxxxxxx>
---
 xen/arch/arm/percpu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/arm/percpu.c b/xen/arch/arm/percpu.c
index 25442c48fe..0642705544 100644
--- a/xen/arch/arm/percpu.c
+++ b/xen/arch/arm/percpu.c
@@ -58,10 +58,13 @@ static int cpu_percpu_callback(
     switch ( action )
     {
     case CPU_UP_PREPARE:
+      if ( system_state != SYS_STATE_resume )
         rc = init_percpu_area(cpu);
         break;
     case CPU_UP_CANCELED:
     case CPU_DEAD:
+    case CPU_RESUME_FAILED:
+      if ( system_state != SYS_STATE_suspend )
         free_percpu_area(cpu);
         break;
     default:
-- 
2.37.1



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.