The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: David Rientjes <rientjes@google.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [PATCH] apic: use GFP_ATOMIC in lapic_resume
Date: Tue, 28 Dec 2010 15:22:02 +0800	[thread overview]
Message-ID: <1293520922.14005.616.camel@rui> (raw)
In-Reply-To: <alpine.DEB.2.00.1012272300070.24243@chino.kir.corp.google.com>

On Tue, 2010-12-28 at 15:00 +0800, David Rientjes wrote:
> On Tue, 28 Dec 2010, Zhang Rui wrote:
> 
> > Index: linux-2.6/arch/x86/kernel/apic/apic.c
> > ===================================================================
> > --- linux-2.6.orig/arch/x86/kernel/apic/apic.c
> > +++ linux-2.6/arch/x86/kernel/apic/apic.c
> > @@ -1459,7 +1459,7 @@ void __init enable_IR_x2apic(void)
> >  	if (dmar_table_init_ret && !x2apic_supported())
> >  		return;
> >  
> > -	ioapic_entries = alloc_ioapic_entries();
> > +	ioapic_entries = alloc_ioapic_entries(GFP_KERNEL);
> >  	if (!ioapic_entries) {
> >  		pr_err("Allocate ioapic_entries failed\n");
> >  		goto out;
> > @@ -2084,7 +2084,7 @@ static int lapic_resume(struct sys_devic
> >  
> >  	local_irq_save(flags);
> >  	if (intr_remapping_enabled) {
> > -		ioapic_entries = alloc_ioapic_entries();
> > +		ioapic_entries = alloc_ioapic_entries(GFP_ATOMIC);
> >  		if (!ioapic_entries) {
> >  			WARN(1, "Alloc ioapic_entries in lapic resume failed.");
> >  			ret = -ENOMEM;
> 
> You can't do the allocation before disabling irqs when 
> intr_remapping_enabled is set?

yes, we can. The first idea came into my mind is to register a pm
notifier callback to allocate/free the memory. But that one duplicates
the code of alloc_ioapic_entries, which doesn't look nice, neither.
Plus, is there any problem with this one?

thanks,
rui
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



  reply	other threads:[~2010-12-28  7:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-28  6:48 [PATCH] apic: use GFP_ATOMIC in lapic_resume Zhang Rui
2010-12-28  7:00 ` David Rientjes
2010-12-28  7:22   ` Zhang Rui [this message]
2010-12-28  7:39     ` David Rientjes
2010-12-28  7:56       ` Zhang Rui
2010-12-28  8:48         ` Zhang Rui
2010-12-28  9:57           ` Rafael J. Wysocki

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=1293520922.14005.616.camel@rui \
    --to=rui.zhang@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.com \
    --cc=rjw@sisk.pl \
    /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