From: Vlastimil Babka <vbabka@suse.cz>
To: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Vegard Nossum <vegardno@ifi.uio.no>,
Pekka Enberg <penberg@kernel.org>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Vlastimil Babka <vbabka@suse.cz>
Subject: [PATCH] x86, mm: disable 1GB direct mapping when disabling 2MB mapping
Date: Fri, 9 Jun 2017 15:57:43 +0200 [thread overview]
Message-ID: <20170609135743.9920-1-vbabka@suse.cz> (raw)
The kmemleak and debug_pagealloc features both disable using huge pages for
direct mapping so they can do cpa() on page level granularity in any context.
However they only do that for 2MB pages, which means 1GB pages can still be
used if the CPU supports it, unless disabled by a boot param, which is
non-obvious. Disable also 1GB pages when disabling 2MB pages.
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
arch/x86/mm/init.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index cbc87ea98751..20282dfce0fa 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -170,6 +170,10 @@ static void __init probe_page_size_mask(void)
*/
if (boot_cpu_has(X86_FEATURE_PSE) && !debug_pagealloc_enabled())
page_size_mask |= 1 << PG_LEVEL_2M;
+ else
+ direct_gbpages = 0;
+#else
+ direct_gbpages = 0;
#endif
/* Enable PSE if available */
--
2.13.1
--
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 reply other threads:[~2017-06-09 13:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-09 13:57 Vlastimil Babka [this message]
2017-06-11 7:57 ` [PATCH] x86, mm: disable 1GB direct mapping when disabling 2MB mapping Ingo Molnar
2017-06-12 7:21 ` Vlastimil Babka
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=20170609135743.9920-1-vbabka@suse.cz \
--to=vbabka@suse.cz \
--cc=borntraeger@de.ibm.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=penberg@kernel.org \
--cc=tglx@linutronix.de \
--cc=vegardno@ifi.uio.no \
--cc=x86@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).