xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: david.vrabel@citrix.com, konrad.wilk@oracle.com, tglx@linutronix.de
Cc: xen-devel@lists.xenproject.org,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] hotplug: Prevent alloc/free of irq descriptors during cpu up/down (again)
Date: Thu, 17 Mar 2016 09:33:33 -0400	[thread overview]
Message-ID: <1458221613-21563-3-git-send-email-boris.ostrovsky__4178.0361826115$1458221840$gmane$org@oracle.com> (raw)
In-Reply-To: <1458221613-21563-1-git-send-email-boris.ostrovsky@oracle.com>

Now that Xen no longer allocates irqs in _cpu_up() we can restore
commit a89941816726 ("hotplug: Prevent alloc/free of irq descriptors
during cpu up/down")

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 arch/x86/kernel/smpboot.c |   11 -----------
 kernel/cpu.c              |    8 ++++++++
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 643dbdc..cabe21e 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1083,17 +1083,8 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
 
 	common_cpu_up(cpu, tidle);
 
-	/*
-	 * We have to walk the irq descriptors to setup the vector
-	 * space for the cpu which comes online.  Prevent irq
-	 * alloc/free across the bringup.
-	 */
-	irq_lock_sparse();
-
 	err = do_boot_cpu(apicid, cpu, tidle);
-
 	if (err) {
-		irq_unlock_sparse();
 		pr_err("do_boot_cpu failed(%d) to wakeup CPU#%u\n", err, cpu);
 		return -EIO;
 	}
@@ -1111,8 +1102,6 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
 		touch_nmi_watchdog();
 	}
 
-	irq_unlock_sparse();
-
 	return 0;
 }
 
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 6ea42e8..2ff63b3 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -342,8 +342,16 @@ static int bringup_cpu(unsigned int cpu)
 	struct task_struct *idle = idle_thread_get(cpu);
 	int ret;
 
+	/*
+	 * Some architectures have to walk the irq descriptors to
+	 * setup the vector space for the cpu which comes online.
+	 * Prevent irq alloc/free across the bringup.
+	 */
+	irq_lock_sparse();
+
 	/* Arch-specific enabling code. */
 	ret = __cpu_up(cpu, idle);
+	irq_unlock_sparse();
 	if (ret) {
 		cpu_notify(CPU_UP_CANCELED, cpu);
 		return ret;
-- 
1.7.1


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

  parent reply	other threads:[~2016-03-17 13:35 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 ` [PATCH 1/2] xen/x86: Move irq allocation from Xen smp_op.cpu_up() Boris Ostrovsky
2016-03-17 13:33 ` Boris Ostrovsky [this message]
     [not found] ` <1458221613-21563-2-git-send-email-boris.ostrovsky@oracle.com>
2016-03-25 15:10   ` Konrad Rzeszutek Wilk
2016-03-25 15:23     ` Boris Ostrovsky
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='1458221613-21563-3-git-send-email-boris.ostrovsky__4178.0361826115$1458221840$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 2/2] hotplug: Prevent alloc/free of irq descriptors during cpu up/down (again)' \
    /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).