xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpupools: retry cpupool-destroy if domain in cpupool is dying
@ 2014-05-07  7:52 Juergen Gross
  2014-05-07 13:10 ` George Dunlap
  0 siblings, 1 reply; 21+ messages in thread
From: Juergen Gross @ 2014-05-07  7:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross

When a cpupool is destroyed just after the last domain has been stopped the
domain might already be removed from the cpupool without having decremented
the domain count of the cpupool. This will result in rejection of the
cpupool-destroy operation.
It is easy to detect this situation and to return EAGAIN in this case which
is already handled in libxc by doing a retry.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
---
 xen/common/cpupool.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 4a0e569..ac833f0 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -348,6 +348,8 @@ static int cpupool_unassign_cpu(struct cpupool *c, unsigned int cpu)
             cpupool0->n_dom++;
         }
         rcu_read_unlock(&domlist_read_lock);
+        if ( (c->n_dom > 0) && !ret )
+            ret = -EAGAIN;
         if ( ret )
             goto out;
     }
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [PATCH] cpupools: retry cpupool-destroy if domain in cpupool is dying
@ 2014-05-12 11:49 Juergen Gross
  2014-05-14  9:16 ` George Dunlap
  0 siblings, 1 reply; 21+ messages in thread
From: Juergen Gross @ 2014-05-12 11:49 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross

When a cpupool is destroyed just after the last domain has been stopped the
domain might already be removed from the domain list without being removed
from the cpupool.
It is easy to detect this situation and to return EAGAIN in this case which
is already handled in libxc by doing a retry.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
---
 xen/common/cpupool.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 4a0e569..ac833f0 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -348,6 +348,8 @@ static int cpupool_unassign_cpu(struct cpupool *c, unsigned int cpu)
             cpupool0->n_dom++;
         }
         rcu_read_unlock(&domlist_read_lock);
+        if ( (c->n_dom > 0) && !ret )
+            ret = -EAGAIN;
         if ( ret )
             goto out;
     }
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2014-05-14 13:22 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-07  7:52 [PATCH] cpupools: retry cpupool-destroy if domain in cpupool is dying Juergen Gross
2014-05-07 13:10 ` George Dunlap
2014-05-07 13:23   ` Juergen Gross
2014-05-08 15:10     ` George Dunlap
2014-05-09  5:01       ` Juergen Gross
2014-05-12 10:50         ` George Dunlap
2014-05-12 10:54           ` George Dunlap
2014-05-12 11:31           ` Juergen Gross
  -- strict thread matches above, loose matches on Subject: below --
2014-05-12 11:49 Juergen Gross
2014-05-14  9:16 ` George Dunlap
2014-05-14  9:48   ` George Dunlap
2014-05-14  9:50     ` George Dunlap
2014-05-14 12:28       ` Tim Deegan
2014-05-14  9:56   ` Juergen Gross
2014-05-14 10:15     ` Jan Beulich
2014-05-14 10:19       ` George Dunlap
2014-05-14 10:35       ` Juergen Gross
2014-05-14 12:28         ` Jan Beulich
2014-05-14 13:05           ` Juergen Gross
2014-05-14 13:13             ` Jan Beulich
2014-05-14 13:22               ` Juergen Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).