From: Eric Dumazet <dada1@cosmosbay.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <clameter@sgi.com>,
Nick Piggin <nickpiggin@yahoo.com.au>,
Hugh Dickins <hugh@veritas.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
linux kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] vmallocinfo: Add NUMA informations
Date: Mon, 02 Jun 2008 08:54:14 +0200 [thread overview]
Message-ID: <48439916.2070108@cosmosbay.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4047 bytes --]
Christoph recently added /proc/vmallocinfo file to get information about
vmalloc allocations.
This patch adds NUMA specific information, giving number of pages
allocated on each memory node.
This should help to check that vmalloc() is able to respect NUMA policies.
Example of output on a four nodes machine (one cpu per node)
1) network hash tables are evenly spreaded on four nodes (OK)
(Same point for inodes and dentries hash tables)
2) iptables tables (x_tables) are correctly allocated on each cpu node (OK).
3) sys_swapon() allocates its memory from one node only.
4) each loaded module is using memory on one node.
Sysadmins could tune their setup to change points 3) and 4) if necessary.
grep "pages=" /proc/vmallocinfo
0xffffc20000000000-0xffffc20000201000 2101248
alloc_large_system_hash+0x204/0x2c0 pages=512 vmalloc N0=128 N1=128
N2=128 N3=128
0xffffc20000201000-0xffffc20000302000 1052672
alloc_large_system_hash+0x204/0x2c0 pages=256 vmalloc N0=64 N1=64 N2=64
N3=64
0xffffc2000031a000-0xffffc2000031d000 12288
alloc_large_system_hash+0x204/0x2c0 pages=2 vmalloc N1=1 N2=1
0xffffc2000031f000-0xffffc2000032b000 49152
cramfs_uncompress_init+0x2e/0x80 pages=11 vmalloc N0=3 N1=3 N2=2 N3=3
0xffffc2000033e000-0xffffc20000341000 12288 sys_swapon+0x640/0xac0
pages=2 vmalloc N0=2
0xffffc20000341000-0xffffc20000344000 12288
xt_alloc_table_info+0xfe/0x130 [x_tables] pages=2 vmalloc N0=2
0xffffc20000344000-0xffffc20000347000 12288
xt_alloc_table_info+0xfe/0x130 [x_tables] pages=2 vmalloc N1=2
0xffffc20000347000-0xffffc2000034a000 12288
xt_alloc_table_info+0xfe/0x130 [x_tables] pages=2 vmalloc N2=2
0xffffc2000034a000-0xffffc2000034d000 12288
xt_alloc_table_info+0xfe/0x130 [x_tables] pages=2 vmalloc N3=2
0xffffc20004381000-0xffffc20004402000 528384
alloc_large_system_hash+0x204/0x2c0 pages=128 vmalloc N0=32 N1=32 N2=32
N3=32
0xffffc20004402000-0xffffc20004803000 4198400
alloc_large_system_hash+0x204/0x2c0 pages=1024 vmalloc vpages N0=256
N1=256 N2=256 N3=256
0xffffc20004803000-0xffffc20004904000 1052672
alloc_large_system_hash+0x204/0x2c0 pages=256 vmalloc N0=64 N1=64 N2=64
N3=64
0xffffc20004904000-0xffffc20004bec000 3047424 sys_swapon+0x640/0xac0
pages=743 vmalloc vpages N0=743
0xffffffffa0000000-0xffffffffa000f000 61440
sys_init_module+0xc27/0x1d00 pages=14 vmalloc N1=14
0xffffffffa000f000-0xffffffffa0014000 20480
sys_init_module+0xc27/0x1d00 pages=4 vmalloc N0=4
0xffffffffa0014000-0xffffffffa0017000 12288
sys_init_module+0xc27/0x1d00 pages=2 vmalloc N0=2
0xffffffffa0017000-0xffffffffa0022000 45056
sys_init_module+0xc27/0x1d00 pages=10 vmalloc N1=10
0xffffffffa0022000-0xffffffffa0028000 24576
sys_init_module+0xc27/0x1d00 pages=5 vmalloc N3=5
0xffffffffa0028000-0xffffffffa0050000 163840
sys_init_module+0xc27/0x1d00 pages=39 vmalloc N1=39
0xffffffffa0050000-0xffffffffa0052000 8192
sys_init_module+0xc27/0x1d00 pages=1 vmalloc N1=1
0xffffffffa0052000-0xffffffffa0056000 16384
sys_init_module+0xc27/0x1d00 pages=3 vmalloc N1=3
0xffffffffa0056000-0xffffffffa0081000 176128
sys_init_module+0xc27/0x1d00 pages=42 vmalloc N3=42
0xffffffffa0081000-0xffffffffa00ae000 184320
sys_init_module+0xc27/0x1d00 pages=44 vmalloc N3=44
0xffffffffa00ae000-0xffffffffa00b1000 12288
sys_init_module+0xc27/0x1d00 pages=2 vmalloc N3=2
0xffffffffa00b1000-0xffffffffa00b9000 32768
sys_init_module+0xc27/0x1d00 pages=7 vmalloc N0=7
0xffffffffa00b9000-0xffffffffa00c4000 45056
sys_init_module+0xc27/0x1d00 pages=10 vmalloc N3=10
0xffffffffa00c6000-0xffffffffa00e0000 106496
sys_init_module+0xc27/0x1d00 pages=25 vmalloc N2=25
0xffffffffa00e0000-0xffffffffa00f1000 69632
sys_init_module+0xc27/0x1d00 pages=16 vmalloc N2=16
0xffffffffa00f1000-0xffffffffa00f4000 12288
sys_init_module+0xc27/0x1d00 pages=2 vmalloc N3=2
0xffffffffa00f4000-0xffffffffa00f7000 12288
sys_init_module+0xc27/0x1d00 pages=2 vmalloc N3=2
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
---
mm/vmalloc.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+)
[-- Attachment #2: vmallocinfo_numa.patch --]
[-- Type: text/plain, Size: 943 bytes --]
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 6e45b0f..d1e6594 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -931,6 +931,27 @@ static void s_stop(struct seq_file *m, void *p)
read_unlock(&vmlist_lock);
}
+static void show_numa_infos(struct seq_file *m, struct vm_struct *v)
+{
+ if (NUMA_BUILD) {
+ unsigned int *counters, nr;
+
+ counters = kzalloc(MAX_NUMNODES * sizeof(unsigned int),
+ GFP_KERNEL);
+ if (!counters)
+ return;
+
+ for (nr = 0; nr < v->nr_pages; nr++)
+ counters[page_to_nid(v->pages[nr])]++;
+
+ for (nr = 0; nr < MAX_NUMNODES; nr++)
+ if (counters[nr])
+ seq_printf(m, " N%u=%u", nr, counters[nr]);
+
+ kfree(counters);
+ }
+}
+
static int s_show(struct seq_file *m, void *p)
{
struct vm_struct *v = p;
@@ -967,6 +988,7 @@ static int s_show(struct seq_file *m, void *p)
if (v->flags & VM_VPAGES)
seq_printf(m, " vpages");
+ show_numa_infos(m, v);
seq_putc(m, '\n');
return 0;
}
next reply other threads:[~2008-06-02 6:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-02 6:54 Eric Dumazet [this message]
2008-06-02 7:09 ` [PATCH] vmallocinfo: Add NUMA informations KOSAKI Motohiro
2008-06-03 3:37 ` Eric Dumazet
2008-06-03 4:35 ` KOSAKI Motohiro
2008-06-09 14:14 ` Christoph Lameter
2008-06-03 21:40 ` Andrew Morton
2008-06-04 15:01 ` Eric Dumazet
2008-06-04 15:33 ` Randy Dunlap
2008-06-09 14:19 ` Christoph Lameter
2008-06-09 14:16 ` Christoph Lameter
2008-06-09 21:05 ` Andrew Morton
2008-06-09 21:12 ` Pekka Enberg
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=48439916.2070108@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=hugh@veritas.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.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