From: Keir Fraser <keir.xen@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>, xen-devel@lists.xen.org
Cc: Zhenzhong Duan <zhenzhong.duan@oracle.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH] [FOR 4.2] tmem: add matching unlock for an about-to-be-destroyed object
Date: Fri, 31 Aug 2012 21:08:58 +0100 [thread overview]
Message-ID: <CC66D86A.3D8B4%keir.xen@gmail.com> (raw)
In-Reply-To: <76edd759-ceca-4fb5-b411-1e598137afd8@default>
On 31/08/2012 20:58, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:
> (Guidance appreciated if the Xen patch submittal process
> has changed and I need to do more than send this email.)
This is fine, thanks!
-- Keir
> 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>
>
> diff -r 1967c7c290eb xen/common/tmem.c
> --- a/xen/common/tmem.c Wed Feb 09 12:03:09 2011 +0000
> +++ b/xen/common/tmem.c Fri Aug 31 13:49:51 2012 -0600
> @@ -957,6 +957,7 @@
> /* 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);
> }
>
next prev parent reply other threads:[~2012-08-31 20:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-31 19:58 [PATCH] [FOR 4.2] tmem: add matching unlock for an about-to-be-destroyed object Dan Magenheimer
2012-08-31 20:08 ` Keir Fraser [this message]
2012-09-05 13:24 ` Jan Beulich
2012-09-05 17:02 ` Dan Magenheimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CC66D86A.3D8B4%keir.xen@gmail.com \
--to=keir.xen@gmail.com \
--cc=dan.magenheimer@oracle.com \
--cc=konrad.wilk@oracle.com \
--cc=xen-devel@lists.xen.org \
--cc=zhenzhong.duan@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).