public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Konrad Rzeszutek Wilk <konrad@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <xen-devel@lists.xenproject.org>,
	<boris.ostrovsky@oracle.com>, <stefan.bader@canonical.com>,
	<stefano.stabellini@eu.citrix.com>, <jeremy@goop.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH 3/5] xen/smp: Update pv_lock_ops functions before alternative code starts under PVHVM
Date: Mon, 9 Sep 2013 11:31:48 +0100	[thread overview]
Message-ID: <522DA394.1020305@citrix.com> (raw)
In-Reply-To: <1378561605-18998-4-git-send-email-konrad.wilk@oracle.com>

On 07/09/13 14:46, Konrad Rzeszutek Wilk wrote:
> Before this patch we would patch all of the pv_lock_ops sites
> using alternative assembler. Then later in the bootup cycle
> change the unlock_kick and lock_spinning to the Xen specific -
> without re patching.
> 
> That meant that for the core of the kernel we would be running
> with the baremetal version of unlock_kick and lock_spinning while
> for modules we would have the proper Xen specific slowpaths.
> 
> As most of the module uses some API from the core kernel that ended
> up with slowpath lockers waiting forever to be kicked (b/c they
> would be using the Xen specific slowpath logic). And the
> kick never came b/c the unlock path that was taken was the
> baremetal one.
> 
> On PV we do not have the problem as we initialise before the
> alternative code kicks in.
> 
> The fix is to move the updating of the pv_lock_ops function
> before the alternative code starts patching.

This comment seems odd.  The xen_spinlock_init() call is added not moved.

> --- a/arch/x86/xen/smp.c
> +++ b/arch/x86/xen/smp.c
> @@ -731,4 +731,12 @@ void __init xen_hvm_smp_init(void)
>  	smp_ops.cpu_die = xen_hvm_cpu_die;
>  	smp_ops.send_call_func_ipi = xen_smp_send_call_function_ipi;
>  	smp_ops.send_call_func_single_ipi = xen_smp_send_call_function_single_ipi;
> +
> +	/*
> +	 * The alternative logic (which patches the unlock/lock) runs before
> +	 * the smp bootup up code is activated. That meant we would never patch
> +	 * the core of the kernel with proper paravirt interfaces but would patch
> +	 * modules.
> +	 */
> +	xen_init_spinlocks();

PV does this in xen_smp_prepare_boot_cpu.  It would be better if the
PVHVM case followed this same pattern and provide a smp_prepare_boot_cpu
implementation to do this?

David

  reply	other threads:[~2013-09-09 10:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-07 13:46 [PATCH] Bug-fixes to enable PV ticketlock to work under Xen PVHVM with Linux v3.12. (v1) Konrad Rzeszutek Wilk
2013-09-07 13:46 ` [PATCH 1/5] xen/spinlock: Fix locking path engaging too soon under PVHVM Konrad Rzeszutek Wilk
2013-09-09 10:31   ` David Vrabel
2013-09-09 13:06     ` Konrad Rzeszutek Wilk
2013-09-07 13:46 ` [PATCH 2/5] xen/spinlock: We don't need the old structure anymore Konrad Rzeszutek Wilk
2013-09-09 10:18   ` David Vrabel
2013-09-09 10:36   ` Ramkumar Ramachandra
2013-09-07 13:46 ` [PATCH 3/5] xen/smp: Update pv_lock_ops functions before alternative code starts under PVHVM Konrad Rzeszutek Wilk
2013-09-09 10:31   ` David Vrabel [this message]
2013-09-09 13:11     ` Konrad Rzeszutek Wilk
2013-09-07 13:46 ` [PATCH 4/5] xen/spinlock: Don't setup xen spinlock IPI kicker if disabled Konrad Rzeszutek Wilk
2013-09-09 10:34   ` David Vrabel
2013-09-09 11:07   ` Ramkumar Ramachandra
2013-09-07 13:46 ` [PATCH 5/5] Revert "xen/spinlock: Disable IRQ spinlock (PV) allocation on PVHVM" Konrad Rzeszutek Wilk
2013-09-09 10:34 ` [PATCH] Bug-fixes to enable PV ticketlock to work under Xen PVHVM with Linux v3.12. (v1) David Vrabel
2013-09-09 13:12   ` [Xen-devel] " Konrad Rzeszutek Wilk
  -- strict thread matches above, loose matches on Subject: below --
2013-09-09 15:11 [PATCH] Bug-fixes to enable PV ticketlock to work under Xen PVHVM with Linux v3.12. (v2) Konrad Rzeszutek Wilk
2013-09-09 15:11 ` [PATCH 3/5] xen/smp: Update pv_lock_ops functions before alternative code starts under PVHVM 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=522DA394.1020305@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jeremy@goop.org \
    --cc=konrad.wilk@oracle.com \
    --cc=konrad@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefan.bader@canonical.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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