From: Andrew Morton <akpm@digeo.com>
To: "David S. Miller" <davem@redhat.com>
Cc: acme@conectiva.com.br, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ipv4: only produce one record in fib_seq_show
Date: Sat, 19 Oct 2002 22:52:29 -0700 [thread overview]
Message-ID: <3DB2449D.C02B57F3@digeo.com> (raw)
In-Reply-To: 20021019.221403.116117803.davem@redhat.com
"David S. Miller" wrote:
>
> ..
> kernel/timer.c's main data structures desperately want to be per-cpu
> or allocated at boot time also. It, as has been noted often on this
> list, is actually more bloat than the ipv4 statistics stuff. :-)
I have a bunch of patches under test which do that.
The tricky bit is that at present, the per-cpu data for all 32
CPUs is always allocated. We had to change that to only allocate
the secondary CPU's memory when the CPU is coming up.
This means that:
for (i = 0; i < NR_CPUS; i++)
play_with(per_cpu(something, i));
becomes a bug. Because the per-cpu memory for not-possible
CPUs is not allocated. I created a `for_each_possible_cpu(i)'
helper macro for that.
Another issue:
/* this is basically for_each_possible_cpu() */
for (i = 0; i < NR_CPUS; i++) {
if (cpu_possible(i)) {
play_with(per_cpu(something, i));
}
}
the above code will fail if it is run before smp_init(), because
smp_init() sets up cpu_callout_map() and the per-cpu memory.
We (Dipanker and I) fixed up all the callers.
The code works OK, on ia32. But we think ia64 needs more work.
That's 128k saved. There's another 128k-odd in a huge hashtable
in kernel/pid.c (even on uniprocessor) which needs a diet. Also
80k or so in runqueues. The runqueues are set up before smp_init(),
but I expect a cpu notifier and some reorg there will work. Haven't
done sched.c yet.
I suspect we waste more memory than this in dynamically allocated
hashtables and mempools though.
next prev parent reply other threads:[~2002-10-20 5:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-19 23:32 [PATCH] ipv4: only produce one record in fib_seq_show Arnaldo Carvalho de Melo
2002-10-19 23:54 ` David S. Miller
2002-10-20 0:09 ` Arnaldo Carvalho de Melo
2002-10-20 0:38 ` David S. Miller
2002-10-20 1:03 ` Arnaldo Carvalho de Melo
2002-10-20 4:13 ` David S. Miller
2002-10-20 5:08 ` Arnaldo Carvalho de Melo
2002-10-20 5:14 ` David S. Miller
2002-10-20 5:26 ` Arnaldo Carvalho de Melo
2002-10-20 5:52 ` Andrew Morton [this message]
2002-10-20 5:15 ` David S. Miller
2002-10-20 5:30 ` Arnaldo Carvalho de Melo
2002-10-20 7:08 ` Keith Owens
[not found] <20021020010331.GB15254@conectiva.com.br.suse.lists.linux.kernel>
[not found] ` <20021019.211307.00017347.davem@redhat.com.suse.lists.linux.kernel>
[not found] ` <20021020050849.GD15254@conectiva.com.br.suse.lists.linux.kernel>
[not found] ` <20021019.221403.116117803.davem@redhat.com.suse.lists.linux.kernel>
2002-10-20 5:58 ` Andi Kleen
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=3DB2449D.C02B57F3@digeo.com \
--to=akpm@digeo.com \
--cc=acme@conectiva.com.br \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/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.