xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xenproject.org, tglx@linutronix.de,
	x86@kernel.org, david.vrabel@citrix.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] xen/x86: Move irq allocation from Xen smp_op.cpu_up()
Date: Fri, 25 Mar 2016 11:23:04 -0400	[thread overview]
Message-ID: <56F557D8.80108__35495.7177340568$1458919469$gmane$org@oracle.com> (raw)
In-Reply-To: <20160325151036.GD17902@char.us.oracle.com>



On 03/25/2016 11:10 AM, Konrad Rzeszutek Wilk wrote:
> On Thu, Mar 17, 2016 at 09:33:32AM -0400, Boris Ostrovsky wrote:
>> Commit ce0d3c0a6fb1 ("genirq: Revert sparse irq locking around
>> __cpu_up() and move it to x86 for now") reverted irq locking
>> introduced by commit a89941816726 ("hotplug: Prevent alloc/free
>> of irq descriptors during cpu up/down") because of Xen allocating
>> irqs in both of its cpu_up ops.
>>
>> We can move those allocations into CPU notifiers so that original
>> patch can be reinstated.
> Original being "hotplug: Prevent alloc/free..." ?

Yes.

>
> -static int xen_hvm_cpu_notify(struct notifier_block *self, unsigned long action,
> -			      void *hcpu)
> +static int xen_cpu_notify(struct notifier_block *self, unsigned long action,
> +			  void *hcpu)
>   {
>   	int cpu = (long)hcpu;
> +	int rc;
> +
>   	switch (action) {
>   	case CPU_UP_PREPARE:
> -		xen_vcpu_setup(cpu);
> -		if (xen_have_vector_callback) {
> -			if (xen_feature(XENFEAT_hvm_safe_pvclock))
> -				xen_setup_timer(cpu);
> +		if (xen_hvm_domain()) {
> +			/*
> +			 * This can happen if CPU was offlined earlier and
> +			 * offlining timed out in common_cpu_die().
> +			 */
> +			if (cpu_report_state(cpu) == CPU_DEAD_FROZEN) {
> +				xen_smp_intr_free(cpu);
> +				xen_uninit_lock_cpu(cpu);
> +			}
> +
> +			xen_vcpu_setup(cpu);
>   		}
> +
> +		if (xen_pv_domain() ||
> +		    (xen_have_vector_callback &&
> +		     xen_feature(XENFEAT_hvm_safe_pvclock)))
> +			xen_setup_timer(cpu);
> +
> +		rc = xen_smp_intr_init(cpu);
> +		if (rc) {
> +			WARN(1, "xen_smp_intr_init() for CPU %d failed: %d\n",
> +			     cpu, rc);
> +			return NOTIFY_BAD;
> +		}
> +
> +		break;
> +	case CPU_ONLINE:
> +		xen_init_lock_cpu(cpu);
> +		break;
> +	case CPU_UP_CANCELED:
> +		xen_smp_intr_free(cpu);
> xen_uninit_lock_cpu ?

I don't think this is needed: we initialize lock in CPU_ONLINE notifier 
which can only be called after CPU_UP_CANCELED would have run (in which 
case we'll never do CPU_ONLINE)

-boris

>
>
>> +		if (xen_pv_domain() ||
>> +		    (xen_have_vector_callback &&
>> +		     xen_feature(XENFEAT_hvm_safe_pvclock)))
>> +			xen_teardown_timer(cpu);
>>   		break;
>>   	default:
>>   		break;


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-03-25 15:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1458221613-21563-1-git-send-email-boris.ostrovsky@oracle.com>
2016-03-17 13:33 ` Boris Ostrovsky
2016-03-17 13:33 ` [PATCH 2/2] hotplug: Prevent alloc/free of irq descriptors during cpu up/down (again) Boris Ostrovsky
     [not found] ` <1458221613-21563-2-git-send-email-boris.ostrovsky@oracle.com>
2016-03-25 15:10   ` [PATCH 1/2] xen/x86: Move irq allocation from Xen smp_op.cpu_up() Konrad Rzeszutek Wilk
2016-03-25 15:23     ` Boris Ostrovsky [this message]
2016-04-22 14:35 ` [PATCH 0/2] Reinstate irq alloc/dealloc locking patch Boris Ostrovsky

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='56F557D8.80108__35495.7177340568$1458919469$gmane$org@oracle.com' \
    --to=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --subject='Re: [PATCH 1/2] xen/x86: Move irq allocation from Xen smp_op.cpu_up()' \
    /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

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).