public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 11/14] ACPI: change GFP_ATOMIC to GFP_KERNEL for non-atomic  allocation
@ 2006-08-15  5:37 akpm
  2006-08-16 23:02 ` Len Brown
  0 siblings, 1 reply; 13+ messages in thread
From: akpm @ 2006-08-15  5:37 UTC (permalink / raw)
  To: len.brown; +Cc: linux-acpi, akpm, jikos

From: Jiri Kosina <jikos@jikos.cz>

acpi_pci_link_set() allocates with GFP_ATOMIC. On resume from suspend,
this is called with interrupts off, otherwise GFP_KERNEL is safe.

On the other hand, when resuming from suspend with interrupts off, the
following callchain allocates with GFP_KERNEL, which is wrong:

acpi_pci_link_resume -> acpi_pci_link_set -> acpi_set_current_resources ->
acpi_rs_set_srs_method_data -> acpi_ut_create_internal_object_dbg ->
acpi_ut_allocate_object_desc_dbg -> acpi_os_acquire_object ->
kmem_cache_alloc(GFP_KERNEL) flag.

Signed-off-by: Jiri Kosina <jikos@jikos.cz>
Cc: "Brown, Len" <len.brown@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/acpi/pci_link.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff -puN drivers/acpi/pci_link.c~acpi-change-gfp_atomic-to-gfp_kernel-for-non-atomic drivers/acpi/pci_link.c
--- a/drivers/acpi/pci_link.c~acpi-change-gfp_atomic-to-gfp_kernel-for-non-atomic
+++ a/drivers/acpi/pci_link.c
@@ -307,7 +307,12 @@ static int acpi_pci_link_set(struct acpi
 	if (!link || !irq)
 		return -EINVAL;
 
-	resource = kmalloc(sizeof(*resource) + 1, GFP_ATOMIC);
+	/* irqs could be disabled when resuming from suspend */
+	if (irqs_disabled())
+		resource = kmalloc(sizeof(*resource) + 1, GFP_ATOMIC);
+	else
+		resource = kmalloc(sizeof(*resource) + 1, GFP_KERNEL);
+
 	if (!resource)
 		return -ENOMEM;
 
_

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: [patch 11/14] ACPI: change GFP_ATOMIC to GFP_KERNEL for non-atomic allocation
@ 2006-08-25 14:48 Pallipadi, Venkatesh
  0 siblings, 0 replies; 13+ messages in thread
From: Pallipadi, Venkatesh @ 2006-08-25 14:48 UTC (permalink / raw)
  To: Jiri Kosina, Len Brown; +Cc: linux-acpi

 

>-----Original Message-----
>From: Jiri Kosina [mailto:jikos@jikos.cz] 
>Sent: Friday, August 25, 2006 7:27 AM
>To: Len Brown; Pallipadi, Venkatesh
>Cc: linux-acpi@vger.kernel.org
>Subject: Re: [patch 11/14] ACPI: change GFP_ATOMIC to 
>GFP_KERNEL for non-atomic allocation
>
>On Fri, 25 Aug 2006, Jiri Kosina wrote:
>
>> > to address this on boot, Linux uses system-state. I 
>suggested doing the
>> > same for resume, but Andrew didn't like it, so here we are 
>chasing a
>> > bunch of spurious warning messages. Got any random 
>examples that are
>> > still valid in greg's tree, my tree, or the latest mm?
>> Actually I just pulled from the acpi git tree, and with this 
>kernel my IBM 
>> T42p hangs approximately 10s after the kernel is started 
>(hard lockup, no 
>> caps/numlock). Will investigate.
>
>Bisection shows that it is caused by commit 
>f62d31ee2f2f453b07107465fea54540cab418eb ACPI: Support 
>Processor Native 
>C-state using Intel "mwait" instruction. 
>
>I guess that the detection whether current CPU supports mwait 
>insn does 
>not work, but I am not too familiar with this.
>
>cpuinfo:
>
>processor	: 0
>vendor_id	: GenuineIntel
>cpu family	: 6
>model		: 13
>model name	: Intel(R) Pentium(R) M processor 1.80GHz
>stepping	: 6
>cpu MHz		: 1800.000
>cache size	: 2048 KB
>fdiv_bug	: no
>hlt_bug		: no
>f00f_bug	: no
>coma_bug	: no
>fpu		: yes
>fpu_exception	: yes
>cpuid level	: 2
>wp		: yes
>flags		: fpu vme de pse tsc msr mce cx8 sep mtrr pge 
>mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe est tm2
>bogomips	: 3590.77
>
>-- 
>JiKos.

Interesting. Let me try to reproduce the problem on a similar system
locally and look at what is happening. I should have more update by the
end of the day.

Thanks,
Venki

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: [patch 11/14] ACPI: change GFP_ATOMIC to GFP_KERNEL for non-atomic allocation
@ 2006-08-26  1:39 Pallipadi, Venkatesh
  2006-08-26 15:39 ` Jiri Kosina
  0 siblings, 1 reply; 13+ messages in thread
