linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Guenter Roeck <linux@roeck-us.net>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 00/19] expose page table levels on Kconfig leve
Date: Sat, 31 Jan 2015 02:11:41 +0200	[thread overview]
Message-ID: <20150131001141.GA31680@node.dhcp.inet.fi> (raw)
In-Reply-To: <20150130205958.GA1124@roeck-us.net>

On Fri, Jan 30, 2015 at 12:59:58PM -0800, Guenter Roeck wrote:
> On Fri, Jan 30, 2015 at 10:09:56PM +0200, Kirill A. Shutemov wrote:
> > On Fri, Jan 30, 2015 at 11:14:35AM -0800, Guenter Roeck wrote:
> > > On Fri, Jan 30, 2015 at 08:50:52PM +0200, Kirill A. Shutemov wrote:
> > > > On Fri, Jan 30, 2015 at 09:26:13AM -0800, Guenter Roeck wrote:
> > > > > On Fri, Jan 30, 2015 at 04:43:09PM +0200, Kirill A. Shutemov wrote:
> > > > > > I've failed my attempt on split up mm_struct into separate header file to
> > > > > > be able to use defines from <asm/pgtable.h> to define mm_struct: it causes
> > > > > > too much breakage and requires massive de-inlining of some architectures
> > > > > > (notably ARM and S390 with PGSTE).
> > > > > > 
> > > > > > This is other approach: expose number of page table levels on Kconfig
> > > > > > level and use it to get rid of nr_pmds in mm_struct.
> > > > > > 
> > > > > Hi Kirill,
> > > > > 
> > > > > Can I pull this series from somewhere ?
> > > > 
> > > > Just pushed:
> > > > 
> > > > git://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git config_pgtable_levels
> > > > 
> > > 
> > > Great. Pushed into my 'testing' branch. I'll let you know how it goes.
> > 
> > 0-DAY kernel testing has already reported few issues on blackfin, ia64 and
> > x86 with xen.
> > 
> Here is the final verdict:
> 	total: 134 pass: 114 fail: 20
> Failed builds:
> 	arc:defconfig (inherited from mainline)
> 	arc:tb10x_defconfig (inherited from mainline)
> 	arm:efm32_defconfig
> 	blackfin:defconfig
> 	c6x:dsk6455_defconfig
> 	c6x:evmc6457_defconfig
> 	c6x:evmc6678_defconfig
> 	ia64:defconfig
> 	m68k:m5272c3_defconfig
> 	m68k:m5307c3_defconfig
> 	m68k:m5249evb_defconfig
> 	m68k:m5407c3_defconfig
> 	microblaze:nommu_defconfig
> 	mips:allmodconfig (inherited from -next)
> 	powerpc:cell_defconfig (binutils 2.23)
> 	powerpc:cell_defconfig (binutils 2.24)
> 	sparc64:allmodconfig (inherited from -next)
> 	x86_64:allyesconfig
> 	x86_64:allmodconfig
> 	xtensa:allmodconfig (inherited from -next)

The patch below should fix all regressions from -next.
Please test.

diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 56313dfd9685..4f9a6661491b 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -1,7 +1,7 @@
 config PGTABLE_LEVELS
 	int "Page Table Levels" if !IA64_PAGE_SIZE_64KB
 	range 3 4 if !IA64_PAGE_SIZE_64KB
-	default 4
+	default 3
 
 source "init/Kconfig"
 
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 4c0c744fa297..91ad76f30d18 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -300,7 +300,7 @@ config ZONE_DMA32
 config PGTABLE_LEVELS
 	int
 	default 2 if !PPC64
-	default 3 if 64K_PAGES
+	default 3 if PPC_64K_PAGES
 	default 4
 
 source "init/Kconfig"
diff --git a/include/linux/mm.h b/include/linux/mm.h
index d782617c11de..a09837f3f4b7 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1454,13 +1454,15 @@ static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd,
 int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address);
 #endif
 
-#ifdef __PAGETABLE_PMD_FOLDED
+#if defined(__PAGETABLE_PMD_FOLDED) || !defined(CONFIG_MMU)
 static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud,
 						unsigned long address)
 {
 	return 0;
 }
 
+static inline void mm_nr_pmds_init(struct mm_struct *mm) {}
+
 static inline unsigned long mm_nr_pmds(struct mm_struct *mm)
 {
 	return 0;
@@ -1472,6 +1474,11 @@ static inline void mm_dec_nr_pmds(struct mm_struct *mm) {}
 #else
 int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address);
 
+static inline void mm_nr_pmds_init(struct mm_struct *mm)
+{
+	atomic_long_set(&mm->nr_pmds, 0);
+}
+
 static inline unsigned long mm_nr_pmds(struct mm_struct *mm)
 {
 	return atomic_long_read(&mm->nr_pmds);
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h
index d06b6da5c1e3..bce990f5a35d 100644
--- a/include/trace/events/xen.h
+++ b/include/trace/events/xen.h
@@ -224,7 +224,7 @@ TRACE_EVENT(xen_mmu_pmd_clear,
 	    TP_printk("pmdp %p", __entry->pmdp)
 	);
 
-#if PAGETABLE_LEVELS >= 4
+#if CONFIG_PGTABLE_LEVELS >= 4
 
 TRACE_EVENT(xen_mmu_set_pud,
 	    TP_PROTO(pud_t *pudp, pud_t pudval),
diff --git a/kernel/fork.c b/kernel/fork.c
index 76d6f292274c..56b82deb6457 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -555,9 +555,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p)
 	INIT_LIST_HEAD(&mm->mmlist);
 	mm->core_state = NULL;
 	atomic_long_set(&mm->nr_ptes, 0);
-#ifndef __PAGETABLE_PMD_FOLDED
-	atomic_long_set(&mm->nr_pmds, 0);
-#endif
+	mm_nr_pmds_init(mm);
 	mm->map_count = 0;
 	mm->locked_vm = 0;
 	mm->pinned_vm = 0;
-- 
 Kirill A. Shutemov

--
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>

  reply	other threads:[~2015-01-31  0:11 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30 14:43 [PATCH 00/19] expose page table levels on Kconfig leve Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 01/19] alpha: expose number of page table levels on Kconfig level Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 02/19] arm64: " Kirill A. Shutemov
2015-01-30 14:56   ` Catalin Marinas
2015-01-31  6:23     ` Jungseok Lee
2015-01-30 14:43 ` [PATCH 03/19] arm: " Kirill A. Shutemov
2015-01-30 16:02   ` Russell King - ARM Linux
2015-01-30 16:24     ` Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 04/19] frv: mark PUD and PMD folded Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 05/19] ia64: expose number of page table levels on Kconfig level Kirill A. Shutemov
2015-01-31  0:17   ` [PATCHv2 " Kirill A. Shutemov
2015-02-02 12:56     ` Paul Bolle
2015-02-02 13:50       ` Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 06/19] m32r: mark PMD folded Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 07/19] m68k: mark PMD folded and expose number of page table levels Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 08/19] mips: expose number of page table levels on Kconfig level Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 09/19] mn10300: mark PUD and PMD folded Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 10/19] parisc: expose number of page table levels on Kconfig level Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 11/19] powerpc: " Kirill A. Shutemov
2015-01-31  0:27   ` [PATCHv2 " Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 12/19] s390: expose number of page table levels Kirill A. Shutemov
2015-01-30 14:48   ` Martin Schwidefsky
2015-01-30 14:54     ` [PATCHv2 " Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 13/19] sh: " Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 14/19] sparc: " Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 15/19] tile: " Kirill A. Shutemov
2015-01-30 14:49   ` Chris Metcalf
2015-01-30 14:43 ` [PATCH 16/19] um: " Kirill A. Shutemov
2015-01-30 19:29   ` Richard Weinberger
2015-01-30 14:43 ` [PATCH 17/19] x86: expose number of page table levels on Kconfig level Kirill A. Shutemov
2015-01-31  0:30   ` [PATCHv2 " Kirill A. Shutemov
2015-02-02 11:26     ` Paul Bolle
2015-02-02 11:37       ` Kirill A. Shutemov
2015-02-02 11:57         ` Paul Bolle
2015-02-02 12:07           ` Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 18/19] mm: define default PGTABLE_LEVELS to two Kirill A. Shutemov
2015-01-30 14:43 ` [PATCH 19/19] mm: do not add nr_pmds into mm_struct if PMD is folded Kirill A. Shutemov
2015-01-30 17:26 ` [PATCH 00/19] expose page table levels on Kconfig leve Guenter Roeck
2015-01-30 18:50   ` Kirill A. Shutemov
2015-01-30 19:14     ` Guenter Roeck
2015-01-30 20:09       ` Kirill A. Shutemov
2015-01-30 20:41         ` Guenter Roeck
2015-01-30 20:59         ` Guenter Roeck
2015-01-31  0:11           ` Kirill A. Shutemov [this message]
2015-01-31  6:23             ` Guenter Roeck
2015-01-31  0:36 ` [PATCH] mm: do not use mm->nr_pmds on !MMU configurations Kirill A. Shutemov

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=20150131001141.GA31680@node.dhcp.inet.fi \
    --to=kirill@shutemov.name \
    --cc=akpm@linux-foundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@roeck-us.net \
    /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).