WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] cpupools: Fix cpupool sysctl locking.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] cpupools: Fix cpupool sysctl locking.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 06 May 2010 04:10:40 -0700
Delivery-date: Thu, 06 May 2010 04:15:21 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1273140857 -3600
# Node ID 1c9f7df0d2d6a6871059e8df0fc0571f7b35e591
# Parent  460d156da874f4c0e763681e02e9b980426a1e22
cpupools: Fix cpupool sysctl locking.

Signed-off-by: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
---
 xen/common/cpupool.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff -r 460d156da874 -r 1c9f7df0d2d6 xen/common/cpupool.c
--- a/xen/common/cpupool.c      Thu May 06 11:13:22 2010 +0100
+++ b/xen/common/cpupool.c      Thu May 06 11:14:17 2010 +0100
@@ -37,6 +37,7 @@ static cpumask_t cpupool_locked_cpus = C
  *               as it was obtained!
  */
 static DEFINE_SPINLOCK(cpupool_lock);
+static DEFINE_SPINLOCK(cpupool_ctl_lock);
 
 DEFINE_PER_CPU(struct cpupool *, cpupool);
 
@@ -401,6 +402,8 @@ int cpupool_do_sysctl(struct xen_sysctl_
     int ret;
     struct cpupool *c;
 
+    spin_lock(&cpupool_ctl_lock);
+
     switch ( op->op )
     {
 
@@ -426,9 +429,7 @@ int cpupool_do_sysctl(struct xen_sysctl_
 
     case XEN_SYSCTL_CPUPOOL_OP_DESTROY:
     {
-        spin_lock(&cpupool_lock);
         c = cpupool_find_by_id(op->cpupool_id, 1);
-        spin_unlock(&cpupool_lock);
         ret = -ENOENT;
         if ( c == NULL )
             break;
@@ -438,9 +439,7 @@ int cpupool_do_sysctl(struct xen_sysctl_
 
     case XEN_SYSCTL_CPUPOOL_OP_INFO:
     {
-        spin_lock(&cpupool_lock);
         c = cpupool_find_by_id(op->cpupool_id, 0);
-        spin_unlock(&cpupool_lock);
         ret = -ENOENT;
         if ( c == NULL )
             break;
@@ -484,9 +483,7 @@ addcpu_out:
     {
         unsigned cpu;
 
-        spin_lock(&cpupool_lock);
         c = cpupool_find_by_id(op->cpupool_id, 0);
-        spin_unlock(&cpupool_lock);
         ret = -ENOENT;
         if ( c == NULL )
             break;
@@ -560,6 +557,8 @@ addcpu_out:
 
     }
 
+    spin_unlock(&cpupool_ctl_lock);
+
     return ret;
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] cpupools: Fix cpupool sysctl locking., Xen patchbot-unstable <=