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] Update gnttab_free_callback_list locking.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Update gnttab_free_callback_list locking.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 23 Aug 2005 18:36:20 +0000
Delivery-date: Wed, 24 Aug 2005 09:07:00 +0000
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 96f1f6c710891448318a6287a10e004297fb8563
# Parent  af9e3ae3a9b1e342514305399fe5dcdfa5639385
Update gnttab_free_callback_list locking.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r af9e3ae3a9b1 -r 96f1f6c71089 
linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c     Tue Aug 23 08:45:13 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c     Tue Aug 23 09:24:46 2005
@@ -68,13 +68,11 @@
     return fh;
 }
 
-static void do_free_callbacks(void)
-{
-    struct gnttab_free_callback *callback, *next;
-    spin_lock_irq(&gnttab_free_callback_list_lock);
-    callback = gnttab_free_callback_list;
+static void do_free_callbacks(unsigned long flags)
+{
+    struct gnttab_free_callback *callback = gnttab_free_callback_list, *next;
     gnttab_free_callback_list = NULL;
-    spin_unlock_irq(&gnttab_free_callback_list_lock);
+    spin_unlock_irqrestore(&gnttab_free_callback_list_lock, flags);
     while (callback) {
        next = callback->next;
        callback->next = NULL;
@@ -88,12 +86,14 @@
     grant_ref_t ref)
 {
     grant_ref_t fh, nfh = gnttab_free_head;
+    unsigned long flags;
     do { gnttab_free_list[ref] = fh = nfh; wmb(); }
     while ( unlikely((nfh = cmpxchg(&gnttab_free_head, fh, ref)) != fh) );
-    spin_lock_irq(&gnttab_free_callback_list_lock);
+    spin_lock_irqsave(&gnttab_free_callback_list_lock, flags);
     if ( unlikely(gnttab_free_callback_list) )
-       do_free_callbacks();
-    spin_unlock_irq(&gnttab_free_callback_list_lock);
+       do_free_callbacks(flags);
+    else
+       spin_unlock_irqrestore(&gnttab_free_callback_list_lock, flags);
 }
 
 /*
@@ -276,14 +276,15 @@
 gnttab_request_free_callback(struct gnttab_free_callback *callback,
                             void (*fn)(void *), void *arg)
 {
+    unsigned long flags;
     if (callback->next)
        return;
     callback->fn = fn;
     callback->arg = arg;
-    spin_lock_irq(&gnttab_free_callback_list_lock);
+    spin_lock_irqsave(&gnttab_free_callback_list_lock, flags);
     callback->next = gnttab_free_callback_list;
     gnttab_free_callback_list = callback;
-    spin_unlock_irq(&gnttab_free_callback_list_lock);
+    spin_unlock_irqrestore(&gnttab_free_callback_list_lock, flags);
 }
 
 /*

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Update gnttab_free_callback_list locking., Xen patchbot -unstable <=