xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "jeremy@goop.org" <jeremy@goop.org>,
	xen devel <xen-devel@lists.xensource.com>,
	MaoXiaoyun <tinnycloud@hotmail.com>
Subject: Re: [PATCH] xen mmu: fix a race window causing leave_mm BUG()
Date: Tue, 10 May 2011 16:27:02 -0400	[thread overview]
Message-ID: <20110510202701.GA18283@dumpdata.com> (raw)
In-Reply-To: <625BA99ED14B2D499DC4E29D8138F1505C843BB4B6@shsmsx502.ccr.corp.intel.com>

On Fri, Apr 29, 2011 at 12:10:57PM +0800, Tian, Kevin wrote:
>     xen mmu: fix a race window causing leave_mm BUG()

I've this in mailbox and I am wondering whether this still an issue with the 2.6.39 type kernels?
How do you reproduce the failure? When using LVM?
>     
>     there's a race window in xen_drop_mm_ref, where remote cpu may exit
>     dirty bitmap between the check on this cpu and the point where remote
>     cpu handles drop request. So in drop_other_mm_ref we need check
>     whether TLB state is still lazy before calling into leave_mm. This
>     bug is rarely observed in earlier kernel, but exaggerated by the
>     commit 831d52bc153971b70e64eccfbed2b232394f22f8 which clears bitmap
>     after changing the TLB state.
>     
>     thanks for Maxiaoyun<tinnycloud@hotmail.com> to verify it.
>     
>     Signed-off-by: Kevin Tian <kevin.tian@intel.com>
> 
> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
> index 4e5a611..74c6e4a 100644
> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -1260,7 +1260,7 @@ static void drop_other_mm_ref(void *info)
>  
>  	active_mm = percpu_read(cpu_tlbstate.active_mm);
>  
> -	if (active_mm == mm)
> +	if (active_mm == mm && percpu_read(cpu_tlbstate.state) != TLBSTATE_OK)
>  		leave_mm(smp_processor_id());
>  
>  	/* If this cpu still has a stale cr3 reference, then make sure


> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

  reply	other threads:[~2011-05-10 20:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-29  4:10 [PATCH] xen mmu: fix a race window causing leave_mm BUG() Tian, Kevin
2011-05-10 20:27 ` Konrad Rzeszutek Wilk [this message]
2011-05-11  1:20   ` Tian, Kevin
2011-05-11  9:44     ` Ian Campbell
2011-05-11 12:34       ` Tian, Kevin
2011-05-11 15:44         ` Konrad Rzeszutek Wilk

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=20110510202701.GA18283@dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=jeremy@goop.org \
    --cc=kevin.tian@intel.com \
    --cc=tinnycloud@hotmail.com \
    --cc=xen-devel@lists.xensource.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).