[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] tmem: add matching unlock for an about-to-be-destroyed object


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Tue, 04 Sep 2012 22:00:18 +0000
  • Delivery-date: Tue, 04 Sep 2012 22:00:33 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
# Date 1346444019 -3600
# Node ID e9416bea04c103d3da1263322ed3c00c2d9cf46f
# Parent  cba297a18e3347c2b01fc453055e1fb5e62e68f9
tmem: add matching unlock for an about-to-be-destroyed object

A 4.2 changeset forces a preempt_disable/enable with
every lock/unlock.

Tmem has dynamically allocated "objects" that contain a
lock.  The lock is held when the object is destroyed.
No reason to unlock something that's about to be destroyed!
But with the preempt_enable/disable in the generic locking code,
and the fact that do_softirq ASSERTs that preempt_count
must be zero, a crash occurs soon after any object is
destroyed.

So force lock to be released before destroying objects.

Signed-off-by: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Committed-by: Keir Fraser <keir@xxxxxxx>
---


diff -r cba297a18e33 -r e9416bea04c1 xen/common/tmem.c
--- a/xen/common/tmem.c Fri Aug 31 12:24:57 2012 +0100
+++ b/xen/common/tmem.c Fri Aug 31 21:13:39 2012 +0100
@@ -952,6 +952,7 @@ static NOINLINE void obj_free(obj_t *obj
     /* use no_rebalance only if all objects are being destroyed anyway */
     if ( !no_rebalance )
         rb_erase(&obj->rb_tree_node,&pool->obj_rb_root[oid_hash(&old_oid)]);
+    tmem_spin_unlock(&obj->obj_spinlock);
     tmem_free(obj,sizeof(obj_t),pool);
 }
 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.