From: Ingo Molnar <mingo@kernel.org>
To: Prarit Bhargava <prarit@redhat.com>
Cc: Yinghai Lu <yinghai@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH -v2] x86: allocate cpumask during check irq vectors
Date: Sun, 26 Jan 2014 14:32:03 +0100 [thread overview]
Message-ID: <20140126133203.GA1370@gmail.com> (raw)
In-Reply-To: <52E4FE02.2020004@redhat.com>
* Prarit Bhargava <prarit@redhat.com> wrote:
> On 01/25/2014 03:02 AM, Ingo Molnar wrote:
> >
> > * Yinghai Lu <yinghai@kernel.org> wrote:
> >
> >> Fix warning:
> >> arch/x86/kernel/irq.c: In function check_irq_vectors_for_cpu_disable:
> >> arch/x86/kernel/irq.c:337:1: warning: the frame size of 2052 bytes is larger than 2048 bytes
> >>
> >> when NR_CPUS=8192
> >>
> >> We should use zalloc_cpumask_var() instead.
> >>
> >> -v2: update to GFP_ATOMIC instead and free the allocated cpumask at last.
> >>
> >> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> >> Cc: Prarit Bhargava <prarit@redhat.com>
> >>
> >> ---
> >> arch/x86/kernel/irq.c | 24 +++++++++++++++++-------
> >> 1 file changed, 17 insertions(+), 7 deletions(-)
> >>
> >> Index: linux-2.6/arch/x86/kernel/irq.c
> >> ===================================================================
> >> --- linux-2.6.orig/arch/x86/kernel/irq.c
> >> +++ linux-2.6/arch/x86/kernel/irq.c
> >> @@ -277,11 +277,18 @@ int check_irq_vectors_for_cpu_disable(vo
> >> unsigned int this_cpu, vector, this_count, count;
> >> struct irq_desc *desc;
> >> struct irq_data *data;
> >> - struct cpumask affinity_new, online_new;
> >> + cpumask_var_t affinity_new, online_new;
> >> +
> >> + if (!alloc_cpumask_var(&affinity_new, GFP_ATOMIC))
> >> + return -ENOMEM;
> >> + if (!alloc_cpumask_var(&online_new, GFP_ATOMIC)) {
> >> + free_cpumask_var(affinity_new);
> >> + return -ENOMEM;
> >> + }
> >
> > Atomic allocations can fail easily if the system is under duress.
>
> Then the hotplug attempt will fail which IMO is okay. [...]
Which is not OK at all for reliable operation, if the system has
otherwise gobs of RAM, which just don't happen to be atomic
allocatable!
> [...] With GFP_KERNEL we might hang the system.
Yes, that's a bug that should be fixed - but not via GFP_ATOMIC, which
adds insult to injury.
Thanks,
Ingo
next prev parent reply other threads:[~2014-01-26 13:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-25 0:59 [PATCH -v2] x86: allocate cpumask during check irq vectors Yinghai Lu
2014-01-25 8:02 ` Ingo Molnar
2014-01-26 12:22 ` Prarit Bhargava
2014-01-26 13:32 ` Ingo Molnar [this message]
2014-01-26 19:19 ` Prarit Bhargava
2014-01-26 20:21 ` Ingo Molnar
2014-01-26 20:23 ` H. Peter Anvin
2014-01-26 20:27 ` Ingo Molnar
2014-01-26 20:29 ` H. Peter Anvin
2014-01-26 21:46 ` Prarit Bhargava
2014-01-27 7:14 ` Ingo Molnar
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=20140126133203.GA1370@gmail.com \
--to=mingo@kernel.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=prarit@redhat.com \
--cc=tglx@linutronix.de \
--cc=yinghai@kernel.org \
/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