public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] irq: optimize init_kstat_irqs/init_copy_kstat_irqs
Date: Mon, 09 Feb 2009 00:44:03 -0800	[thread overview]
Message-ID: <498FECD3.9030204@kernel.org> (raw)
In-Reply-To: <20090209083739.GB15517@elte.hu>

Ingo Molnar wrote:
> * Andrew Morton <akpm@linux-foundation.org> wrote:
> 
>> On Mon, 9 Feb 2009 09:11:24 +0100 Ingo Molnar <mingo@elte.hu> wrote:
>>
>>> * Andrew Morton <akpm@linux-foundation.org> wrote:
>>>
>>>> On Sat, 7 Feb 2009 01:01:03 -0800 Yinghai Lu <yinghai@kernel.org> wrote:
>>>>
>>>>> add kzalloc_node_safe()?
>>>> I cannot find that function.
>>> His suggestion is to provide that allocator variant.
>>>
>> Oh.
>>
>> It isn't possible to write a kzalloc_node_safe(GFP_ATOMIC).  Or at
>> least, we've never worked out a way.
>>
>> Maybe I'm confused again.
> 
> Indeed - duh - more morning tea needed.
> 
> Yinghai, why are those allocations GFP_ATOMIC to begin with? These:
> 
> earth4:~/tip> grep GFP_ATOMIC kernel/irq/*.c
> kernel/irq/handle.c:	ptr = kzalloc_node(nr * sizeof(*desc->kstat_irqs), GFP_ATOMIC, node);
> kernel/irq/handle.c:	desc = kzalloc_node(sizeof(*desc), GFP_ATOMIC, node);
> kernel/irq/manage.c:	action = kmalloc(sizeof(struct irqaction), GFP_ATOMIC);
> 
> Should all be GFP_KERNEL. Wherever they are within a spinlocked section the code 
> should be restructured. All descriptor data structures should be preallocated at 
> __setup_irq() time. If we ever need to allocate dynamically later on, in the middle 
> of some difficult codepath that's a structure bug in the code.

ok.

> 
> and this one:
> 
> kernel/irq/numa_migrate.c:	desc = kzalloc_node(sizeof(*desc), GFP_ATOMIC, node);
> 
> should fail the migration silently if GFP_ATOMIC returns NULL.
it will reuse the old one.

YH

      parent reply	other threads:[~2009-02-09  8:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-06 21:50 [PATCH] irq: clear kstat_irqs Yinghai Lu
2009-02-06 22:00 ` Andrew Morton
2009-02-06 22:08   ` [PATCH] irq: clear kstat_irqs v2 Yinghai Lu
2009-02-07  7:49     ` [PATCH] irq: optimize init_kstat_irqs/init_copy_kstat_irqs Yinghai Lu
2009-02-07  8:26       ` Andrew Morton
2009-02-07  9:01         ` Yinghai Lu
2009-02-07  9:06           ` Andrew Morton
2009-02-09  8:11             ` Ingo Molnar
2009-02-09  8:19               ` Andrew Morton
2009-02-09  8:37                 ` Ingo Molnar
2009-02-09  8:43                   ` Andrew Morton
2009-02-09 11:34                     ` Ingo Molnar
2009-02-09  8:44                   ` Yinghai Lu [this message]

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=498FECD3.9030204@kernel.org \
    --to=yinghai@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox