tmem: add matching unlock for an about-to-be-destroyed object
authorDan Magenheimer <dan.magenheimer@oracle.com>
Fri, 31 Aug 2012 20:13:39 +0000 (21:13 +0100)
committerDan Magenheimer <dan.magenheimer@oracle.com>
Fri, 31 Aug 2012 20:13:39 +0000 (21:13 +0100)
commitd6a43bb25d1ea2a478eda4222916e5b491894c53
tree7a10ef743de6a4c7894a4fcec1224f595f24f83b
parent50188cde05e6f0f039d3d848c3acf9b2a6e21365
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@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
xen/common/tmem.c