lkml.org 
[lkml]   [2009]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PULL}: latest tip/cpus4096 changes
Jeremy Fitzhardinge wrote:
> Ingo Molnar wrote:
>>> commit beec9183a43f8a42f5b790326a3b120a3b513590
>>> Author: Mike Travis <travis@sgi.com>
>>> Date: Fri Jan 16 00:22:33 2009 -0800
>>>
>>> xen: reduce static memory usage
>>>
>>
>> this one looks good in a quick check but please send it to Jeremy
>> first or get his Ack.
>>
>
> Yeah, send me a copy (I can't find it if you already have).
>
> Thanks,
> J

Hi Jeremy,

Here tis... Christophe was kind enough to test it for me. (I believe
he said you were on vacation, though he did mention that you had some
changes in the queue?)

Thanks!
Mike
---

Subject: xen: reduce static memory usage

Impact: reduce memory usage

By allocating the irq_info and irq_bindcount based
on nr_irqs instead of NR_IRQS, it will contain only
enough entries as needed by the running system.

This addresses this memory bump when NR_CPUS bumped
from 128 to 4096:

17408 132096 +114688 +658% irq_info(.bss)
17408 132096 +114688 +658% irq_bindcount(.bss)

This is only effective when CONFIG_SPARSE_IRQS=y.

Signed-off-by: Mike Travis <travis@sgi.com>
Tested-by: Christophe Saout <christophe@saout.de>
---
drivers/xen/events.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

--- linux-2.6-for-ingo.orig/drivers/xen/events.c
+++ linux-2.6-for-ingo/drivers/xen/events.c
@@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/string.h>
#include <linux/bootmem.h>
+#include <linux/irqnr.h>

#include <asm/ptrace.h>
#include <asm/irq.h>
@@ -59,7 +60,7 @@ struct packed_irq
unsigned char type;
};

-static struct packed_irq irq_info[NR_IRQS];
+static struct packed_irq *irq_info;

/* Binding types. */
enum {
@@ -87,7 +88,7 @@ static inline unsigned long *cpu_evtchn_
static u8 cpu_evtchn[NR_EVENT_CHANNELS];

/* Reference counts for bindings to IRQs. */
-static int irq_bindcount[NR_IRQS];
+static int *irq_bindcount;

/* Xen will never allocate port zero for any purpose. */
#define VALID_EVTCHN(chn) ((chn) != 0)
@@ -833,7 +834,10 @@ void __init xen_init_IRQ(void)
size_t size = nr_cpu_ids * sizeof(struct cpu_evtchn_s);

cpu_evtchn_mask_p = alloc_bootmem(size);
- BUG_ON(cpu_evtchn_mask_p == NULL);
+
+ irq_info = alloc_bootmem(nr_irqs * sizeof(struct packed_irq));
+
+ irq_bindcount = alloc_bootmem(nr_irqs * sizeof(int));

init_evtchn_cpu_bindings();


\
 
 \ /
  Last update: 2009-01-16 20:57    [W:0.114 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site