All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Alex Nixon <alex.nixon@citrix.com>, Ingo Molnar <mingo@elte.hu>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] X86: Change the default value of nr_irqs from 32 to NR_IRQs
Date: Thu, 21 Aug 2008 16:21:57 -0700	[thread overview]
Message-ID: <48ADF895.10001@goop.org> (raw)
In-Reply-To: <86802c440808201647w70cbc286u7b02ae5da5806f49@mail.gmail.com>

Yinghai Lu wrote:
> On Wed, Aug 20, 2008 at 4:23 PM, Alex Nixon <alex.nixon@citrix.com> wrote:
>   
>> Alex Nixon wrote:
>>     
>>> Yinghai Lu wrote:
>>>       
>>>> when !CONFIG_HAVE_SPARSE_IRQ, with dyn_array, could allocate irq_desc
>>>> and etc as less as possible.
>>>> when CONFIG_HAVE_SPARESE_IRQ, no actually meaning for nr_irqs.
>>>>
>>>> YH
>>>>         
>>> So I believe the only case this affects is !CONFIG_HAVE_SPARSE_IRQ
>>>
>>> The worry is that with CONFIG_HAVE_DYN_ARRAY we may waste memory by
>>> pre-allocating more irq_descs than may be necessary (NR_IRQs vs 32)?
>>>
>>> With !CONFIG_HAVE_DYN_ARRAY however, a static array of size NR_IRQS is
>>> allocated instead - so doesn't defaulting nr_irqs back to NR_IRQS just
>>> revert to the old behaviour (with the exception of the irq_descs being
>>> allocated in pre_alloc_dyn_array instead)?
>>>
>>> - Alex
>>>
>>>       
>> Sorry to pester you Yinghai, but I'd like to get a patch for this out one
>> way or another as Xen is _completely_ unusable with 5 or more VCPUs.
>>
>> Can you explain more clearly what the problem with the patch is?
>>     
>
> small real system doesn't have MSI ioapic will have nr_irqs == 32.
> your patch will increase that to 224 again.
>
> sth like ?
>   

No.  A Xen-capable kernel can also run native, so it must do whatever a
normal kernel would do when booting native.

At what point in the boot does nr_irqs need to be set?  Could we just
override it at some point?

> #ifdef CONFIG_XEN
>   

I assume you mean ifndef here?

> int __init probe_nr_irqs(void)
> {
>         int idx;
>         int nr = 0;
>
>         for (idx = 0; idx < nr_ioapics; idx++)
>                 nr += io_apic_get_redir_entries(idx);
>
>         /* double it for hotplug and msi and nmi */
>         nr <<= 1;
>
>         /* something wrong ? */
>         if (nr < 32)
>                 nr = 32;
>
>         return nr;
> }
> #else
> int __init probe_nr_irqs(void)
> {
>        return NR_IRQS;
> }
> #endif
>   

    J

  reply	other threads:[~2008-08-21 23:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-19 16:55 [PATCH] X86: Change the default value of nr_irqs from 32 to NR_IRQs Alex Nixon
2008-08-19 17:44 ` Yinghai Lu
     [not found]   ` <0E902970173AF84089673FA54B7FE78A2CA11D@lonpexch01.citrite.net>
2008-08-19 18:24     ` Yinghai Lu
2008-08-19 18:32       ` Alex Nixon
2008-08-19 19:00         ` Yinghai Lu
2008-08-19 19:50           ` Alex Nixon
2008-08-19 20:52             ` Yinghai Lu
2008-08-19 23:19               ` Alex Nixon
2008-08-20 23:23                 ` Alex Nixon
2008-08-20 23:47                   ` Yinghai Lu
2008-08-21 23:21                     ` Jeremy Fitzhardinge [this message]
2008-08-20 23:23     ` Jeremy Fitzhardinge

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=48ADF895.10001@goop.org \
    --to=jeremy@goop.org \
    --cc=alex.nixon@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=yhlu.kernel@gmail.com \
    /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.