From: Christian Borntraeger <borntraeger@de.ibm.com>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
David Rientjes <rientjes@google.com>,
Christian Borntraeger <borntraeger@de.ibm.com>
Subject: [PATCH v4 3/4] s390: query dynamic DEBUG_PAGEALLOC setting
Date: Wed, 3 Feb 2016 09:39:29 +0100 [thread overview]
Message-ID: <1454488775-108777-4-git-send-email-borntraeger@de.ibm.com> (raw)
In-Reply-To: <1454488775-108777-1-git-send-email-borntraeger@de.ibm.com>
We can use debug_pagealloc_enabled() to check if we can map
the identity mapping with 1MB/2GB pages as well as to print
the current setting in dump_stack.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
arch/s390/kernel/dumpstack.c | 6 +++---
arch/s390/mm/vmem.c | 10 ++++------
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/arch/s390/kernel/dumpstack.c b/arch/s390/kernel/dumpstack.c
index 02bd02f..14c1ed3 100644
--- a/arch/s390/kernel/dumpstack.c
+++ b/arch/s390/kernel/dumpstack.c
@@ -11,6 +11,7 @@
#include <linux/export.h>
#include <linux/kdebug.h>
#include <linux/ptrace.h>
+#include <linux/mm.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <asm/processor.h>
@@ -184,9 +185,8 @@ void die(struct pt_regs *regs, const char *str)
#ifdef CONFIG_SMP
printk("SMP ");
#endif
-#ifdef CONFIG_DEBUG_PAGEALLOC
- printk("DEBUG_PAGEALLOC");
-#endif
+ if (debug_pagealloc_enabled())
+ printk("DEBUG_PAGEALLOC");
printk("\n");
notify_die(DIE_OOPS, str, regs, 0, regs->int_code & 0xffff, SIGSEGV);
print_modules();
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index ef7d6c8..d27fccba 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -94,16 +94,15 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
pgd_populate(&init_mm, pg_dir, pu_dir);
}
pu_dir = pud_offset(pg_dir, address);
-#ifndef CONFIG_DEBUG_PAGEALLOC
if (MACHINE_HAS_EDAT2 && pud_none(*pu_dir) && address &&
- !(address & ~PUD_MASK) && (address + PUD_SIZE <= end)) {
+ !(address & ~PUD_MASK) && (address + PUD_SIZE <= end) &&
+ !debug_pagealloc_enabled()) {
pud_val(*pu_dir) = __pa(address) |
_REGION_ENTRY_TYPE_R3 | _REGION3_ENTRY_LARGE |
(ro ? _REGION_ENTRY_PROTECT : 0);
address += PUD_SIZE;
continue;
}
-#endif
if (pud_none(*pu_dir)) {
pm_dir = vmem_pmd_alloc();
if (!pm_dir)
@@ -111,9 +110,9 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
pud_populate(&init_mm, pu_dir, pm_dir);
}
pm_dir = pmd_offset(pu_dir, address);
-#ifndef CONFIG_DEBUG_PAGEALLOC
if (MACHINE_HAS_EDAT1 && pmd_none(*pm_dir) && address &&
- !(address & ~PMD_MASK) && (address + PMD_SIZE <= end)) {
+ !(address & ~PMD_MASK) && (address + PMD_SIZE <= end) &&
+ !debug_pagealloc_enabled()) {
pmd_val(*pm_dir) = __pa(address) |
_SEGMENT_ENTRY | _SEGMENT_ENTRY_LARGE |
_SEGMENT_ENTRY_YOUNG |
@@ -121,7 +120,6 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
address += PMD_SIZE;
continue;
}
-#endif
if (pmd_none(*pm_dir)) {
pt_dir = vmem_pte_alloc(address);
if (!pt_dir)
--
2.3.0
next prev parent reply other threads:[~2016-02-03 8:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-03 8:39 [PATCH v4 0/4 (resend)] Optimize CONFIG_DEBUG_PAGEALLOC (x86 and s390) Christian Borntraeger
2016-02-03 8:39 ` [PATCH v4 1/4] mm: provide debug_pagealloc_enabled() without CONFIG_DEBUG_PAGEALLOC Christian Borntraeger
2016-02-03 8:39 ` [PATCH v4 2/4] x86: query dynamic DEBUG_PAGEALLOC setting Christian Borntraeger
2016-02-03 22:48 ` David Rientjes
2016-02-03 8:39 ` Christian Borntraeger [this message]
2016-02-03 22:48 ` [PATCH v4 3/4] s390: " David Rientjes
2016-02-03 8:39 ` [PATCH v4 4/4] x86: also use debug_pagealloc_enabled() for free_init_pages Christian Borntraeger
2016-02-03 10:43 ` Thomas Gleixner
2016-02-03 22:50 ` David Rientjes
2016-02-03 8:39 ` [PATCH v4 0/4 (resend)] Optimize CONFIG_DEBUG_PAGEALLOC (x86 and s390) Christian Borntraeger
2016-02-03 8:39 ` [PATCH v4 1/4] mm: provide debug_pagealloc_enabled() without CONFIG_DEBUG_PAGEALLOC Christian Borntraeger
2016-02-03 8:39 ` [PATCH v4 2/4] x86: query dynamic DEBUG_PAGEALLOC setting Christian Borntraeger
2016-02-03 8:39 ` [PATCH v4 3/4] s390: " Christian Borntraeger
2016-02-03 8:39 ` [PATCH v4 4/4] x86: also use debug_pagealloc_enabled() for free_init_pages Christian Borntraeger
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=1454488775-108777-4-git-send-email-borntraeger@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=tglx@linutronix.de \
--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).