All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com
Cc: linux-kernel@vger.kernel.org, daniel.blueman@gmail.com,
	suresh.b.siddha@intel.com, <stable@kernel.org>
Subject: [patch 1/9] x86, ioapic: fix potential resume deadlock
Date: Wed, 18 May 2011 16:31:31 -0700	[thread overview]
Message-ID: <20110518233157.385970138@sbsiddha-MOBL3.sc.intel.com> (raw)
In-Reply-To: 20110518233130.524634928@sbsiddha-MOBL3.sc.intel.com

[-- Attachment #1: fix_gfp_kernel_alloc_with_irqs_disabled.patch --]
[-- Type: text/plain, Size: 1363 bytes --]

From: Daniel J Blueman <daniel.blueman@gmail.com>

Fix a potential deadlock when resuming; here the calling function
has disabled interrupts, so we cannot sleep.

Change the memory allocation flag from GFP_KERNEL to GFP_ATOMIC.

TODO: We can do away with this memory allocation during resume by
reusing the ioapic suspend/resume code that uses boot time allocated
buffers.

Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: <stable@kernel.org>     # v2.6.39
---
 arch/x86/kernel/apic/io_apic.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6-tip/arch/x86/kernel/apic/io_apic.c
===================================================================
--- linux-2.6-tip.orig/arch/x86/kernel/apic/io_apic.c
+++ linux-2.6-tip/arch/x86/kernel/apic/io_apic.c
@@ -621,14 +621,14 @@ struct IO_APIC_route_entry **alloc_ioapi
 	struct IO_APIC_route_entry **ioapic_entries;
 
 	ioapic_entries = kzalloc(sizeof(*ioapic_entries) * nr_ioapics,
-				GFP_KERNEL);
+				GFP_ATOMIC);
 	if (!ioapic_entries)
 		return 0;
 
 	for (apic = 0; apic < nr_ioapics; apic++) {
 		ioapic_entries[apic] =
 			kzalloc(sizeof(struct IO_APIC_route_entry) *
-				nr_ioapic_registers[apic], GFP_KERNEL);
+				nr_ioapic_registers[apic], GFP_ATOMIC);
 		if (!ioapic_entries[apic])
 			goto nomem;
 	}



  reply	other threads:[~2011-05-18 23:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 23:31 [patch 0/9] x86: ioapic cleanups Suresh Siddha
2011-05-18 23:31 ` Suresh Siddha [this message]
2011-05-20  4:09   ` [patch 1/9] x86, ioapic: fix potential resume deadlock Chuck Ebbert
2011-05-20 13:36   ` [tip:x86/apic] x86, ioapic: Fix " tip-bot for Daniel J Blueman
2011-05-18 23:31 ` [patch 2/9] x86, ioapic: allocate ioapic_saved_data early Suresh Siddha
2011-05-20 13:37   ` [tip:x86/apic] x86, ioapic: Allocate " tip-bot for Suresh Siddha
2011-05-18 23:31 ` [patch 3/9] x86, ioapic: use ioapic_saved_data while enabling intr-remapping Suresh Siddha
2011-05-20 13:37   ` [tip:x86/apic] x86, ioapic: Use " tip-bot for Suresh Siddha
2011-05-18 23:31 ` [patch 4/9] x86, ioapic: remove duplicate code for saving/restoring RTEs Suresh Siddha
2011-05-20 13:38   ` [tip:x86/apic] x86, ioapic: Remove " tip-bot for Suresh Siddha
2011-05-18 23:31 ` [patch 5/9] x86, ioapic: add struct ioapic Suresh Siddha
2011-05-20 13:38   ` [tip:x86/apic] x86, ioapic: Add " tip-bot for Suresh Siddha
2011-05-18 23:31 ` [patch 6/9] x86, ioapic: conslidate ioapic_saved_data[] into " Suresh Siddha
2011-05-20 13:39   ` [tip:x86/apic] x86, ioapic: Consolidate ioapic_saved_data[] into 'struct ioapic' tip-bot for Suresh Siddha
2011-05-18 23:31 ` [patch 7/9] x86, ioapic: consolidate mp_ioapics into struct ioapic Suresh Siddha
2011-05-20 13:39   ` [tip:x86/apic] x86, ioapic: Consolidate mp_ioapics[] into 'struct ioapic' tip-bot for Suresh Siddha
2011-05-18 23:31 ` [patch 8/9] x86, ioapic: consolidate gsi routing info into struct ioapic Suresh Siddha
2011-05-20 13:40   ` [tip:x86/apic] x86, ioapic: Consolidate gsi routing info into 'struct ioapic' tip-bot for Suresh Siddha
2011-05-18 23:31 ` [patch 9/9] x86, ioapic: consolidate mp_ioapic_routing[] into struct ioapic Suresh Siddha
2011-05-20 13:40   ` [tip:x86/apic] x86, ioapic: Consolidate mp_ioapic_routing[] into 'struct ioapic' tip-bot for Suresh Siddha

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=20110518233157.385970138@sbsiddha-MOBL3.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=daniel.blueman@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=stable@kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.