public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Travis <travis@sgi.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	Rusty Russell <rusty@rustcorp.com.au>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PULL}: latest tip/cpus4096 changes
Date: Fri, 16 Jan 2009 11:55:00 -0800	[thread overview]
Message-ID: <4970E614.5040607@sgi.com> (raw)
In-Reply-To: <4970BF1C.2020201@goop.org>

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();
 

  reply	other threads:[~2009-01-16 19:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16  9:05 [PULL}: latest tip/cpus4096 changes Mike Travis
2009-01-16  9:25 ` Ingo Molnar
2009-01-16 17:53   ` Mike Travis
2009-01-16 22:30     ` Ingo Molnar
2009-01-16 23:22       ` [PATCH] x86: put trigger in to detect mismatched apic versions Mike Travis
2009-01-17  0:06         ` Mike Travis
2009-01-17  3:07         ` Jack Steiner
2009-01-18 19:08           ` Ingo Molnar
2009-01-18 21:25             ` Jack Steiner
2009-01-19 17:08               ` Mike Travis
2009-01-18 19:04         ` Ingo Molnar
2009-01-16  9:28 ` [PULL}: latest tip/cpus4096 changes Ingo Molnar
2009-01-16 17:54   ` Mike Travis
2009-01-16  9:34 ` Ingo Molnar
2009-01-16 17:08   ` Jeremy Fitzhardinge
2009-01-16 19:55     ` Mike Travis [this message]
2009-01-16 21:15       ` Jeremy Fitzhardinge
2009-01-16 17:55   ` Mike Travis
2009-01-16 14:25 ` Ingo Molnar
2009-01-16 18:03   ` Mike Travis
2009-01-16 22:32     ` 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=4970E614.5040607@sgi.com \
    --to=travis@sgi.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    /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