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-devel

[Xen-devel] [PATCH 1/8] 2.6.17: proper mutex use

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 1/8] 2.6.17: proper mutex use
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Wed, 14 Feb 2007 15:57:02 +0000
Delivery-date: Wed, 14 Feb 2007 07:55:34 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Mutexes are supposed to not use the old semaphore technique anymore.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: head-2007-02-08/drivers/xen/balloon/balloon.c
===================================================================
--- head-2007-02-08.orig/drivers/xen/balloon/balloon.c  2007-02-08 
17:07:13.000000000 +0100
+++ head-2007-02-08/drivers/xen/balloon/balloon.c       2007-02-08 
17:09:47.000000000 +0100
@@ -60,7 +60,7 @@
 static struct proc_dir_entry *balloon_pde;
 #endif
 
-static DECLARE_MUTEX(balloon_mutex);
+static DEFINE_MUTEX(balloon_mutex);
 
 /*
  * Protects atomic reservation decrease/increase against concurrent increases.
@@ -321,7 +321,7 @@ static void balloon_process(void *unused
        int need_sleep = 0;
        long credit;
 
-       down(&balloon_mutex);
+       mutex_lock(&balloon_mutex);
 
        do {
                credit = current_target() - bs.current_pages;
@@ -340,7 +340,7 @@ static void balloon_process(void *unused
        if (current_target() != bs.current_pages)
                mod_timer(&balloon_timer, jiffies + HZ);
 
-       up(&balloon_mutex);
+       mutex_unlock(&balloon_mutex);
 }
 
 /* Resets the Xen limit, sets new target, and kicks off processing. */



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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 1/8] 2.6.17: proper mutex use, Jan Beulich <=