From: Pallipadi, Venkatesh @ 2006-08-26  1:39 UTC (permalink / raw)
  To: Jiri Kosina, Len Brown; +Cc: linux-acpi


>-----Original Message-----
>From: Jiri Kosina [mailto:jikos@jikos.cz] 
>Sent: Friday, August 25, 2006 7:27 AM
>To: Len Brown; Pallipadi, Venkatesh
>Cc: linux-acpi@vger.kernel.org
>Subject: Re: [patch 11/14] ACPI: change GFP_ATOMIC to 
>GFP_KERNEL for non-atomic allocation
>
>On Fri, 25 Aug 2006, Jiri Kosina wrote:
>
>> > to address this on boot, Linux uses system-state. I 
>suggested doing the
>> > same for resume, but Andrew didn't like it, so here we are 
>chasing a
>> > bunch of spurious warning messages. Got any random 
>examples that are
>> > still valid in greg's tree, my tree, or the latest mm?
>> Actually I just pulled from the acpi git tree, and with this 
>kernel my IBM 
>> T42p hangs approximately 10s after the kernel is started 
>(hard lockup, no 
>> caps/numlock). Will investigate.
>
>Bisection shows that it is caused by commit 
>f62d31ee2f2f453b07107465fea54540cab418eb ACPI: Support 
>Processor Native 
>C-state using Intel "mwait" instruction. 
>
>I guess that the detection whether current CPU supports mwait 
>insn does 
>not work, but I am not too familiar with this.
>
>cpuinfo:
>
>processor	: 0
>vendor_id	: GenuineIntel
>cpu family	: 6
>model		: 13
>model name	: Intel(R) Pentium(R) M processor 1.80GHz
>stepping	: 6
>cpu MHz		: 1800.000
>cache size	: 2048 KB
>fdiv_bug	: no
>hlt_bug		: no
>f00f_bug	: no
>coma_bug	: no
>fpu		: yes
>fpu_exception	: yes
>cpuid level	: 2
>wp		: yes
>flags		: fpu vme de pse tsc msr mce cx8 sep mtrr pge 
>mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe est tm2
>bogomips	: 3590.77
>

I don't seem to be able to reproduce this on my T40 laptop. 

Can you please send me the following:
1) Output of acpidump (from latest pmtools here:
http://www.kernel.org/pub/linux/kernel/people/lenb/acpi/utils/ )
2) dmesg and cat /proc/acpi/processor/*/* output without this patch.

Thanks,
Venki

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: [patch 11/14] ACPI: change GFP_ATOMIC to GFP_KERNEL for non-atomic allocation
@ 2006-08-29  2:01 Pallipadi, Venkatesh
  2006-08-30 10:28 ` Jiri Kosina
  0 siblings, 1 reply; 13+ messages in thread
From: Pallipadi, Venkatesh @ 2006-08-29  2:01 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Len Brown, linux-acpi

 

>-----Original Message-----
>From: Jiri Kosina [mailto:jikos@jikos.cz] 
>Sent: Saturday, August 26, 2006 8:39 AM
>To: Pallipadi, Venkatesh
>Cc: Len Brown; linux-acpi@vger.kernel.org
>Subject: RE: [patch 11/14] ACPI: change GFP_ATOMIC to 
>GFP_KERNEL for non-atomic allocation
>
>On Fri, 25 Aug 2006, Pallipadi, Venkatesh wrote:
>
>> I don't seem to be able to reproduce this on my T40 laptop. Can you
>> please send me the following: 1) Output of acpidump (from 
>latest pmtools
>> here: 
>http://www.kernel.org/pub/linux/kernel/people/lenb/acpi/utils/ )
>> 2) dmesg and cat /proc/acpi/processor/*/* output without this patch.
>
>http://www.jikos.cz/jikos/junk/ACPIDUMP
>http://www.jikos.cz/jikos/junk/DMESG
>http://www.jikos.cz/jikos/junk/PROC_ACPI
>
>These are from stock 2.6.18-rc4 kernel. 
>

Thanks Jiri for identifying the problem with this patch and reporting
it. I was able to reproduce it on a system locally and I have tracked
down the problem. I will send out the updated patch soon and cc it to
you. 

Thanks,
Venki

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-08-30 22:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-15  5:37 [patch 11/14] ACPI: change GFP_ATOMIC to GFP_KERNEL for non-atomic allocation akpm
2006-08-16 23:02 ` Len Brown
2006-08-17  9:15   ` Jiri Kosina
2006-08-24  6:43     ` Len Brown
2006-08-25  9:00       ` Jiri Kosina
2006-08-25 14:27         ` Jiri Kosina
  -- strict thread matches above, loose matches on Subject: below --
2006-08-25 14:48 Pallipadi, Venkatesh
2006-08-26  1:39 Pallipadi, Venkatesh
2006-08-26 15:39 ` Jiri Kosina
2006-08-29  2:01 Pallipadi, Venkatesh
2006-08-30 10:28 ` Jiri Kosina
2006-08-30 18:01   ` Venkatesh Pallipadi
2006-08-30 22:28     ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox