lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 20 Aug 2008 16:47:19 -0700
From:	"Yinghai Lu" <yhlu.kernel@...il.com>
To:	"Alex Nixon" <alex.nixon@...rix.com>
Cc:	"Ingo Molnar" <mingo@...e.hu>,
	"Jeremy Fitzhardinge" <Jeremy.Fitzhardinge@...rix.com>,
	"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] X86: Change the default value of nr_irqs from 32 to NR_IRQs

On Wed, Aug 20, 2008 at 4:23 PM, Alex Nixon <alex.nixon@...rix.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 ?

#ifdef CONFIG_XEN
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