public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Alex Nixon <alex.nixon@citrix.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] Xen: Fix pte unpin BUG when !CONFIG_SMP
Date: Tue, 09 Sep 2008 11:05:52 -0700	[thread overview]
Message-ID: <48C6BB00.9040607@goop.org> (raw)
In-Reply-To: <1220959508-13806-1-git-send-email-alex.nixon@citrix.com>

Alex Nixon wrote:
> We still need to pin PTEs, even if there are no PTE locks.  Otherwise we'll BUG whenever there aren't PTE locks (i.e. whenever NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS), as we try to unpin PTEs which were never pinned in the first place.
>   

Where does the unpin happen?  xen_unpin_page() also checks to see if it
took the lock before trying to unpin, symmetric with xen_pin_page().

    J
> Signed-off-by: Alex Nixon <alex.nixon@citrix.com>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> Cc: Ingo Molnar <mingo@elte.hu>
> ---
>  arch/x86/xen/mmu.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
> index f5af913..1239bda 100644
> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -819,9 +819,10 @@ static int xen_pin_page(struct page *page, enum pt_level level)
>  					pfn_pte(pfn, PAGE_KERNEL_RO),
>  					level == PT_PGD ? UVMF_TLB_FLUSH : 0);
>  
> -		if (ptl) {
> +		if (level == PT_PTE)
>  			xen_do_pin(MMUEXT_PIN_L1_TABLE, pfn);
>  
> +		if (ptl) {
>  			/* Queue a deferred unlock for when this batch
>  			   is completed. */
>  			xen_mc_callback(xen_pte_unlock, ptl);
> @@ -924,9 +925,7 @@ static int xen_unpin_page(struct page *page, enum pt_level level)
>  		 */
>  		if (level == PT_PTE) {
>  			ptl = xen_pte_lock(page);
> -
> -			if (ptl)
> -				xen_do_pin(MMUEXT_UNPIN_TABLE, pfn);
> +			xen_do_pin(MMUEXT_UNPIN_TABLE, pfn);
>  		}
>  
>  		mcs = __xen_mc_entry(0);
>   


  parent reply	other threads:[~2008-09-09 18:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-09 11:25 [PATCH] Xen: Fix pte unpin BUG when !CONFIG_SMP Alex Nixon
2008-09-09 11:27 ` Ingo Molnar
2008-09-09 18:05 ` Jeremy Fitzhardinge [this message]
2008-09-09 19:21   ` Alex Nixon
2008-09-09 20:37     ` Jeremy Fitzhardinge
2008-09-09 22:26       ` Alex Nixon
2008-09-09 22:28         ` Jeremy Fitzhardinge
2008-09-09 22:43         ` [PATCH 1/2] mm: define USE_SPLIT_PTLOCKS rather than repeating expression Jeremy Fitzhardinge
2008-09-10 11:28           ` Hugh Dickins
2008-09-09 22:43         ` [PATCH 2/2] xen: fix pinning when not using split pte locks Jeremy Fitzhardinge
2008-09-09 22:53           ` Andrew Morton
2008-09-09 23:29             ` Jeremy Fitzhardinge
2008-09-10  8:18               ` Ingo Molnar
2008-09-09 23:22           ` Alex Nixon
2008-09-09 23:32             ` Jeremy Fitzhardinge
2008-09-10  8:10             ` Ingo Molnar

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=48C6BB00.9040607@goop.org \
    --to=jeremy@goop.org \
    --cc=alex.nixon@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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