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-3.0.3-testing] [BLKTAP] Fix SMP debugging assert fa

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.0.3-testing] [BLKTAP] Fix SMP debugging assert failures in blktap
From: "Xen patchbot-3.0.3-testing" <patchbot-3.0.3-testing@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 02 Oct 2006 12:40:32 -0700
Delivery-date: Tue, 03 Oct 2006 01:20:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 Andrew Warfield <andy@xxxxxxxxxxxxx>
# Date 1159470181 25200
# Node ID 5f5e3b4c6fba7c56df9bc7c29236ba2ae9a9d2a1
# Parent  460f2c954cca7b28e2db89b72cc6594947e08f50
[BLKTAP] Fix SMP debugging assert failures in blktap
blktap is calling non-atomic kernel functions with irqs disabled, which
hits various kernel debug traps if those are enabled.  The problem is
req_increase(), which takes the pending_free_lock.

This function is currently only ever called from module initialiation,
where it is impossible for it to race against anything else.  Its
companion, req_decrease(), is not called at all.

Fix by removing the offending locking from req_increase() and, while
we're at it, remove req_decrease() entirely.

Signed-off-by: Stephen Tweedie <sct@xxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c |   37 -----------------------
 1 files changed, 1 insertion(+), 36 deletions(-)

diff -r 460f2c954cca -r 5f5e3b4c6fba 
linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c
--- a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c  Thu Sep 28 11:52:17 
2006 -0700
+++ b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c  Thu Sep 28 12:03:01 
2006 -0700
@@ -694,10 +694,7 @@ static int req_increase(void)
 {
        int i, j;
        struct page *page;
-       unsigned long flags;
        int ret;
-
-       spin_lock_irqsave(&pending_free_lock, flags);
 
        ret = -EINVAL;
        if (mmap_alloc >= MAX_PENDING_REQS || mmap_lock) 
@@ -763,8 +760,7 @@ static int req_increase(void)
 
        mmap_alloc++;
        DPRINTK("# MMAPs increased to %d\n",mmap_alloc);
- done:
-       spin_unlock_irqrestore(&pending_free_lock, flags);
+done:
        return ret;
 }
 
@@ -792,37 +788,6 @@ static void mmap_req_del(int mmap)
        mmap_lock = 0;
        DPRINTK("# MMAPs decreased to %d\n",mmap_alloc);
        mmap_alloc--;
-}
-
-/*N.B. Currently unused - will be accessed via sysfs*/
-static void req_decrease(void)
-{
-       pending_req_t *req;
-       int i;
-       unsigned long flags;
-
-       spin_lock_irqsave(&pending_free_lock, flags);
-
-       DPRINTK("Req decrease called.\n");
-       if (mmap_lock || mmap_alloc == 1) 
-               goto done;
-
-       mmap_lock = 1;
-       mmap_inuse = MAX_PENDING_REQS;
-       
-        /*Go through reqs and remove any that aren't in use*/
-       for (i = 0; i < MAX_PENDING_REQS ; i++) {
-               req = &pending_reqs[mmap_alloc-1][i];
-               if (req->inuse == 0) {
-                       list_del(&req->free_list);
-                       mmap_inuse--;
-               }
-       }
-       if (mmap_inuse == 0)
-               mmap_req_del(mmap_alloc-1);
- done:
-       spin_unlock_irqrestore(&pending_free_lock, flags);
-       return;
 }
 
 static pending_req_t* alloc_req(void)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.0.3-testing] [BLKTAP] Fix SMP debugging assert failures in blktap, Xen patchbot-3.0.3-testing <=