From: "C.Wehrmeyer" <c.wehrmeyer@gmx.de>
To: Michal Hocko <mhocko@kernel.org>, Mike Kravetz <mike.kravetz@oracle.com>
Cc: linux-mm@kvack.org, linux-kernel <linux-kernel@vger.kernel.org>,
Andrea Arcangeli <aarcange@redhat.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Vlastimil Babka <vbabka@suse.cz>
Subject: Re: PROBLEM: Remapping hugepages mappings causes kernel to return EINVAL
Date: Mon, 23 Oct 2017 14:22:30 +0200 [thread overview]
Message-ID: <e2cc07b7-3c5e-a166-0bb2-eff92fc70cd1@gmx.de> (raw)
In-Reply-To: <20171023114210.j7ip75ewoy2tiqs4@dhcp22.suse.cz>
On 2017-10-23 13:42, Michal Hocko wrote:
> I do not remember any such a request either. I can see some merit in the
> described use case. It is not specific on why hugetlb pages are used for
> the allocator memory because that comes with it own issues.
That is yet for the user to specify. As of now hugepages still require a
special setup that not all people might have as of now - to my knowledge
a kernel being compiled with CONFIG_TRANSPARENT_HUGEPAGE=y and a number
of such pages being allocated either through the kernel boot line or
through /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages. I'm
deliberately ignoring 1-GiB pages here because those are only
allocatable during boot, when no processes have been spawned and memory
is still not fragmented.
My point is that I can see people not being too eager to support 1 GiB
pages as of now unless for very specific use case. 2-MiB pages, on the
other hand, shouldn't have those limitations anymore. User-space
programs should be capable of allocating such pages without the need for
the user to fiddle with nr_hugepages beforehand.
Some time ago I've written some code to detect TLB capabilities on my
current testing CPU, those are the results:
[TLB] Instruction TLB: 2M/4M pages, fully associative, 8 entries
[TLB] Data TLB: 4 KByte pages, 4-way set associative, 64 entries
[TLB] Data TLB: 2 MByte or 4 MByte pages, 4-way set associative, 32
entries and a separate array with 1 GByte pages, 4-way set associative,
4 entries
[TLB] Instruction TLB: 4KByte pages, 8-way set associative, 64 entries
[STLB] Shared 2nd-Level TLB: 4 KByte/2MByte pages, 8-way associative,
1024 entries
With the knowledge that allocations in the Mebibyte range aren't
uncommon at all nowadays and that one 2-MiB page eliminates the need for
512 4-KiB pages, we really should make advances towards treating 2-MiB
pages just as casual as older pages. Allocators can still query if the
kernel supports the specified page size, and specifying MAP_HUGETLB |
MAP_HUGE_2MB would still be required in order to not break older
programs, but from my perspective there is a lot to gain here.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-10-23 12:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <93684e4b-9e60-ef3a-ba62-5719fdf7cff9@gmx.de>
2017-10-19 7:34 ` C.Wehrmeyer
2017-10-20 22:42 ` Mike Kravetz
2017-10-23 11:42 ` Michal Hocko
2017-10-23 12:22 ` C.Wehrmeyer [this message]
2017-10-23 12:41 ` Michal Hocko
2017-10-23 14:00 ` C.Wehrmeyer
2017-10-23 16:13 ` Michal Hocko
2017-10-23 16:46 ` C.Wehrmeyer
2017-10-23 16:57 ` Michal Hocko
2017-10-23 17:52 ` C.Wehrmeyer
2017-10-23 18:02 ` Michal Hocko
2017-10-24 7:41 ` C.Wehrmeyer
2017-10-24 8:12 ` Michal Hocko
2017-10-24 8:32 ` C.Wehrmeyer
2017-10-27 14:29 ` Vlastimil Babka
2017-10-27 17:06 ` Mike Kravetz
2017-10-27 17:31 ` Kirill A. Shutemov
2017-10-23 18:51 ` Mike Kravetz
2017-10-24 8:09 ` C.Wehrmeyer
2017-10-07 1:58 C.Wehrmeyer
2017-10-09 16:47 ` Mike Kravetz
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=e2cc07b7-3c5e-a166-0bb2-eff92fc70cd1@gmx.de \
--to=c.wehrmeyer@gmx.de \
--cc=aarcange@redhat.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mike.kravetz@oracle.com \
--cc=vbabka@suse.cz \
/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