From: Tejun Heo <tj@kernel.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ben Greear <greearb@candelatech.com>,
NetDev <netdev@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: OOM when adding ipv6 route: How to make available more per-cpu memory?
Date: Sat, 06 Nov 2010 10:11:44 +0100 [thread overview]
Message-ID: <4CD51BD0.8040609@kernel.org> (raw)
In-Reply-To: <1288995103.2665.653.camel@edumazet-laptop>
Hello,
On 11/05/2010 11:11 PM, Eric Dumazet wrote:
> Le vendredi 05 novembre 2010 à 21:20 +0100, Eric Dumazet a écrit :
>> Your vmalloc space is very fragmented. pcpu_get_vm_areas() want
>> hugepages (4MB on your machine, 2MB on mine because I have
>> CONFIG_HIGHMEM64G=y)
>
> Well, this is wrong. We use normal (4KB) pages, unfortunately.
>
> I have a NUMA machine, with two nodes, so pcpu_get_vm_areas() allocates
> two zones, one for each node, with a 'known' offset between them.
> Then, 4KB pages are allocated to populate the zone when needed.
>
> # grep pcpu_get_vm_areas /proc/vmallocinfo
> 0xffffe8ffa0400000-0xffffe8ffa0600000 2097152 pcpu_get_vm_areas+0x0/0x740 vmalloc
> 0xffffe8ffffc00000-0xffffe8ffffe00000 2097152 pcpu_get_vm_areas+0x0/0x740 vmalloc
>
> BTW, we dont have the number of pages currently allocated in each
> 'vmalloc' zone, and/or node information.
>
> Tejun, do you have plans to use hugepages eventually ?
> (and fallback to 4KB pages, but most percpu data are allocated right
> after boot)
Well, it's rather complicated. Till now, the percpu usage hasn't
justified allocating hugepages but it might someday, but more
importantly the reason why those big chunks of address space are used
is to keep the first chunk embedded in the regular linear kernel
address space to avoid extra TLB pressure.
On configurations where vmalloc area is a scarce resource,
percpu_alloc=page can be specified to use page-mapped allocation.
This will use much smaller chunks in vmalloc area at the cost of
additional 4k page TLB pressure for percpu memory in the first chunk
(all the static percpu variables and then some).
pcpu_embed_first_chunk() contains heuristic which makes it yield to
page allocator but the parameter is pretty generous (maximum distance
between chunks > 75% of vmalloc area). It's there just to avoid
completely crazy cases. Also, x86 setup_per_cpu_areas() chooses page
allocator on 32bit NUMAs. This case didn't trigger either. We
probably need to add another condition.
That large machine on 32bit is bound to be flaky. To be short on
virtual address space is a pretty silly and stupid thing. Anyways,
any good idea on what criteria we could test?
Thanks.
--
tejun
prev parent reply other threads:[~2010-11-06 9:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-05 17:19 OOM when adding ipv6 route: How to make available more per-cpu memory? Ben Greear
2010-11-05 18:06 ` Eric Dumazet
2010-11-05 18:15 ` Ben Greear
2010-11-05 20:20 ` Eric Dumazet
2010-11-05 20:26 ` Ben Greear
2010-11-05 20:53 ` Eric Dumazet
2010-11-05 22:11 ` Eric Dumazet
2010-11-06 0:07 ` Ben Greear
2010-11-06 7:26 ` Eric Dumazet
2010-11-06 17:08 ` Ben Greear
2010-11-08 11:02 ` Eric Dumazet
2010-11-08 17:45 ` Ben Greear
2010-11-08 17:55 ` Eric Dumazet
2010-11-08 18:08 ` Ben Greear
2010-11-08 21:27 ` Ben Greear
2010-11-08 21:40 ` Eric Dumazet
2010-11-06 9:11 ` Tejun Heo [this message]
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=4CD51BD0.8040609@kernel.org \
--to=tj@kernel.org \
--cc=eric.dumazet@gmail.com \
--cc=greearb@candelatech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).