incoming
Subsystems (10)
Andrew Morton
maintainerA straggler. This patch caused a lot of build errors on a lot of architectures for a long time, but Anshuman believes it's all fixed up now.
1 patch, based on GIT b032227c62939b5481bcd45442b36dfa263f4a7c.
Anshuman Khandual <[email protected]>:
mm/debug: add tests validating architecture page table helpers
Documentation/features/debug/debug-vm-pgtable/arch-support.txt | 34 arch/arc/Kconfig | 1 arch/arm64/Kconfig | 1 arch/powerpc/Kconfig | 1 arch/s390/Kconfig | 1 arch/x86/Kconfig | 1 arch/x86/include/asm/pgtable_64.h | 6 include/linux/mmdebug.h | 5 init/main.c | 2 lib/Kconfig.debug | 26 mm/Makefile | 1 mm/debug_vm_pgtable.c | 392 ++++++++++ 12 files changed, 471 insertions(+)
Andrew Morton
maintainerPATCH 1/1 mm/debug: add tests validating architecture page table helpers
From: Anshuman Khandual <[email protected]>
Subject: mm/debug: add tests validating architecture page table helpers
This adds tests which will validate architecture page table helpers and other accessors in their compliance with expected generic MM semantics. This will help various architectures in validating changes to existing page table helpers or addition of new ones.
This test covers basic page table entry transformations including but not limited to old, young, dirty, clean, write, write protect etc at various level along with populating intermediate entries with next page table page and validating them.
Test page table pages are allocated from system memory with required size and alignments. The mapped pfns at page table levels are derived from a real pfn representing a valid kernel text symbol. This test gets called inside kernel_init() right after async_synchronize_full().
This test gets built and run when CONFIG_DEBUG_VM_PGTABLE is selected. Any architecture, which is willing to subscribe this test will need to select ARCH_HAS_DEBUG_VM_PGTABLE. For now this is limited to arc, arm64, x86, s390 and powerpc platforms where the test is known to build and run successfully Going forward, other architectures too can subscribe the test after fixing any build or runtime problems with their page table helpers. Meanwhile for better platform coverage, the test can also be enabled with CONFIG_EXPERT even without ARCH_HAS_DEBUG_VM_PGTABLE.
Folks interested in making sure that a given platform's page table helpers conform to expected generic MM semantics should enable the above config which will just trigger this test during boot. Any non conformity here will be reported as an warning which would need to be fixed. This test will help catch any changes to the agreed upon semantics expected from generic MM and enable platforms to accommodate it thereafter.
---
Documentation/features/debug/debug-vm-pgtable/arch-support.txt | 34 arch/arc/Kconfig | 1 arch/arm64/Kconfig | 1 arch/powerpc/Kconfig | 1 arch/s390/Kconfig | 1 arch/x86/Kconfig | 1 arch/x86/include/asm/pgtable_64.h | 6 include/linux/mmdebug.h | 5 init/main.c | 2 lib/Kconfig.debug | 26 mm/Makefile | 1 mm/debug_vm_pgtable.c | 392 ++++++++++ 12 files changed, 471 insertions(+)
arch/arc/Kconfig renamed from arch/arc/Kconfig~mm-debug-add-tests-validating-architecture-page-table-helpers +1 -0
@@ -6,6 +6,7 @@ config ARC def_bool y select ARC_TIMERS + select ARCH_HAS_DEBUG_VM_PGTABLE select ARCH_HAS_DMA_PREP_COHERENT select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_SETUP_DMA_OPS
arch/arm64/Kconfig renamed from arch/arm64/Kconfig~mm-debug-add-tests-validating-architecture-page-table-helpers +1 -0
@@ -10,6 +10,7 @@ config ARM64 select ACPI_SPCR_TABLE if ACPI select ACPI_PPTT if ACPI select ARCH_HAS_DEBUG_VIRTUAL + select ARCH_HAS_DEBUG_VM_PGTABLE select ARCH_HAS_DEVMEM_IS_ALLOWED select ARCH_HAS_DMA_PREP_COHERENT select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
arch/powerpc/Kconfig renamed from arch/powerpc/Kconfig~mm-debug-add-tests-validating-architecture-page-table-helpers +1 -0
@@ -116,6 +116,7 @@ config PPC # select ARCH_32BIT_OFF_T if PPC32 select ARCH_HAS_DEBUG_VIRTUAL + select ARCH_HAS_DEBUG_VM_PGTABLE select ARCH_HAS_DEVMEM_IS_ALLOWED select ARCH_HAS_ELF_RANDOMIZE select ARCH_HAS_FORTIFY_SOURCE
arch/s390/Kconfig renamed from arch/s390/Kconfig~mm-debug-add-tests-validating-architecture-page-table-helpers +1 -0
@@ -59,6 +59,7 @@ config KASAN_SHADOW_OFFSET config S390 def_bool y select ARCH_BINFMT_ELF_STATE + select ARCH_HAS_DEBUG_VM_PGTABLE select ARCH_HAS_DEVMEM_IS_ALLOWED select ARCH_HAS_ELF_RANDOMIZE select ARCH_HAS_FORTIFY_SOURCE
arch/x86/include/asm/pgtable_64.h renamed from arch/x86/include/asm/pgtable_64.h~mm-debug-add-tests-validating-architecture-page-table-helpers +6 -0
@@ -53,6 +53,12 @@ static inline void sync_initial_page_tabstruct mm_struct ; +#define mm_p4d_folded mm_p4d_folded +static inline bool mm_p4d_folded (struct mm_struct *mm) +{ +return !pgtable_l5_enabled (); +} +void set_pte_vaddr_p4d (p4d_t *p4d_page,unsigned long vaddr,pte_t new_pte);void set_pte_vaddr_pud (pud_t *pud_page,unsigned long vaddr,pte_t new_pte);
arch/x86/Kconfig renamed from arch/x86/Kconfig~mm-debug-add-tests-validating-architecture-page-table-helpers +1 -0
@@ -59,6 +59,7 @@ config X86 select ARCH_CLOCKSOURCE_INIT select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI select ARCH_HAS_DEBUG_VIRTUAL + select ARCH_HAS_DEBUG_VM_PGTABLE if !X86_PAE select ARCH_HAS_DEVMEM_IS_ALLOWED select ARCH_HAS_ELF_RANDOMIZE select ARCH_HAS_FAST_MULTIPLIER
Documentation/features/debug/debug-vm-pgtable/arch-support.txt new file +34 -0
@@ -0,0 +1,34 @@ +# +# Feature name: debug-vm-pgtable +# Kconfig: ARCH_HAS_DEBUG_VM_PGTABLE +# description: arch supports pgtable tests for semantics compliance +# + ----------------------- + | arch |status| + ----------------------- + | alpha: | TODO | + | arc: | ok | + | arm: | TODO | + | arm64: | ok | + | c6x: | TODO | + | csky: | TODO | + | h8300: | TODO | + | hexagon: | TODO | + | ia64: | TODO | + | m68k: | TODO | + | microblaze: | TODO | + | mips: | TODO | + | nds32: | TODO | + | nios2: | TODO | + | openrisc: | TODO | + | parisc: | TODO | + | powerpc: | ok | + | riscv: | TODO | + | s390: | ok | + | sh: | TODO | + | sparc: | TODO | + | um: | TODO | + | unicore32: | TODO | + | x86: | ok | + | xtensa: | TODO | + -----------------------
include/linux/mmdebug.h renamed from include/linux/mmdebug.h~mm-debug-add-tests-validating-architecture-page-table-helpers +5 -0
@@ -64,4 +64,9 @@ void dump_mm(const struct mm_struct *mm)#define VM_BUG_ON_PGFLAGS (cond, page) BUILD_BUG_ON_INVALID(cond)#endif +#ifdef CONFIG_DEBUG_VM_PGTABLE +void debug_vm_pgtable (void ); +#else +static inline void debug_vm_pgtable (void ) { } +#endif #endif
init/main.c renamed from init/main.c~mm-debug-add-tests-validating-architecture-page-table-helpers +2 -0
@@ -54,6 +54,7 @@#include <linux/delayacct.h> #include <linux/unistd.h> #include <linux/utsname.h> +#include <linux/mmdebug.h> #include <linux/rmap.h> #include <linux/mempolicy.h> #include <linux/key.h>
@@ -1357,6 +1358,7 @@ static int __ref kernel_init(void *unusekernel_init_freeable ();/* need to finish all async __init code before freeing the memory */ async_synchronize_full (); +debug_vm_pgtable ();ftrace_free_init_mem ();free_initmem ();mark_readonly ();
lib/Kconfig.debug renamed from lib/Kconfig.debug~mm-debug-add-tests-validating-architecture-page-table-helpers +26 -0
@@ -651,6 +651,12 @@ config SCHED_STACK_END_CHECK data corruption or a sporadic crash at a later stage once the region is examined. The runtime overhead introduced is minimal. +config ARCH_HAS_DEBUG_VM_PGTABLE + bool + help + An architecture should select this when it can successfully + build and run DEBUG_VM_PGTABLE. + config DEBUG_VM bool "Debug VM" depends on DEBUG_KERNEL
@@ -686,6 +692,26 @@ config DEBUG_VM_PGFLAGS If unsure, say N. +config DEBUG_VM_PGTABLE + bool "Debug arch page table for semantics compliance" + depends on MMU + depends on !IA64 && !ARM + depends on ARCH_HAS_DEBUG_VM_PGTABLE || EXPERT + default n if !ARCH_HAS_DEBUG_VM_PGTABLE + default y if DEBUG_VM + help + This option provides a debug method which can be used to test + architecture page table helper functions on various platforms in + verifying if they comply with expected generic MM semantics. This + will help architecture code in making sure that any changes or + new additions of these helpers still conform to expected + semantics of the generic MM. Platforms will have to opt in for + this through ARCH_HAS_DEBUG_VM_PGTABLE. Although it can also be + enabled through EXPERT without requiring code change. This test + is disabled on IA64 and ARM platforms where it fails to build. + + If unsure, say N. + config ARCH_HAS_DEBUG_VIRTUAL bool
mm/debug_vm_pgtable.c new file +392 -0
392 lines not on this page · raw message
mm/Makefile renamed from mm/Makefile~mm-debug-add-tests-validating-architecture-page-table-helpers +1 -0
@@ -88,6 +88,7 @@ obj-$(CONFIG_HWPOISON_INJECT) += hwpoiso obj-$(CONFIG_DEBUG_KMEMLEAK) += kmemleak.o obj-$(CONFIG_DEBUG_KMEMLEAK_TEST) += kmemleak-test.o obj-$(CONFIG_DEBUG_RODATA_TEST) += rodata_test.o +obj-$(CONFIG_DEBUG_VM_PGTABLE) += debug_vm_pgtable.o obj-$(CONFIG_PAGE_OWNER) += page_owner.o obj-$(CONFIG_CLEANCACHE) += cleancache.o obj-$(CONFIG_MEMORY_ISOLATION) += page_isolation.o
_
Re: [patch 1/1] mm/debug: add tests validating architecture page table helpers
Quoted 5 lines · Andrew Morton
Test page table pages are allocated from system memory with required size and alignments. The mapped pfns at page table levels are derived from a real pfn representing a valid kernel text symbol. This test gets called inside
kernel_init()right afterasync_synchronize_full().
This last part makes absolutely zero sense to me.
Why would it be done before the machine is properly up? Why isn't this just a module with a module_init? What makes this test so important and magical that it has to be done during early boot?
So not applied, particularly since this apparently caused problems. We don't randomly break the boot, which is fragile anyway, just for a test that doesn't look like it should be boot-specific to me.
If it wants a new clean mm, it should just do a fork. And do so _looong_ long after boot.
Linus
Re: [patch 1/1] mm/debug: add tests validating architecture page table helpers
Quoted 8 lines · Linus Torvalds
Quoted 5 lines · Andrew Morton
Test page table pages are allocated from system memory with required size and alignments. The mapped pfns at page table levels are derived from a real pfn representing a valid kernel text symbol. This test gets called inside
kernel_init()right afterasync_synchronize_full().
Quoted 5 lines
This last part makes absolutely zero sense to me.
Why would it be done before the machine is properly up? Why isn't this just a module with a
module_init? What makes this test so important and magical that it has to be done during early boot?
This test first started with being a module_init(), then a late_initcall() before getting called inside kernel_init() in it's current form. During our early review process (https://patchwork.kernel.org/patch/11176831/) Ingo had suggested moving this test earlier during boot to catch potential page table helper problems (if any), which made sense.
This test does not particularly need to run during early boot but it might just be preferable to detect potential page table helper problems (if any) earlier before they start getting used some where else. Though I guess it is not absolutely necessary either.
Quoted 4 lines
So not applied, particularly since this apparently caused problems. We don't randomly break the boot, which is fragile anyway, just for a test that doesn't look like it should be boot-specific to me.
Fair enough, will change this to late_initcall().
Just to give some more historical context..
This test has been validated on all explicitly supported platforms (i.e via enabling ARCH_HAS_DEBUG_VM_PGTABLE) i.e arm64, s390, arc, powerpc (32 and 64), x86 (!X86_PAE). But this can also be enabled via CONFIG_EXPERT on platforms that dont subscribe ARCH_HAS_DEBUG_VM_PGTABLE either because there were no volunteers to run the test or the test might just fail to run. The idea behind allowing this test get enabled via CONFIG_EXPERT was to just facilitate easy experimentation (without really changing Kconfig) on platforms that dont support it just yet through ARCH_HAS_DEBUG_VM_PGTABLE. There was a recent bug report for one such scenarios [1]. But we do expect such scenarios to exist on platforms without ARCH_HAS_DEBUG_VM_PGTABLE and CONFIG_EXPERT method was precisely provided for the very same reason.
[1] https://lore.kernel.org/lkml/[email protected]/
Quoted 6 lines
If it wants a new clean mm, it should just do a fork. And do so _looong_ long after boot.
Linus
+ mm-userfaultfd-disable-userfaultfd-wp-on-x86_32.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm/userfaultfd: disable userfaultfd-wp on x86_32 has been added to the -mm tree. Its filename is mm-userfaultfd-disable-userfaultfd-wp-on-x86_32.patch
The patch titled
Subject: mm/userfaultfd: disable userfaultfd-wp on x86_32
has been added to the -mm tree. Its filename is
mm-userfaultfd-disable-userfaultfd-wp-on-x86_32.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-userfaultfd-disable-userfaultfd-wp-on-x86_32.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-userfaultfd-disable-userfaultfd-wp-on-x86_32.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Peter Xu <[email protected]>
Subject: mm/userfaultfd: disable userfaultfd-wp on x86_32
Userfaultfd-wp is not yet working on 32bit hosts, but it's accidentally enabled previously. Disable it.
---
arch/x86/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/Kconfig renamed from arch/x86/Kconfig~mm-userfaultfd-disable-userfaultfd-wp-on-x86_32 +1 -1
@@ -150,7 +150,7 @@ config X86 select HAVE_ARCH_TRACEHOOK select HAVE_ARCH_TRANSPARENT_HUGEPAGE select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD if X86_64 - select HAVE_ARCH_USERFAULTFD_WP if USERFAULTFD + select HAVE_ARCH_USERFAULTFD_WP if X86_64 && USERFAULTFD select HAVE_ARCH_VMAP_STACK if X86_64 select HAVE_ARCH_WITHIN_STACK_FRAMES select HAVE_ASM_MODVERSIONS
_
Patches currently in -mm which might be from [email protected] are
mm-userfaultfd-disable-userfaultfd-wp-on-x86_32.patch
+ maintainers-add-an-entry-for-kfifo-fix.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: maintainers-add-an-entry-for-kfifo-fix has been added to the -mm tree. Its filename is maintainers-add-an-entry-for-kfifo-fix.patch
The patch titled
Subject: maintainers-add-an-entry-for-kfifo-fix
has been added to the -mm tree. Its filename is
maintainers-add-an-entry-for-kfifo-fix.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/maintainers-add-an-entry-for-kfifo-fix.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/maintainers-add-an-entry-for-kfifo-fix.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Andrew Morton <[email protected]>
Subject: maintainers-add-an-entry-for-kfifo-fix
alphasort F: entries, per Joa
---
MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS renamed from MAINTAINERS~maintainers-add-an-entry-for-kfifo-fix +1 -1
@@ -9415,8 +9415,8 @@ F: security/keys/ KFIFO: M: Stefani Seibold <[email protected]> S: Maintained -F: lib/kfifo.c F: include/linux/kfifo.h +F: lib/kfifo.c F: samples/kfifo/ KGDB / KDB /debug_core
_
Patches currently in -mm which might be from [email protected] are
maintainers-add-an-entry-for-kfifo-fix.patch drivers-tty-serial-sh-scic-suppress-uninitialized-var-warning.patch mm.patch memcg-optimize-memorynuma_stat-like-memorystat-fix.patch mm-clarify-__gfp_memalloc-usage-update-checkpatch-fixes.patch linux-next-fix.patch kernel-forkc-export-kernel_thread-to-modules.patch
+ m68k-drop-redundant-generic-y-=-hardirqh.patch added to -mm tree
In reply to Andrew MortonThe patch titled
The patch titled
Subject: m68k: drop redundant generic-y += hardirq.h
has been added to the -mm tree. Its filename is
m68k-drop-redundant-generic-y-=-hardirqh.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/m68k-drop-redundant-generic-y-%3D-hardirqh.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/m68k-drop-redundant-generic-y-%3D-hardirqh.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Geert Uytterhoeven <[email protected]>
Subject: m68k: drop redundant generic-y += hardirq.h
The cleanup in commit 630f289b7114c0e6 ("asm-generic: make more kernel-space headers mandatory") did not take into account the recently added line for hardirq.h in commit acc45648b9aefa90 ("m68k: Switch to asm-generic/hardirq.h"), leading to the following message during the build:
scripts/Makefile.asm-generic:25: redundant generic-y found in arch/m68k/include/asm/Kbuild: hardirq.h
Fix this by dropping the now redundant line.
---
arch/m68k/include/asm/Kbuild | 1 - 1 file changed, 1 deletion(-)
arch/m68k/include/asm/Kbuild renamed from arch/m68k/include/asm/Kbuild~m68k-drop-redundant-generic-y-=-hardirqh +0 -1
@@ -1,7 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 generated-y += syscall_table.h generic-y += extable.h -generic-y += hardirq.h generic-y += kvm_para.h generic-y += local64.h generic-y += mcs_spinlock.h
_
Patches currently in -mm which might be from [email protected] are
m68k-drop-redundant-generic-y-=-hardirqh.patch
+ userc-make-uidhash_table-static.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: user.c: make uidhash_table static has been added to the -mm tree. Its filename is userc-make-uidhash_table-static.patch
The patch titled
Subject: user.c: make uidhash_table static
has been added to the -mm tree. Its filename is
userc-make-uidhash_table-static.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/userc-make-uidhash_table-static.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/userc-make-uidhash_table-static.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Jason Yan <[email protected]>
Subject: user.c: make uidhash_table static
Fix the following sparse warning:
kernel/user.c:85:19: warning: symbol 'uidhash_table' was not declared. Should it be static?
---
kernel/user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/user.c renamed from kernel/user.c~userc-make-uidhash_table-static +1 -1
@@ -82,7 +82,7 @@ EXPORT_SYMBOL_GPL(init_user_ns);#define uidhashentry (uid) (uidhash_table + __uidhashfn((__kuid_val(uid))))static struct kmem_cache *uid_cachep; -struct hlist_head uidhash_table[UIDHASH_SZ ]; +static struct hlist_head uidhash_table[UIDHASH_SZ ];/* * The uidhash_lock is mostly taken from process context, but it is
_
Patches currently in -mm which might be from [email protected] are
userc-make-uidhash_table-static.patch
+ sh-fix-build-error-in-mm-initc.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: sh: fix build error in mm/init.c has been added to the -mm tree. Its filename is sh-fix-build-error-in-mm-initc.patch
The patch titled
Subject: sh: fix build error in mm/init.c
has been added to the -mm tree. Its filename is
sh-fix-build-error-in-mm-initc.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/sh-fix-build-error-in-mm-initc.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/sh-fix-build-error-in-mm-initc.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Masahiro Yamada <[email protected]>
Subject: sh: fix build error in mm/init.c
The closing parenthesis is missing.
---
arch/sh/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/mm/init.c renamed from arch/sh/mm/init.c~sh-fix-build-error-in-mm-initc +1 -1
@@ -412,7 +412,7 @@ int arch_add_memory(int nid, u64 start,unsigned long nr_pages = size >>PAGE_SHIFT ;int ret; - if (WARN_ON_ONCE(params->pgprot.pgprot != PAGE_KERNEL.pgprot) +if (WARN_ON_ONCE (params->pgprot.pgprot !=PAGE_KERNEL .pgprot))return -EINVAL ;/* We only have ZONE_NORMAL, so this is easy.. */
_
Patches currently in -mm which might be from [email protected] are
sh-fix-build-error-in-mm-initc.patch
+ mm-hugetlb-fix-a-addressing-exception-caused-by-huge_pte_offset.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm/hugetlb: fix a addressing exception caused by huge_pte_offset has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm/hugetlb: fix a addressing exception caused by huge_pte_offset
has been added to the -mm tree. Its filename is
mm-hugetlb-fix-a-addressing-exception-caused-by-huge_pte_offset.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-hugetlb-fix-a-addressing-exception-caused-by-huge_pte_offset.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-hugetlb-fix-a-addressing-exception-caused-by-huge_pte_offset.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Longpeng <[email protected]>
Subject: mm/hugetlb: fix a addressing exception caused by huge_pte_offset
Our machine encountered a panic(addressing exception) after run for a long time and the calltrace is:
RIP: 0010:[<ffffffff9dff0587>] [<ffffffff9dff0587>] hugetlb_fault+0x307/0xbe0 RSP: 0018:ffff9567fc27f808 EFLAGS: 00010286 RAX: e800c03ff1258d48 RBX: ffffd3bb003b69c0 RCX: e800c03ff1258d48 RDX: 17ff3fc00eda72b7 RSI: 00003ffffffff000 RDI: e800c03ff1258d48 RBP: ffff9567fc27f8c8 R08: e800c03ff1258d48 R09: 0000000000000080 R10: ffffaba0704c22a8 R11: 0000000000000001 R12: ffff95c87b4b60d8 R13: 00005fff00000000 R14: 0000000000000000 R15: ffff9567face8074 FS: 00007fe2d9ffb700(0000) GS:ffff956900e40000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffd3bb003b69c0 CR3: 000000be67374000 CR4: 00000000003627e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: [<ffffffff9df9b71b>] ? unlock_page+0x2b/0x30 [<ffffffff9dff04a2>] ? hugetlb_fault+0x222/0xbe0 [<ffffffff9dff1405>] follow_hugetlb_page+0x175/0x540 [<ffffffff9e15b825>] ? cpumask_next_and+0x35/0x50 [<ffffffff9dfc7230>] __get_user_pages+0x2a0/0x7e0 [<ffffffff9dfc648d>] __get_user_pages_unlocked+0x15d/0x210 [<ffffffffc068cfc5>] __gfn_to_pfn_memslot+0x3c5/0x460 [kvm] [<ffffffffc06b28be>] try_async_pf+0x6e/0x2a0 [kvm] [<ffffffffc06b4b41>] tdp_page_fault+0x151/0x2d0 [kvm] ... [<ffffffffc06a6f90>] kvm_arch_vcpu_ioctl_run+0x330/0x490 [kvm] [<ffffffffc068d919>] kvm_vcpu_ioctl+0x309/0x6d0 [kvm] [<ffffffff9deaa8c2>] ? dequeue_signal+0x32/0x180 [<ffffffff9deae34d>] ? do_sigtimedwait+0xcd/0x230 [<ffffffff9e03aed0>] do_vfs_ioctl+0x3f0/0x540 [<ffffffff9e03b0c1>] SyS_ioctl+0xa1/0xc0 [<ffffffff9e53879b>] system_call_fastpath+0x22/0x27
For 1G hugepages, huge_pte_offset() wants to return NULL or pudp, but it may return a wrong 'pmdp' if there is a race. Please look at the following code snippet:
...
pud = pud_offset(p4d, addr);
if (sz != PUD_SIZE && pud_none(*pud))
return NULL;
/* hugepage or swap? */
if (pud_huge(*pud) || !pud_present(*pud))
return (pte_t *)pud;
pmd = pmd_offset(pud, addr);
if (sz != PMD_SIZE && pmd_none(*pmd))
return NULL;
/* hugepage or swap? */
if (pmd_huge(*pmd) || !pmd_present(*pmd))
return (pte_t *)pmd;
...The following sequence would trigger this bug:
1. CPU0: sz = PUD_SIZE and *pud = 0 , continue
1. CPU0: "pud_huge(*pud)" is false
2. CPU1: calling hugetlb_no_page and set *pud to xxxx8e7(PRESENT)
3. CPU0: "!pud_present(*pud)" is false, continue
4. CPU0: pmd = pmd_offset(pud, addr) and maybe return a wrong pmdp However, we want CPU0 to return NULL or pudp in this case.
We must make sure there is exactly one dereference of pud and pmd.
---
mm/hugetlb.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
mm/hugetlb.c renamed from mm/hugetlb.c~mm-hugetlb-fix-a-addressing-exception-caused-by-huge_pte_offset +8 -6
@@ -5365,8 +5365,8 @@ pte_t *huge_pte_offset(struct mm_struct {pgd_t *pgd;p4d_t *p4d; -pud_t *pud; -pmd_t *pmd; +pud_t *pud, pud_entry; +pmd_t *pmd, pmd_entry; pgd =pgd_offset (mm, addr);if (!pgd_present (*pgd))
@@ -5376,17 +5376,19 @@ pte_t *huge_pte_offset(struct mm_structreturn NULL ; pud =pud_offset (p4d, addr); -if (sz !=PUD_SIZE &&pud_none (*pud)) + pud_entry =READ_ONCE (*pud); +if (sz !=PUD_SIZE &&pud_none (pud_entry))return NULL ;/* hugepage or swap? */ -if (pud_huge (*pud) || !pud_present (*pud)) +if (pud_huge (pud_entry) || !pud_present (pud_entry))return (pte_t *)pud; pmd =pmd_offset (pud, addr); -if (sz !=PMD_SIZE &&pmd_none (*pmd)) + pmd_entry =READ_ONCE (*pmd); +if (sz !=PMD_SIZE &&pmd_none (pmd_entry))return NULL ;/* hugepage or swap? */ -if (pmd_huge (*pmd) || !pmd_present (*pmd)) +if (pmd_huge (pmd_entry) || !pmd_present (pmd_entry))return (pte_t *)pmd;return NULL ;
_
Patches currently in -mm which might be from [email protected] are
mm-hugetlb-fix-a-addressing-exception-caused-by-huge_pte_offset.patch
+ checkpatch-additional-maintainer-section-entry-ordering-checks.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: checkpatch: additional MAINTAINER section entry ordering checks has been added to the -mm tree. Its filename is…
The patch titled
Subject: checkpatch: additional MAINTAINER section entry ordering checks
has been added to the -mm tree. Its filename is
checkpatch-additional-maintainer-section-entry-ordering-checks.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/checkpatch-additional-maintainer-section-entry-ordering-checks.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/checkpatch-additional-maintainer-section-entry-ordering-checks.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Joe Perches <[email protected]>
Subject: checkpatch: additional MAINTAINER section entry ordering checks
There is a preferred order for the entries in MAINTAINERS sections.
See:
commit 3b50142d8528 ("MAINTAINERS: sort field names for all entries") and
commit 6680125ea5a2 ("MAINTAINERS: list the section entries in the preferred order")
Add checkpatch tests to try to keep that ordering.
---
scripts/checkpatch.pl | 45 ++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-)
scripts/checkpatch.pl renamed from scripts/checkpatch.pl~checkpatch-additional-maintainer-section-entry-ordering-checks +37 -8
@@ -3060,14 +3060,43 @@ sub process { #print "is_start<$is_start> is_end<$is_end> length<$length>\n"; } -# check for MAINTAINERS entries that don't have the right form - if ($realfile =~ /^MAINTAINERS$/ && - $rawline =~ /^\+[A-Z]:/ && - $rawline !~ /^\+[A-Z]:\t\S/) { - if (WARN("MAINTAINERS_STYLE", - "MAINTAINERS entries use one tab after TYPE:\n" . $herecurr) && - $fix) { - $fixed[$fixlinenr] =~ s/^(\+[A-Z]):\s*/$1:\t/; +# check MAINTAINERS entries + if ($realfile =~ /^MAINTAINERS$/) { +# check MAINTAINERS entries for the right form + if ($rawline =~ /^\+[A-Z]:/ && + $rawline !~ /^\+[A-Z]:\t\S/) { + if (WARN("MAINTAINERS_STYLE", + "MAINTAINERS entries use one tab after TYPE:\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/^(\+[A-Z]):\s*/$1:\t/; + } + } +# check MAINTAINERS entries for the right ordering too + my $preferred_order = 'MRLSWQBCPTFXNK'; + if ($rawline =~ /^\+[A-Z]:/ && + $prevrawline =~ /^[\+ ][A-Z]:/) { + $rawline =~ /^\+([A-Z]):\s*(.*)/; + my $cur = $1; + my $curval = $2; + $prevrawline =~ /^[\+ ]([A-Z]):\s*(.*)/; + my $prev = $1; + my $prevval = $2; + my $curindex = index($preferred_order, $cur); + my $previndex = index($preferred_order, $prev); + if ($curindex < 0) { + WARN("MAINTAINERS_STYLE", + "Unknown MAINTAINERS entry type: '$cur'\n" . $herecurr); + } else { + if ($previndex >= 0 && $curindex < $previndex) { + WARN("MAINTAINERS_STYLE", + "Misordered MAINTAINERS entry - list '$cur:' before '$prev:'\n" . $hereprev); + } elsif ((($prev eq 'F' && $cur eq 'F') || + ($prev eq 'X' && $cur eq 'X')) && + ($prevval cmp $curval) > 0) { + WARN("MAINTAINERS_STYLE", + "Misordered MAINTAINERS entry - list file patterns in alphabetic order\n" . $hereprev); + } + } } }
_
Patches currently in -mm which might be from [email protected] are
checkpatch-additional-maintainer-section-entry-ordering-checks.patch
+ fat-improve-the-readahead-for-fat-entries.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: fat: improve the readahead for FAT entries has been added to the -mm tree. Its filename is fat-improve-the-readahead-for-fat-entries.patch
The patch titled
Subject: fat: improve the readahead for FAT entries
has been added to the -mm tree. Its filename is
fat-improve-the-readahead-for-fat-entries.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/fat-improve-the-readahead-for-fat-entries.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/fat-improve-the-readahead-for-fat-entries.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: OGAWA Hirofumi <[email protected]>
Subject: fat: improve the readahead for FAT entries
Current readahead for FAT entries is very simple but is having some flaws, so it is not working well for some environments. This patch improves the readahead more or less.
The key points of modification are,
- make the readahead size tunable by using bdi->ra_pages
- care the bdi->io_pages to avoid the small size I/O request
- update readahead window before fully exhausting
With this patch, on slow USB connected 2TB hdd:
[before]
383.18sec
[after]
51.03sec
---
fs/fat/fatent.c | 103 +++++++++++++++++++++++++++++++++------------- 1 file changed, 75 insertions(+), 28 deletions(-)
fs/fat/fatent.c renamed from fs/fat/fatent.c~fat-improve-the-readahead-for-fat-entries +73 -22
@@ -632,20 +632,80 @@ error: }EXPORT_SYMBOL_GPL (fat_free_clusters); -/* 128kb is the whole sectors for FAT12 and FAT16 */ -#define FAT_READA_SIZE (128 * 1024) +struct fatent_ra { +sector_t cur; +sector_t limit; + +unsigned int ra_blocks; +sector_t ra_advance; +sector_t ra_next; +sector_t ra_limit; +}; -static void fat_ent_reada (struct super_block *sb,struct fat_entry *fatent, -unsigned long reada_blocks) +static void fat_ra_init (struct super_block *sb,struct fatent_ra *ra, +struct fat_entry *fatent,int ent_limit) { -const struct fatent_operations *ops =MSDOS_SB (sb)->fatent_ops; -sector_t blocknr; -int i, offset; +struct msdos_sb_info *sbi =MSDOS_SB (sb); +const struct fatent_operations *ops = sbi->fatent_ops; +sector_t blocknr, block_end; +int offset; +/* +* This is the sequential read, so ra_pages * 2 (but try to +* align the optimal hardware IO size). +* [BTW, 128kb covers the whole sectors for FAT12 and FAT16] +*/ +unsigned long ra_pages = sb->s_bdi->ra_pages; +unsigned int reada_blocks; + +if (ra_pages > sb->s_bdi->io_pages) + ra_pages =rounddown (ra_pages, sb->s_bdi->io_pages); + reada_blocks = ra_pages << (PAGE_SHIFT - sb->s_blocksize_bits +1 ); +/* Initialize the range for sequential read */ ops->ent_blocknr (sb, fatent->entry, &offset, &blocknr); + ops->ent_blocknr (sb, ent_limit -1 , &offset, &block_end); + ra->cur =0 ; + ra->limit = (block_end +1 ) - blocknr; + +/* Advancing the window at half size */ + ra->ra_blocks = reada_blocks >>1 ; + ra->ra_advance = ra->cur; + ra->ra_next = ra->cur; + ra->ra_limit = ra->cur +min_t (sector_t, reada_blocks, ra->limit); +} -for (i =0 ; i < reada_blocks; i++) -sb_breadahead (sb, blocknr + i); +/* Assuming to be called before reading a new block (increments ->cur). */ +static void fat_ent_reada (struct super_block *sb,struct fatent_ra *ra, +struct fat_entry *fatent) +{ +if (ra->ra_next >= ra->ra_limit) +return ; + +if (ra->cur >= ra->ra_advance) { +struct msdos_sb_info *sbi =MSDOS_SB (sb); +const struct fatent_operations *ops = sbi->fatent_ops; +struct blk_plug plug; +sector_t blocknr, diff; +int offset; + + ops->ent_blocknr (sb, fatent->entry, &offset, &blocknr); + + diff = blocknr - ra->cur; +blk_start_plug (&plug); +/* +* FIXME: we would want to directly use the bio with +* pages to reduce the number of segments. +*/ +for (; ra->ra_next < ra->ra_limit; ra->ra_next++) +sb_breadahead (sb, ra->ra_next + diff); +blk_finish_plug (&plug); + +/* Advance the readahead window */ + ra->ra_advance += ra->ra_blocks; + ra->ra_limit +=min_t (sector_t, + ra->ra_blocks, ra->limit - ra->ra_limit); + } + ra->cur++; }int fat_count_free_clusters (struct super_block *sb)
@@ -653,27 +713,20 @@ int fat_count_free_clusters(struct superstruct msdos_sb_info *sbi =MSDOS_SB (sb);const struct fatent_operations *ops = sbi->fatent_ops;struct fat_entry fatent; -unsigned long reada_blocks, reada_mask, cur_block; +struct fatent_ra fatent_ra;int err =0 , free;lock_fat (sbi);if (sbi->free_clusters !=-1 && sbi->free_clus_valid) goto out; - reada_blocks =FAT_READA_SIZE >> sb->s_blocksize_bits; - reada_mask = reada_blocks -1 ; - cur_block =0 ; - free =0 ;fatent_init (&fatent);fatent_set_entry (&fatent,FAT_START_ENT ); +fat_ra_init (sb, &fatent_ra, &fatent, sbi->max_cluster);while (fatent.entry < sbi->max_cluster) {/* readahead of fat blocks */ -if ((cur_block & reada_mask) ==0 ) { -unsigned long rest = sbi->fat_length - cur_block; -fat_ent_reada (sb, &fatent,min (reada_blocks, rest)); - } - cur_block++; +fat_ent_reada (sb, &fatent_ra, &fatent); err =fat_ent_read_block (sb, &fatent);if (err)
@@ -707,9 +760,9 @@ int fat_trim_fs(struct inode *inode, strstruct msdos_sb_info *sbi =MSDOS_SB (sb);const struct fatent_operations *ops = sbi->fatent_ops;struct fat_entry fatent; +struct fatent_ra fatent_ra;u64 ent_start, ent_end, minlen, trimmed =0 ;u32 free =0 ; -unsigned long reada_blocks, reada_mask, cur_block =0 ;int err =0 ;/*
@@ -727,19 +780,13 @@ int fat_trim_fs(struct inode *inode, strif (ent_end >= sbi->max_cluster) ent_end = sbi->max_cluster -1 ; - reada_blocks =FAT_READA_SIZE >> sb->s_blocksize_bits; - reada_mask = reada_blocks -1 ;
+ mm-swapfile-use-list_prevnext_entry-instead-of-open-coding.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm/swapfile: use list_{prev,next}_entry() instead of open-coding has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm/swapfile: use list_{prev,next}_entry() instead of open-coding
has been added to the -mm tree. Its filename is
mm-swapfile-use-list_prevnext_entry-instead-of-open-coding.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-swapfile-use-list_prevnext_entry-instead-of-open-coding.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-swapfile-use-list_prevnext_entry-instead-of-open-coding.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: chenqiwu <[email protected]>
Subject: mm/swapfile: use list_{prev,next}_entry() instead of open-coding
Use list_{prev,next}_entry() instead of list_entry() for better code readability.
---
mm/swapfile.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
mm/swapfile.c renamed from mm/swapfile.c~mm-swapfile-use-list_prevnext_entry-instead-of-open-coding +6 -10
@@ -3654,7 +3654,7 @@ static bool swap_count_continued(structspin_lock (&si->cont_lock); offset &= ~PAGE_MASK ; - page = list_entry(head->lru.next, struct page, lru); + page =list_next_entry (head, lru); map =kmap_atomic (page) + offset;if (count ==SWAP_MAP_MAX )/* initial increment from swap_map */
@@ -3666,13 +3666,13 @@ static bool swap_count_continued(struct*/ while (*map == (SWAP_CONT_MAX |COUNT_CONTINUED )) {kunmap_atomic (map); - page = list_entry(page->lru.next, struct page, lru); + page =list_next_entry (page, lru);BUG_ON (page == head); map =kmap_atomic (page) + offset; }if (*map ==SWAP_CONT_MAX ) {kunmap_atomic (map); - page = list_entry(page->lru.next, struct page, lru); + page =list_next_entry (page, lru);if (page == head) { ret = false;/* add count continuation */ goto out;
@@ -3682,12 +3682,10 @@ init_map: *map = 0; /* we didn't zero } *map +=1 ;kunmap_atomic (map); - page = list_entry(page->lru.prev, struct page, lru); -while (page != head) { +while ((page =list_prev_entry (page, lru)) != head) { map =kmap_atomic (page) + offset; *map =COUNT_CONTINUED ;kunmap_atomic (map); - page = list_entry(page->lru.prev, struct page, lru); } ret = true;/* incremented */
@@ -3698,7 +3696,7 @@ init_map: *map = 0; /* we didn't zeroBUG_ON (count !=COUNT_CONTINUED );while (*map ==COUNT_CONTINUED ) {kunmap_atomic (map); - page = list_entry(page->lru.next, struct page, lru); + page =list_next_entry (page, lru);BUG_ON (page == head); map =kmap_atomic (page) + offset; }
@@ -3707,13 +3705,11 @@ init_map: *map = 0; /* we didn't zeroif (*map ==0 ) count =0 ;kunmap_atomic (map); - page = list_entry(page->lru.prev, struct page, lru); -while (page != head) { +while ((page =list_prev_entry (page, lru)) != head) { map =kmap_atomic (page) + offset; *map =SWAP_CONT_MAX | count; count =COUNT_CONTINUED ;kunmap_atomic (map); - page = list_entry(page->lru.prev, struct page, lru); } ret = count ==COUNT_CONTINUED ; }
_
Patches currently in -mm which might be from [email protected] are
mm-swapfile-use-list_prevnext_entry-instead-of-open-coding.patch mm-replace-zero-length-array-with-flexible-array-member.patch
+ mm-replace-zero-length-array-with-flexible-array-member.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm: replace zero-length array with flexible-array member has been added to the -mm tree. Its filename is mm-replace-zero-length-array-with-flexible-array-member.patch
The patch titled
Subject: mm: replace zero-length array with flexible-array member
has been added to the -mm tree. Its filename is
mm-replace-zero-length-array-with-flexible-array-member.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-replace-zero-length-array-with-flexible-array-member.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-replace-zero-length-array-with-flexible-array-member.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: chenqiwu <[email protected]>
Subject: mm: replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99:
struct foo {
int stuff;
struct boo array[];
};By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on.
Also, notice that, dynamic memory allocations won't be affected by this change:
"Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1]
This issue was found with the help of Coccinelle.
[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")
---
include/linux/mm.h | 2 +- include/linux/mmzone.h | 2 +- include/linux/swap.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-replace-zero-length-array-with-flexible-array-member +1 -1
@@ -1718,7 +1718,7 @@ struct frame_vector {unsigned int nr_frames;/* Number of frames stored in ptrs array */ bool got_ref;/* Did we pin pages by getting page ref? */ bool is_pfns;/* Does array contain pages or pfns? */ -void *ptrs[0 ];/* Array of pinned pfns / pages. Use +void *ptrs[];/* Array of pinned pfns / pages. Use * pfns_vector_pages() or pfns_vector_pfns() * for access */ };
include/linux/mmzone.h renamed from include/linux/mmzone.h~mm-replace-zero-length-array-with-flexible-array-member +1 -1
@@ -1147,7 +1147,7 @@ struct mem_section_usage {DECLARE_BITMAP (subsection_map,SUBSECTIONS_PER_SECTION );#endif /* See declaration of similar field in struct zone */ -unsigned long pageblock_flags[0 ]; +unsigned long pageblock_flags[]; };void subsection_map_init (unsigned long pfn,unsigned long nr_pages);
include/linux/swap.h renamed from include/linux/swap.h~mm-replace-zero-length-array-with-flexible-array-member +1 -1
@@ -275,7 +275,7 @@ struct swap_info_struct {*/ struct work_struct discard_work;/* discard worker */ struct swap_cluster_list discard_clusters;/* discard clusters list */ -struct plist_node avail_lists[0 ];/* +struct plist_node avail_lists[];/* * entries in swap_avail_heads, one * entry per node. * Must be last as the number of the
_
Patches currently in -mm which might be from [email protected] are
mm-swapfile-use-list_prevnext_entry-instead-of-open-coding.patch mm-replace-zero-length-array-with-flexible-array-member.patch
+ mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch added to -mm tree
In reply to Andrew MortonThe patch titled
The patch titled
Subject: mm/compaction: fix a typo in comment "pessemistic"->"pessimistic"
has been added to the -mm tree. Its filename is
mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Ethon Paul <[email protected]>
Subject: mm/compaction: fix a typo in comment "pessemistic"->"pessimistic"
There is a typo in comment, fix it.
---
mm/compaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/compaction.c renamed from mm/compaction.c~mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic +1 -1
@@ -1401,7 +1401,7 @@ fast_isolate_freepages(struct compact_coif (scan_start) {/* * Use the highest PFN found above min. If one was -* not found, be pessemistic for direct compaction +* not found, be pessimistic for direct compaction * and use the min mark. */ if (highest) {
_
Patches currently in -mm which might be from [email protected] are
mm-memory_hotplug-fix-a-typo-in-comment-recoreded-recorded.patch mm-ksm-fix-a-typo-in-comment-alreaady-already.patch mm-mmap-fix-a-typo-in-comment-compatbility-compatibility.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained.patch mm-vmsan-fix-some-typos-in-comment.patch mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch mm-memblock-fix-a-typo-in-comment-implict-implicit.patch mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch
+ mm-memblock-fix-a-typo-in-comment-implict-implicit.patch added to -mm tree
In reply to Andrew MortonThe patch titled
The patch titled
Subject: mm/memblock: fix a typo in comment "implict"->"implicit"
has been added to the -mm tree. Its filename is
mm-memblock-fix-a-typo-in-comment-implict-implicit.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-memblock-fix-a-typo-in-comment-implict-implicit.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-memblock-fix-a-typo-in-comment-implict-implicit.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Ethon Paul <[email protected]>
Subject: mm/memblock: fix a typo in comment "implict"->"implicit"
There is a typo in commet, fix it.
---
mm/memblock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memblock.c renamed from mm/memblock.c~mm-memblock-fix-a-typo-in-comment-implict-implicit +1 -1
@@ -78,7 +78,7 @@* * memblock_alloc*() - these functions return the **virtual** address * of the allocated memory. * -* Note, that both API variants use implict assumptions about allowed +* Note, that both API variants use implicit assumptions about allowed * memory ranges and the fallback methods. Consult the documentation * of memblock_alloc_internal() and memblock_alloc_range_nid() * functions for more elaborate description.
_
Patches currently in -mm which might be from [email protected] are
mm-memory_hotplug-fix-a-typo-in-comment-recoreded-recorded.patch mm-ksm-fix-a-typo-in-comment-alreaady-already.patch mm-mmap-fix-a-typo-in-comment-compatbility-compatibility.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained.patch mm-vmsan-fix-some-typos-in-comment.patch mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch mm-memblock-fix-a-typo-in-comment-implict-implicit.patch mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch
+ mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch added to -mm tree
In reply to Andrew MortonThe patch titled
The patch titled
Subject: mm/list_lru: fix a typo in comment "numbesr"->"numbers"
has been added to the -mm tree. Its filename is
mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Ethon Paul <[email protected]>
Subject: mm/list_lru: fix a typo in comment "numbesr"->"numbers"
There is a typo in comment, fix it.
---
mm/list_lru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/list_lru.c renamed from mm/list_lru.c~mm-list_lru-fix-a-typo-in-comment-numbesr-numbers +1 -1
@@ -213,7 +213,7 @@ restart:/* * decrement nr_to_walk first so that we don't livelock if we -* get stuck on large numbesr of LRU_RETRY items +* get stuck on large numbers of LRU_RETRY items */ if (!*nr_to_walk)break ;
_
Patches currently in -mm which might be from [email protected] are
mm-memory_hotplug-fix-a-typo-in-comment-recoreded-recorded.patch mm-ksm-fix-a-typo-in-comment-alreaady-already.patch mm-mmap-fix-a-typo-in-comment-compatbility-compatibility.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained.patch mm-vmsan-fix-some-typos-in-comment.patch mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch mm-memblock-fix-a-typo-in-comment-implict-implicit.patch mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch
+ mm-vmsan-fix-some-typos-in-comment.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm/vmsan: fix some typos in comment has been added to the -mm tree. Its filename is mm-vmsan-fix-some-typos-in-comment.patch
The patch titled
Subject: mm/vmsan: fix some typos in comment
has been added to the -mm tree. Its filename is
mm-vmsan-fix-some-typos-in-comment.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-vmsan-fix-some-typos-in-comment.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-vmsan-fix-some-typos-in-comment.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Ethon Paul <[email protected]>
Subject: mm/vmsan: fix some typos in comment
There are some typos, fix them.
s/regsitration/registration
s/santity/sanity
s/decremeting/decrementing
---
mm/vmscan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
mm/vmscan.c renamed from mm/vmscan.c~mm-vmsan-fix-some-typos-in-comment +3 -3
@@ -676,7 +676,7 @@ static unsigned long shrink_slab(gfp_t g freed += ret;/* * Bail out if someone want to register a new shrinker to -* prevent the regsitration from being stalled for long periods +* prevent the registration from being stalled for long periods * by parallel ongoing shrinking. */ if (rwsem_is_contended (&shrinker_rwsem)) {
@@ -1591,7 +1591,7 @@ int __isolate_lru_page(struct page *page/* * Update LRU sizes after isolating pages. The LRU size updates must -* be complete before mem_cgroup_update_lru_size due to a santity check. +* be complete before mem_cgroup_update_lru_size due to a sanity check. */ static __always_inline void update_lru_sizes(struct lruvec *lruvec,enum lru_list lru,unsigned long *nr_zone_taken)
@@ -2389,7 +2389,7 @@ out:/* * Minimally target SWAP_CLUSTER_MAX pages to keep -* reclaim moving forwards, avoiding decremeting +* reclaim moving forwards, avoiding decrementing * sc->priority further than desirable. */ scan =max (scan,SWAP_CLUSTER_MAX );
_
Patches currently in -mm which might be from [email protected] are
mm-memory_hotplug-fix-a-typo-in-comment-recoreded-recorded.patch mm-ksm-fix-a-typo-in-comment-alreaady-already.patch mm-mmap-fix-a-typo-in-comment-compatbility-compatibility.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained.patch mm-vmsan-fix-some-typos-in-comment.patch
+ mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch added to -mm tree
In reply to Andrew MortonThe patch titled
The patch titled
Subject: mm/filemap: fix a typo in comment "unneccssary"->"unnecessary"
has been added to the -mm tree. Its filename is
mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Ethon Paul <[email protected]>
Subject: mm/filemap: fix a typo in comment "unneccssary"->"unnecessary"
There is a typo in comment, fix it.
---
mm/filemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/filemap.c renamed from mm/filemap.c~mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary +1 -1
@@ -1259,7 +1259,7 @@ EXPORT_SYMBOL_GPL(add_page_wait_queue);* instead. * * The read of PG_waiters has to be after (or concurrently with) PG_locked -* being cleared, but a memory barrier should be unneccssary since it is +* being cleared, but a memory barrier should be unnecessary since it is * in the same byte as PG_locked. */ static inline bool clear_bit_unlock_is_negative_byte (long nr,volatile void *mem)
_
Patches currently in -mm which might be from [email protected] are
mm-memory_hotplug-fix-a-typo-in-comment-recoreded-recorded.patch mm-ksm-fix-a-typo-in-comment-alreaady-already.patch mm-mmap-fix-a-typo-in-comment-compatbility-compatibility.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained.patch mm-vmsan-fix-some-typos-in-comment.patch mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch mm-memblock-fix-a-typo-in-comment-implict-implicit.patch mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch
+ mm-frontswap-fix-some-typos-in-frontswapc.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm/frontswap: fix some typos in frontswap.c has been added to the -mm tree. Its filename is mm-frontswap-fix-some-typos-in-frontswapc.patch
The patch titled
Subject: mm/frontswap: fix some typos in frontswap.c
has been added to the -mm tree. Its filename is
mm-frontswap-fix-some-typos-in-frontswapc.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-frontswap-fix-some-typos-in-frontswapc.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-frontswap-fix-some-typos-in-frontswapc.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Ethon Paul <[email protected]>
Subject: mm/frontswap: fix some typos in frontswap.c
There are some typos in comment, fix them.
s/Fortunatly/Fortunately
s/taked/taken
s/necessory/necessary
s/shink/shrink
---
mm/frontswap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
mm/frontswap.c renamed from mm/frontswap.c~mm-frontswap-fix-some-typos-in-frontswapc +3 -3
@@ -87,7 +87,7 @@ static inline void inc_frontswap_invalid* * This would not guards us against the user deciding to call swapoff right as * we are calling the backend to initialize (so swapon is in action). -* Fortunatly for us, the swapon_mutex has been taked by the callee so we are +* Fortunately for us, the swapon_mutex has been taken by the callee so we are * OK. The other scenario where calls to frontswap_store (called via * swap_writepage) is racing with frontswap_invalidate_area (called via * swapoff) is again guarded by the swap subsystem.
@@ -413,8 +413,8 @@ static int __frontswap_unuse_pages(unsig }/* -* Used to check if it's necessory and feasible to unuse pages. -* Return 1 when nothing to do, 0 when need to shink pages, +* Used to check if it's necessary and feasible to unuse pages. +* Return 1 when nothing to do, 0 when need to shrink pages, * error code when there is an error. */ static int __frontswap_shrink(unsigned long target_pages,
_
Patches currently in -mm which might be from [email protected] are
mm-memory_hotplug-fix-a-typo-in-comment-recoreded-recorded.patch mm-ksm-fix-a-typo-in-comment-alreaady-already.patch mm-mmap-fix-a-typo-in-comment-compatbility-compatibility.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained.patch mm-vmsan-fix-some-typos-in-comment.patch mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch mm-memblock-fix-a-typo-in-comment-implict-implicit.patch mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch mm-frontswap-fix-some-typos-in-frontswapc.patch mm-memcg-fix-some-typos-in-memcontrolc.patch mm-fix-a-typo-in-comment-strucure-structure.patch
+ mm-memcg-fix-some-typos-in-memcontrolc.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm, memcg: fix some typos in memcontrol.c has been added to the -mm tree. Its filename is mm-memcg-fix-some-typos-in-memcontrolc.patch
The patch titled
Subject: mm, memcg: fix some typos in memcontrol.c
has been added to the -mm tree. Its filename is
mm-memcg-fix-some-typos-in-memcontrolc.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-memcg-fix-some-typos-in-memcontrolc.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-memcg-fix-some-typos-in-memcontrolc.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Ethon Paul <[email protected]>
Subject: mm, memcg: fix some typos in memcontrol.c
There are some typos in comment, fix them.
s/responsiblity/responsibility
s/oflline/offline
---
mm/memcontrol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/memcontrol.c renamed from mm/memcontrol.c~mm-memcg-fix-some-typos-in-memcontrolc +2 -2
@@ -3203,7 +3203,7 @@ unsigned long mem_cgroup_soft_limit_recl* Test whether @memcg has children, dead or alive. Note that this * function doesn't care whether @memcg has use_hierarchy enabled and * returns %true if there are child csses according to the cgroup -* hierarchy. Testing use_hierarchy is the caller's responsiblity. +* hierarchy. Testing use_hierarchy is the caller's responsibility. */ static inline bool memcg_has_children (struct mem_cgroup *memcg) {
@@ -4853,7 +4853,7 @@ static struct cftype mem_cgroup_legacy_f* limited to 16 bit (MEM_CGROUP_ID_MAX), limiting the total number of * memory-controlled cgroups to 64k. * -* However, there usually are many references to the oflline CSS after +* However, there usually are many references to the offline CSS after * the cgroup has been destroyed, such as page cache or reclaimable * slab objects, that don't need to hang on to the ID. We want to keep * those dead CSS from occupying IDs, or we might quickly exhaust the
_
Patches currently in -mm which might be from [email protected] are
mm-memory_hotplug-fix-a-typo-in-comment-recoreded-recorded.patch mm-ksm-fix-a-typo-in-comment-alreaady-already.patch mm-mmap-fix-a-typo-in-comment-compatbility-compatibility.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained.patch mm-vmsan-fix-some-typos-in-comment.patch mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch mm-memblock-fix-a-typo-in-comment-implict-implicit.patch mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch mm-frontswap-fix-some-typos-in-frontswapc.patch mm-memcg-fix-some-typos-in-memcontrolc.patch mm-fix-a-typo-in-comment-strucure-structure.patch
+ mm-fix-a-typo-in-comment-strucure-structure.patch added to -mm tree
In reply to Andrew MortonThe patch titled
The patch titled
Subject: mm: fix a typo in comment "strucure"->"structure"
has been added to the -mm tree. Its filename is
mm-fix-a-typo-in-comment-strucure-structure.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-fix-a-typo-in-comment-strucure-structure.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-fix-a-typo-in-comment-strucure-structure.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Ethon Paul <[email protected]>
Subject: mm: fix a typo in comment "strucure"->"structure"
There is a typo in comment, fix it.
---
mm/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/internal.h renamed from mm/internal.h~mm-fix-a-typo-in-comment-strucure-structure +1 -1
@@ -130,7 +130,7 @@ extern pmd_t *mm_find_pmd(struct mm_stru* * zonelist, preferred_zone and classzone_idx are set first in * __alloc_pages_nodemask() for the fast path, and might be later changed -* in __alloc_pages_slowpath(). All other functions pass the whole strucure +* in __alloc_pages_slowpath(). All other functions pass the whole structure * by a const pointer. */ struct alloc_context {
_
Patches currently in -mm which might be from [email protected] are
mm-memory_hotplug-fix-a-typo-in-comment-recoreded-recorded.patch mm-ksm-fix-a-typo-in-comment-alreaady-already.patch mm-mmap-fix-a-typo-in-comment-compatbility-compatibility.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained.patch mm-vmsan-fix-some-typos-in-comment.patch mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch mm-memblock-fix-a-typo-in-comment-implict-implicit.patch mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch mm-frontswap-fix-some-typos-in-frontswapc.patch mm-memcg-fix-some-typos-in-memcontrolc.patch mm-fix-a-typo-in-comment-strucure-structure.patch
+ mm-slub-fix-a-typo-in-comment-disambiguiation-disambiguation.patch added to -mm tree
In reply to Andrew MortonThe patch titled
The patch titled
Subject: mm/slub: fix a typo in comment "disambiguiation"->"disambiguation"
has been added to the -mm tree. Its filename is
mm-slub-fix-a-typo-in-comment-disambiguiation-disambiguation.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-slub-fix-a-typo-in-comment-disambiguiation-disambiguation.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-slub-fix-a-typo-in-comment-disambiguiation-disambiguation.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Ethon Paul <[email protected]>
Subject: mm/slub: fix a typo in comment "disambiguiation"->"disambiguation"
There is a typo in comment, fix it.
---
mm/slub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/slub.c renamed from mm/slub.c~mm-slub-fix-a-typo-in-comment-disambiguiation-disambiguation +1 -1
@@ -1984,7 +1984,7 @@ static void *get_partial(struct kmem_cac#ifdef CONFIG_PREEMPTION /* -* Calculate the next globally unique transaction for disambiguiation +* Calculate the next globally unique transaction for disambiguation * during cmpxchg. The transactions start with the cpu number and are then * incremented by CONFIG_NR_CPUS. */
_
Patches currently in -mm which might be from [email protected] are
mm-memory_hotplug-fix-a-typo-in-comment-recoreded-recorded.patch mm-ksm-fix-a-typo-in-comment-alreaady-already.patch mm-ksm-fix-a-typo-in-comment-alreaady-already-v2.patch mm-mmap-fix-a-typo-in-comment-compatbility-compatibility.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2.patch mm-vmsan-fix-some-typos-in-comment.patch mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch mm-memblock-fix-a-typo-in-comment-implict-implicit.patch mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch mm-frontswap-fix-some-typos-in-frontswapc.patch mm-memcg-fix-some-typos-in-memcontrolc.patch mm-fix-a-typo-in-comment-strucure-structure.patch mm-slub-fix-a-typo-in-comment-disambiguiation-disambiguation.patch mm-sparse-fix-a-typo-in-comment-convienence-convenience.patch mm-page-writeback-fix-a-typo-in-comment-effictive-effective.patch mm-memory-fix-a-typo-in-comment-attampt-attempt.patch
+ mm-sparse-fix-a-typo-in-comment-convienence-convenience.patch added to -mm tree
In reply to Andrew MortonThe patch titled
The patch titled
Subject: mm/sparse: fix a typo in comment "convienence"->"convenience"
has been added to the -mm tree. Its filename is
mm-sparse-fix-a-typo-in-comment-convienence-convenience.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-sparse-fix-a-typo-in-comment-convienence-convenience.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-sparse-fix-a-typo-in-comment-convienence-convenience.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Ethon Paul <[email protected]>
Subject: mm/sparse: fix a typo in comment "convienence"->"convenience"
There is a typo in comment, fix it.
---
mm/sparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/sparse.c renamed from mm/sparse.c~mm-sparse-fix-a-typo-in-comment-convienence-convenience +1 -1
@@ -288,7 +288,7 @@ void __init memory_present(int nid, unsi/* * Mark all memblocks as present using memory_present(). This is a -* convienence function that is useful for a number of arches +* convenience function that is useful for a number of arches * to mark all of the systems memory as present during initialization. */ void __init memblocks_present (void )
_
Patches currently in -mm which might be from [email protected] are
mm-memory_hotplug-fix-a-typo-in-comment-recoreded-recorded.patch mm-ksm-fix-a-typo-in-comment-alreaady-already.patch mm-ksm-fix-a-typo-in-comment-alreaady-already-v2.patch mm-mmap-fix-a-typo-in-comment-compatbility-compatibility.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2.patch mm-vmsan-fix-some-typos-in-comment.patch mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch mm-memblock-fix-a-typo-in-comment-implict-implicit.patch mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch mm-frontswap-fix-some-typos-in-frontswapc.patch mm-memcg-fix-some-typos-in-memcontrolc.patch mm-fix-a-typo-in-comment-strucure-structure.patch mm-slub-fix-a-typo-in-comment-disambiguiation-disambiguation.patch mm-sparse-fix-a-typo-in-comment-convienence-convenience.patch mm-page-writeback-fix-a-typo-in-comment-effictive-effective.patch mm-memory-fix-a-typo-in-comment-attampt-attempt.patch
+ mm-page-writeback-fix-a-typo-in-comment-effictive-effective.patch added to -mm tree
In reply to Andrew MortonThe patch titled
The patch titled
Subject: mm/page-writeback: fix a typo in comment "effictive"->"effective"
has been added to the -mm tree. Its filename is
mm-page-writeback-fix-a-typo-in-comment-effictive-effective.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-page-writeback-fix-a-typo-in-comment-effictive-effective.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-page-writeback-fix-a-typo-in-comment-effictive-effective.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Ethon Paul <[email protected]>
Subject: mm/page-writeback: fix a typo in comment "effictive"->"effective"
There is a typo in comment, fix it.
---
mm/page-writeback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page-writeback.c renamed from mm/page-writeback.c~mm-page-writeback-fix-a-typo-in-comment-effictive-effective +1 -1
@@ -257,7 +257,7 @@ static void wb_min_max_ratio(struct bdi_* requiring writeback. * * This number of dirtyable pages is the base value of which the -* user-configurable dirty ratio is the effictive number of pages that +* user-configurable dirty ratio is the effective number of pages that * are allowed to be actually dirtied. Per individual zone, or * globally by using the sum of dirtyable pages over all zones. *
_
Patches currently in -mm which might be from [email protected] are
mm-memory_hotplug-fix-a-typo-in-comment-recoreded-recorded.patch mm-ksm-fix-a-typo-in-comment-alreaady-already.patch mm-ksm-fix-a-typo-in-comment-alreaady-already-v2.patch mm-mmap-fix-a-typo-in-comment-compatbility-compatibility.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2.patch mm-vmsan-fix-some-typos-in-comment.patch mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch mm-memblock-fix-a-typo-in-comment-implict-implicit.patch mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch mm-frontswap-fix-some-typos-in-frontswapc.patch mm-memcg-fix-some-typos-in-memcontrolc.patch mm-fix-a-typo-in-comment-strucure-structure.patch mm-slub-fix-a-typo-in-comment-disambiguiation-disambiguation.patch mm-sparse-fix-a-typo-in-comment-convienence-convenience.patch mm-page-writeback-fix-a-typo-in-comment-effictive-effective.patch mm-memory-fix-a-typo-in-comment-attampt-attempt.patch
+ mm-memory-fix-a-typo-in-comment-attampt-attempt.patch added to -mm tree
In reply to Andrew MortonThe patch titled
The patch titled
Subject: mm/memory: fix a typo in comment "attampt"->"attempt"
has been added to the -mm tree. Its filename is
mm-memory-fix-a-typo-in-comment-attampt-attempt.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-memory-fix-a-typo-in-comment-attampt-attempt.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-memory-fix-a-typo-in-comment-attampt-attempt.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Ethon Paul <[email protected]>
Subject: mm/memory: fix a typo in comment "attampt"->"attempt"
There is a comment in typo, fix it.
---
mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory.c renamed from mm/memory.c~mm-memory-fix-a-typo-in-comment-attampt-attempt +1 -1
@@ -2469,7 +2469,7 @@ static inline bool cow_user_page(struct }/* -* The same page can be mapped back since last copy attampt. +* The same page can be mapped back since last copy attempt. * Try to copy again under PTL. */ if (__copy_from_user_inatomic (kaddr, uaddr,PAGE_SIZE )) {
_
Patches currently in -mm which might be from [email protected] are
mm-memory_hotplug-fix-a-typo-in-comment-recoreded-recorded.patch mm-ksm-fix-a-typo-in-comment-alreaady-already.patch mm-ksm-fix-a-typo-in-comment-alreaady-already-v2.patch mm-mmap-fix-a-typo-in-comment-compatbility-compatibility.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2.patch mm-vmsan-fix-some-typos-in-comment.patch mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch mm-memblock-fix-a-typo-in-comment-implict-implicit.patch mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch mm-frontswap-fix-some-typos-in-frontswapc.patch mm-memcg-fix-some-typos-in-memcontrolc.patch mm-fix-a-typo-in-comment-strucure-structure.patch mm-slub-fix-a-typo-in-comment-disambiguiation-disambiguation.patch mm-sparse-fix-a-typo-in-comment-convienence-convenience.patch mm-page-writeback-fix-a-typo-in-comment-effictive-effective.patch mm-memory-fix-a-typo-in-comment-attampt-attempt.patch
+ mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm: memblock: replace dereferences of memblock_region.nid with API calls has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm: memblock: replace dereferences of memblock_region.nid with API calls
has been added to the -mm tree. Its filename is
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: mm: memblock: replace dereferences of memblock_region.nid with API calls
Patch series "mm: rework free_area_init*() funcitons".
After the discussion [1] about removal of CONFIG_NODES_SPAN_OTHER_NODES and CONFIG_HAVE_MEMBLOCK_NODE_MAP options, I took it a bit further and updated the node/zone initialization.
Since all architectures have memblock, it is possible to use only the newer version of free_area_init_node() that calculates the zone and node boundaries based on memblock node mapping and architectural limits on possible zone PFNs.
The architectures that still determined zone and hole sizes can be switched to the generic code and the old code that took those zone and hole sizes can be simply removed.
And, since it all started from the removal of CONFIG_NODES_SPAN_OTHER_NODES, the memmap_init() is now updated to iterate over memblocks and so it does not need to perform early_pfn_to_nid() query for every PFN.
[1] https://lore.kernel.org/lkml/[email protected]
This patch (of 21):
There are several places in the code that directly dereference memblock_region.nid despite this field being defined only when CONFIG_HAVE_MEMBLOCK_NODE_MAP=y.
Replace these with calls to memblock_get_region_nid() to improve code robustness and to avoid possible breakage when CONFIG_HAVE_MEMBLOCK_NODE_MAP will be removed.
---
arch/arm64/mm/numa.c | 9 ++++++--- arch/x86/mm/numa.c | 6 ++++-- mm/memblock.c | 8 +++++--- mm/page_alloc.c | 4 ++-- 4 files changed, 17 insertions(+), 10 deletions(-)
arch/arm64/mm/numa.c renamed from arch/arm64/mm/numa.c~mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls +6 -3
@@ -350,13 +350,16 @@ static int __init numa_register_nodes(vostruct memblock_region *mblk;/* Check that valid nid is set to memblks */ -for_each_memblock (memory, mblk) -if (mblk->nid ==NUMA_NO_NODE || mblk->nid >=MAX_NUMNODES ) { +for_each_memblock (memory, mblk) { +int mblk_nid =memblock_get_region_node (mblk); + +if (mblk_nid ==NUMA_NO_NODE || mblk_nid >=MAX_NUMNODES ) {pr_warn ("Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n" , - mblk->nid, mblk->base, + mblk_nid, mblk->base, mblk->base + mblk->size -1 );return -EINVAL ; } + }/* Finally register nodes. */ for_each_node_mask (nid, numa_nodes_parsed) {
arch/x86/mm/numa.c renamed from arch/x86/mm/numa.c~mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls +4 -2
@@ -517,8 +517,10 @@ static void __init numa_clear_kernel_nod* reserve specific pages for Sandy Bridge graphics. ] */ for_each_memblock (reserved, mb_region) { -if (mb_region->nid !=MAX_NUMNODES ) -node_set (mb_region->nid, reserved_nodemask); +int nid =memblock_get_region_node (mb_region); + +if (nid !=MAX_NUMNODES ) +node_set (nid, reserved_nodemask); }/*
mm/memblock.c renamed from mm/memblock.c~mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls +5 -3
@@ -1207,13 +1207,15 @@ void __init_memblock __next_mem_pfn_rang {struct memblock_type *type = &memblock.memory;struct memblock_region *r; +int r_nid;while (++*idx < type->cnt) { r = &type->regions[*idx]; + r_nid =memblock_get_region_node (r);if (PFN_UP (r->base) >=PFN_DOWN (r->base + r->size))continue ; -if (nid ==MAX_NUMNODES || nid == r->nid) +if (nid ==MAX_NUMNODES || nid == r_nid)break ; }if (*idx >= type->cnt) {
@@ -1226,7 +1228,7 @@ void __init_memblock __next_mem_pfn_rangif (out_end_pfn) *out_end_pfn =PFN_DOWN (r->base + r->size);if (out_nid) - *out_nid = r->nid; + *out_nid = r_nid; }/**
@@ -1810,7 +1812,7 @@ int __init_memblock memblock_search_pfn_ *start_pfn =PFN_DOWN (type->regions[mid].base); *end_pfn =PFN_DOWN (type->regions[mid].base + type->regions[mid].size); - return type->regions[mid].nid; + return memblock_get_region_node(&type->regions[mid]); }#endif
mm/page_alloc.c renamed from mm/page_alloc.c~mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls +2 -2
@@ -7208,7 +7208,7 @@ static void __init find_zone_movable_pfnif (!memblock_is_hotpluggable (r))continue ; - nid = r->nid; + nid =memblock_get_region_node (r); usable_startpfn =PFN_DOWN (r->base); zone_movable_pfn[nid] = zone_movable_pfn[nid] ?
@@ -7229,7 +7229,7 @@ static void __init find_zone_movable_pfnif (memblock_is_mirror (r))continue ; - nid = r->nid; + nid =memblock_get_region_node (r); usable_startpfn =memblock_region_memory_base_pfn (r);
_
Patches currently in -mm which might be from [email protected] are
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm: make early_pfn_to_nid() and related defintions close to each other has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm: make early_pfn_to_nid() and related defintions close to each other
has been added to the -mm tree. Its filename is
mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: mm: make early_pfn_to_nid() and related defintions close to each other
early_pfn_to_nid() and its helper __early_pfn_to_nid() are spread around include/linux/mm.h, include/linux/mmzone.h and mm/page_alloc.c.
Drop unused stub for __early_pfn_to_nid() and move its actual generic implementation close to its users.
---
include/linux/mm.h | 4 +-- include/linux/mmzone.h | 9 ------ mm/page_alloc.c | 51 +++++++++++++++++++-------------------- 3 files changed, 27 insertions(+), 37 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other +2 -2
@@ -2388,9 +2388,9 @@ extern void sparse_memory_present_with_a#if !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP ) && \ !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID ) -static inline int __early_pfn_to_nid (unsigned long pfn, -struct mminit_pfnnid_cache *state) +static inline int early_pfn_to_nid (unsigned long pfn) { +BUILD_BUG_ON (IS_ENABLED (CONFIG_NUMA ));return 0 ; }#else
include/linux/mmzone.h renamed from include/linux/mmzone.h~mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other +0 -9
@@ -1078,15 +1078,6 @@ static inline struct zoneref *first_zone#include <asm/sparsemem.h> #endif -#if !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID ) && \ - !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP ) -static inline unsigned long early_pfn_to_nid (unsigned long pfn) -{ -BUILD_BUG_ON (IS_ENABLED (CONFIG_NUMA )); -return 0 ; -} -#endif -#ifdef CONFIG_FLATMEM #define pfn_to_nid (pfn) (0)#endif
mm/page_alloc.c renamed from mm/page_alloc.c~mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other +25 -25
59 lines not on this page · raw message
+ mm-remove-config_have_memblock_node_map-option.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP option has been added to the -mm tree. Its filename is mm-remove-config_have_memblock_node_map-option.patch
The patch titled
Subject: mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP option
has been added to the -mm tree. Its filename is
mm-remove-config_have_memblock_node_map-option.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-remove-config_have_memblock_node_map-option.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-remove-config_have_memblock_node_map-option.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP option
CONFIG_HAVE_MEMBLOCK_NODE_MAP is used to differentiate initialization of nodes and zones structures between the systems that have region to node mapping in memblock and those that don't.
Currently all the NUMA architectures enable this option and for the non-NUMA systems we can presume that all the memory belongs to node 0 and therefore the compile time configuration option is not required.
The remaining few architectures that use DISCONTIGMEM without NUMA are easily updated to use memblock_add_node() instead of memblock_add() and thus have proper correspondence of memblock regions to NUMA nodes.
Still, free_area_init_node() must have a backward compatible version because its semantics with and without CONFIG_HAVE_MEMBLOCK_NODE_MAP is different. Once all the architectures will use the new semantics, the entire compatibility layer can be dropped.
To avoid addition of extra run time memory to store node id for architectures that keep memblock but have only a single node, the node id field of the memblock_region is guarded by CONFIG_NEED_MULTIPLE_NODES and the corresponding accessors presume that in those cases it is always 0.
---
Documentation/features/vm/numa-memblock/arch-support.txt | 34 --- arch/alpha/mm/numa.c | 4 arch/arm64/Kconfig | 1 arch/ia64/Kconfig | 1 arch/m68k/mm/motorola.c | 4 arch/microblaze/Kconfig | 1 arch/mips/Kconfig | 1 arch/powerpc/Kconfig | 1 arch/riscv/Kconfig | 1 arch/s390/Kconfig | 1 arch/sh/Kconfig | 1 arch/sparc/Kconfig | 1 arch/x86/Kconfig | 1 include/linux/memblock.h | 8 include/linux/mm.h | 12 - include/linux/mmzone.h | 2 mm/Kconfig | 3 mm/memblock.c | 11 - mm/memory_hotplug.c | 4 mm/page_alloc.c | 101 +++++----- 20 files changed, 74 insertions(+), 119 deletions(-)
arch/alpha/mm/numa.c renamed from arch/alpha/mm/numa.c~mm-remove-config_have_memblock_node_map-option +2 -2
@@ -144,8 +144,8 @@ setup_memory_node(int nid, void *kernel_if (!nid && (node_max_pfn < end_kernel_pfn || node_min_pfn > start_kernel_pfn))panic ("kernel loaded out of ram" ); -memblock_add (PFN_PHYS (node_min_pfn), - (node_max_pfn - node_min_pfn) <<PAGE_SHIFT ); +memblock_add_node (PFN_PHYS (node_min_pfn), + (node_max_pfn - node_min_pfn) <<PAGE_SHIFT , nid);/* Zone start phys-addr must be 2^(MAX_ORDER-1) aligned. Note that we round this down, not up - node memory
arch/arm64/Kconfig renamed from arch/arm64/Kconfig~mm-remove-config_have_memblock_node_map-option +0 -1
@@ -157,7 +157,6 @@ config ARM64 select HAVE_GCC_PLUGINS select HAVE_HW_BREAKPOINT if PERF_EVENTS select HAVE_IRQ_TIME_ACCOUNTING - select HAVE_MEMBLOCK_NODE_MAP if NUMA select HAVE_NMI select HAVE_PATA_PLATFORM select HAVE_PERF_EVENTS
arch/ia64/Kconfig renamed from arch/ia64/Kconfig~mm-remove-config_have_memblock_node_map-option +0 -1
@@ -31,7 +31,6 @@ config IA64 select HAVE_FUNCTION_TRACER select TTY select HAVE_ARCH_TRACEHOOK - select HAVE_MEMBLOCK_NODE_MAP select HAVE_VIRT_CPU_ACCOUNTING select DMA_NONCOHERENT_MMAP select ARCH_HAS_SYNC_DMA_FOR_CPU
arch/m68k/mm/motorola.c renamed from arch/m68k/mm/motorola.c~mm-remove-config_have_memblock_node_map-option +2 -2
@@ -386,7 +386,7 @@ void __init paging_init(void) min_addr = m68k_memory[0 ].addr; max_addr = min_addr + m68k_memory[0 ].size; -memblock_add (m68k_memory[0 ].addr, m68k_memory[0 ].size); +memblock_add_node (m68k_memory[0 ].addr, m68k_memory[0 ].size,0 );for (i =1 ; i < m68k_num_memory;) {if (m68k_memory[i].addr < min_addr) { printk("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n",
@@ -397,7 +397,7 @@ void __init paging_init(void) (m68k_num_memory - i) * sizeof(struct m68k_mem_info));continue ; } -memblock_add (m68k_memory[i].addr, m68k_memory[i].size); +memblock_add_node (m68k_memory[i].addr, m68k_memory[i].size, i); addr = m68k_memory[i].addr + m68k_memory[i].size;if (addr > max_addr) max_addr = addr;
arch/microblaze/Kconfig renamed from arch/microblaze/Kconfig~mm-remove-config_have_memblock_node_map-option +0 -1
@@ -32,7 +32,6 @@ config MICROBLAZE select HAVE_FTRACE_MCOUNT_RECORD select HAVE_FUNCTION_GRAPH_TRACER select HAVE_FUNCTION_TRACER - select HAVE_MEMBLOCK_NODE_MAP select HAVE_OPROFILE select HAVE_PCI select IRQ_DOMAIN
arch/mips/Kconfig renamed from arch/mips/Kconfig~mm-remove-config_have_memblock_node_map-option +0 -1
@@ -72,7 +72,6 @@ config MIPS select HAVE_KPROBES select HAVE_KRETPROBES select HAVE_LD_DEAD_CODE_DATA_ELIMINATION - select HAVE_MEMBLOCK_NODE_MAP select HAVE_MOD_ARCH_SPECIFIC select HAVE_NMI select HAVE_OPROFILE
arch/powerpc/Kconfig renamed from arch/powerpc/Kconfig~mm-remove-config_have_memblock_node_map-option +0 -1
@@ -211,7 +211,6 @@ config PPC select HAVE_KRETPROBES select HAVE_LD_DEAD_CODE_DATA_ELIMINATION select HAVE_LIVEPATCH if HAVE_DYNAMIC_FTRACE_WITH_REGS - select HAVE_MEMBLOCK_NODE_MAP select HAVE_MOD_ARCH_SPECIFIC select HAVE_NMI if PERF_EVENTS || (PPC64 && PPC_BOOK3S) select HAVE_HARDLOCKUP_DETECTOR_ARCH if (PPC64 && PPC_BOOK3S)
arch/riscv/Kconfig renamed from arch/riscv/Kconfig~mm-remove-config_have_memblock_node_map-option +0 -1
@@ -32,7 +32,6 @@ config RISCV select HAVE_ARCH_AUDITSYSCALL select HAVE_ARCH_SECCOMP_FILTER select HAVE_ASM_MODVERSIONS - select HAVE_MEMBLOCK_NODE_MAP select HAVE_DMA_CONTIGUOUS if MMU select HAVE_FUTEX_CMPXCHG if FUTEX select HAVE_PERF_EVENTS
arch/s390/Kconfig renamed from arch/s390/Kconfig~mm-remove-config_have_memblock_node_map-option +0 -1
@@ -163,7 +163,6 @@ config S390 select HAVE_LIVEPATCH select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP - select HAVE_MEMBLOCK_NODE_MAP select HAVE_MEMBLOCK_PHYS_MAP select MMU_GATHER_NO_GATHER select HAVE_MOD_ARCH_SPECIFIC
arch/sh/Kconfig renamed from arch/sh/Kconfig~mm-remove-config_have_memblock_node_map-option +0 -1
@@ -9,7 +9,6 @@ config SUPERH select CLKDEV_LOOKUP select DMA_DECLARE_COHERENT select HAVE_IDE if HAS_IOPORT_MAP - select HAVE_MEMBLOCK_NODE_MAP select HAVE_OPROFILE select HAVE_ARCH_TRACEHOOK select HAVE_PERF_EVENTS
arch/sparc/Kconfig renamed from arch/sparc/Kconfig~mm-remove-config_have_memblock_node_map-option +0 -1
@@ -65,7 +65,6 @@ config SPARC64 select HAVE_KRETPROBES select HAVE_KPROBES select MMU_GATHER_RCU_TABLE_FREE if SMP - select HAVE_MEMBLOCK_NODE_MAP select HAVE_ARCH_TRANSPARENT_HUGEPAGE select HAVE_DYNAMIC_FTRACE select HAVE_FTRACE_MCOUNT_RECORD
arch/x86/Kconfig renamed from arch/x86/Kconfig~mm-remove-config_have_memblock_node_map-option +0 -1
@@ -191,7 +191,6 @@ config X86 select HAVE_KRETPROBES select HAVE_KVM select HAVE_LIVEPATCH if X86_64 - select HAVE_MEMBLOCK_NODE_MAP select HAVE_MIXED_BREAKPOINTS_REGS select HAVE_MOD_ARCH_SPECIFIC select HAVE_MOVE_PMD
Documentation/features/vm/numa-memblock/arch-support.txt deleted +0 -34
@@ -1,34 +0,0 @@ -# -# Feature name: numa-memblock -# Kconfig: HAVE_MEMBLOCK_NODE_MAP -# description: arch supports NUMA aware memblocks -# - ----------------------- - | arch |status| - ----------------------- - | alpha: | TODO | - | arc: | .. | - | arm: | .. | - | arm64: | ok | - | c6x: | .. | - | csky: | .. | - | h8300: | .. | - | hexagon: | .. | - | ia64: | ok | - | m68k: | .. | - | microblaze: | ok | - | mips: | ok | - | nds32: | TODO | - | nios2: | .. | - | openrisc: | .. | - | parisc: | .. | - | powerpc: | ok | - | riscv: | ok | - | s390: | ok | - | sh: | ok | - | sparc: | ok | - | um: | .. | - | unicore32: | .. | - | x86: | ok | - | xtensa: | .. | - -----------------------
include/linux/memblock.h renamed from include/linux/memblock.h~mm-remove-config_have_memblock_node_map-option +3 -5
@@ -50,7 +50,7 @@ struct memblock_region {phys_addr_t base;phys_addr_t size;enum memblock_flags flags; -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP +#ifdef CONFIG_NEED_MULTIPLE_NODES int nid;#endif };
@@ -215,7 +215,6 @@ static inline bool memblock_is_nomap(strreturn m->flags &MEMBLOCK_NOMAP ; } -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP int memblock_search_pfn_nid (unsigned long pfn,unsigned long *start_pfn,unsigned long *end_pfn); void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
@@ -234,7 +233,6 @@ void __next_mem_pfn_range(int *idx, int#define for_each_mem_pfn_range (i, nid, p_start, p_end, p_nid) \ for (i = -1, __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid); \ i >= 0; __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid)) -#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT void __next_mem_pfn_range_in_zone(u64 *idx, struct zone *zone,
@@ -310,10 +308,10 @@ void __next_mem_pfn_range_in_zone(u64 *ifor_each_mem_range_rev (i, &memblock.memory, &memblock.reserved, \ nid, flags, p_start, p_end, p_nid) -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP int memblock_set_node (phys_addr_t base,phys_addr_t size,struct memblock_type *type,int nid); +#ifdef CONFIG_NEED_MULTIPLE_NODES static inline void memblock_set_region_node (struct memblock_region *r,int nid) { r->nid = nid;
@@ -332,7 +330,7 @@ static inline int memblock_get_region_no {return 0 ; } -#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ +#endif /* CONFIG_NEED_MULTIPLE_NODES */ /* Flags for memblock allocation APIs */ #define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0)
include/linux/mm.h renamed from include/linux/mm.h~mm-remove-config_have_memblock_node_map-option +2 -10
@@ -2344,9 +2344,8 @@ static inline unsigned long get_num_physreturn phys_pages; } -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP /* -* With CONFIG_HAVE_MEMBLOCK_NODE_MAP set, an architecture may initialise its +* Using memblock node mappings, an architecture may initialise its * zones, allocate the backing mem_map and account for memory holes in a more * architecture independent manner. This is a substitute for creating the * zone_sizes[] and zholes_size[] arrays and passing them to
@@ -2367,9 +2366,6 @@ static inline unsigned long get_num_phys* registered physical page range. Similarly * sparse_memory_present_with_active_regions() calls memory_present() for * each range when SPARSEMEM is enabled. -* -* See mm/page_alloc.c for more information on each function exposed by -* CONFIG_HAVE_MEMBLOCK_NODE_MAP. */ extern void free_area_init_nodes (unsigned long *max_zone_pfn);unsigned long node_map_pfn_alignment (void );
@@ -2384,13 +2380,9 @@ extern void free_bootmem_with_active_reg unsigned long max_low_pfn);extern void sparse_memory_present_with_active_regions (int nid); -#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ - -#if !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP ) && \ - !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID ) +#ifndef CONFIG_NEED_MULTIPLE_NODES static inline int early_pfn_to_nid (unsigned long pfn) { -BUILD_BUG_ON (IS_ENABLED (CONFIG_NUMA ));return 0 ; }#else
include/linux/mmzone.h renamed from include/linux/mmzone.h~mm-remove-config_have_memblock_node_map-option +1 -1
@@ -874,7 +874,7 @@ extern int movable_zone;#ifdef CONFIG_HIGHMEM static inline int zone_movable_is_highmem (void ) { -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP +#ifdef CONFIG_NEED_MULTIPLE_NODES return movable_zone ==ZONE_HIGHMEM ;#else return (ZONE_MOVABLE -1 ) ==ZONE_HIGHMEM ;
mm/Kconfig renamed from mm/Kconfig~mm-remove-config_have_memblock_node_map-option +0 -3
@@ -126,9 +126,6 @@ config SPARSEMEM_VMEMMAP pfn_to_page and page_to_pfn operations. This is the most efficient option when sufficient kernel resources are available. -config HAVE_MEMBLOCK_NODE_MAP - bool - config HAVE_MEMBLOCK_PHYS_MAP bool
mm/memblock.c renamed from mm/memblock.c~mm-remove-config_have_memblock_node_map-option +5 -6
@@ -620,7 +620,7 @@ repeat:* area, insert that portion. */ if (rbase > base) { -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP +#ifdef CONFIG_NEED_MULTIPLE_NODES WARN_ON (nid !=memblock_get_region_node (rgn));#endif WARN_ON (flags != rgn->flags);
@@ -1197,7 +1197,6 @@ void __init_memblock __next_mem_range_re *idx =ULLONG_MAX ; } -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP /* * Common iterator interface used to define for_each_mem_pfn_range(). */
@@ -1247,6 +1246,7 @@ void __init_memblock __next_mem_pfn_rang int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size,struct memblock_type *type,int nid) { +#ifdef CONFIG_NEED_MULTIPLE_NODES int start_rgn, end_rgn;int i, ret;
@@ -1258,9 +1258,10 @@ int __init_memblock memblock_set_node(phmemblock_set_region_node (&type->regions[i], nid);memblock_merge_regions (type); +#endif return 0 ; } -#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ +#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT /** * __next_mem_pfn_range_in_zone - iterator for for_each_*_range_in_zone()
@@ -1799,7 +1800,6 @@ bool __init_memblock memblock_is_map_memreturn !memblock_is_nomap (&memblock.memory.regions[i]); } -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP int __init_memblock memblock_search_pfn_nid(unsigned long pfn,unsigned long *start_pfn,unsigned long *end_pfn) {
@@ -1814,7 +1814,6 @@ int __init_memblock memblock_search_pfn_return memblock_get_region_node (&type->regions[mid]); } -#endif /** * memblock_is_region_memory - check if a region is a subset of memory
@@ -1905,7 +1904,7 @@ static void __init_memblock memblock_dum size = rgn->size; end = base + size -1 ; flags = rgn->flags; -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP +#ifdef CONFIG_NEED_MULTIPLE_NODES if (memblock_get_region_node (rgn) !=MAX_NUMNODES )snprintf (nid_buf,sizeof (nid_buf)," on node %d" ,memblock_get_region_node (rgn));
mm/memory_hotplug.c renamed from mm/memory_hotplug.c~mm-remove-config_have_memblock_node_map-option +0 -4
@@ -1372,11 +1372,7 @@ check_pages_isolated_cb(unsigned long ststatic int __init cmdline_parse_movable_node (char *p) { -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP movable_node_enabled = true; -#else -pr_warn ("movable_node parameter depends on CONFIG_HAVE_MEMBLOCK_NODE_MAP to work properly\n" ); -#endif return 0 ; }early_param ("movable_node" , cmdline_parse_movable_node);
mm/page_alloc.c renamed from mm/page_alloc.c~mm-remove-config_have_memblock_node_map-option +59 -41
208 lines not on this page · raw message
+ mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm: free_area_init: use maximal zone PFNs rather than zone sizes has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm: free_area_init: use maximal zone PFNs rather than zone sizes
has been added to the -mm tree. Its filename is
mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: mm: free_area_init: use maximal zone PFNs rather than zone sizes
Currently, architectures that use free_area_init() to initialize memory map and node and zone structures need to calculate zone and hole sizes. We can use free_area_init_nodes() instead and let it detect the zone boundaries while the architectures will only have to supply the possible limits for the zones.
---
arch/alpha/mm/init.c | 16 ++++++---------- arch/c6x/mm/init.c | 8 +++----- arch/h8300/mm/init.c | 6 +++--- arch/hexagon/mm/init.c | 6 +++--- arch/m68k/mm/init.c | 6 +++--- arch/m68k/mm/mcfmmu.c | 9 +++------ arch/nds32/mm/init.c | 11 ++++------- arch/nios2/mm/init.c | 8 +++----- arch/openrisc/mm/init.c | 9 +++------ arch/um/kernel/mem.c | 12 ++++-------- include/linux/mm.h | 2 +- mm/page_alloc.c | 5 ++--- 12 files changed, 38 insertions(+), 60 deletions(-)
arch/alpha/mm/init.c renamed from arch/alpha/mm/init.c~mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes +6 -10
@@ -243,21 +243,17 @@ callback_init(void * kernel_end)*/ void __init paging_init (void ) { -unsigned long zones_size[MAX_NR_ZONES ] = {0 , }; -unsigned long dma_pfn, high_pfn; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 , }; +unsigned long dma_pfn; dma_pfn =virt_to_phys ((char *)MAX_DMA_ADDRESS ) >>PAGE_SHIFT ; - high_pfn = max_pfn = max_low_pfn; + max_pfn = max_low_pfn; -if (dma_pfn >= high_pfn) - zones_size[ZONE_DMA ] = high_pfn; -else { - zones_size[ZONE_DMA ] = dma_pfn; - zones_size[ZONE_NORMAL ] = high_pfn - dma_pfn; - } + max_zone_pfn[ZONE_DMA ] = dma_pfn; + max_zone_pfn[ZONE_NORMAL ] = max_pfn;/* Initialize mem_map[]. */ -free_area_init (zones_size); +free_area_init (max_zone_pfn);/* Initialize the kernel's ZERO_PGE. */ memset ((void *)ZERO_PGE ,0 ,PAGE_SIZE );
arch/c6x/mm/init.c renamed from arch/c6x/mm/init.c~mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes +3 -5
@@ -33,7 +33,7 @@ EXPORT_SYMBOL(empty_zero_page);void __init paging_init (void ) {struct pglist_data *pgdat =NODE_DATA (0 ); -unsigned long zones_size[MAX_NR_ZONES ] = {0 , }; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 , }; empty_zero_page = (unsigned long )memblock_alloc (PAGE_SIZE ,PAGE_SIZE );
@@ -49,11 +49,9 @@ void __init paging_init(void)/* * Define zones */ - zones_size[ZONE_NORMAL ] = (memory_end -PAGE_OFFSET ) >>PAGE_SHIFT ; - pgdat->node_zones[ZONE_NORMAL ].zone_start_pfn = -__pa (PAGE_OFFSET ) >>PAGE_SHIFT ; + max_zone_pfn[ZONE_NORMAL ] = memory_end >>PAGE_SHIFT ; -free_area_init (zones_size); +free_area_init (max_zone_pfn); }void __init mem_init (void )
arch/h8300/mm/init.c renamed from arch/h8300/mm/init.c~mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes +3 -3
@@ -83,10 +83,10 @@ void __init paging_init(void) start_mem, end_mem); { -unsigned long zones_size[MAX_NR_ZONES ] = {0 , }; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 , }; - zones_size[ZONE_NORMAL ] = (end_mem -PAGE_OFFSET ) >>PAGE_SHIFT ; -free_area_init (zones_size); + max_zone_pfn[ZONE_NORMAL ] = end_mem >>PAGE_SHIFT ; +free_area_init (max_zone_pfn); } }
arch/hexagon/mm/init.c renamed from arch/hexagon/mm/init.c~mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes +3 -3
@@ -91,7 +91,7 @@ void sync_icache_dcache(pte_t pte)*/ void __init paging_init (void ) { -unsigned long zones_sizes[MAX_NR_ZONES ] = {0 , }; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 , };/* * This is not particularly well documented anywhere, but
@@ -101,9 +101,9 @@ void __init paging_init(void)* adjust accordingly. */ - zones_sizes[ZONE_NORMAL ] = max_low_pfn; + max_zone_pfn[ZONE_NORMAL ] = max_low_pfn; -free_area_init (zones_sizes);/* sets up the zonelists and mem_map */ +free_area_init (max_zone_pfn);/* sets up the zonelists and mem_map */ /* * Start of high memory area. Will probably need something more
arch/m68k/mm/init.c renamed from arch/m68k/mm/init.c~mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes +3 -3
@@ -84,7 +84,7 @@ void __init paging_init(void)* page_alloc get different views of the world. */ unsigned long end_mem = memory_end &PAGE_MASK ; -unsigned long zones_size[MAX_NR_ZONES ] = {0 , }; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 , }; high_memory = (void *) end_mem;
@@ -98,8 +98,8 @@ void __init paging_init(void)*/ set_fs (USER_DS ); - zones_size[ZONE_DMA ] = (end_mem -PAGE_OFFSET ) >>PAGE_SHIFT ; - free_area_init(zones_size); + max_zone_pfn[ZONE_DMA ] = end_mem >>PAGE_SHIFT ; + free_area_init(max_zone_pfn); }#endif /* CONFIG_MMU */
arch/m68k/mm/mcfmmu.c renamed from arch/m68k/mm/mcfmmu.c~mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes +3 -6
@@ -39,7 +39,7 @@ void __init paging_init(void)pte_t *pg_table;unsigned long address, size;unsigned long next_pgtable, bootmem_end; -unsigned long zones_size[MAX_NR_ZONES ]; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 };enum zone_type zone;int i;
@@ -80,11 +80,8 @@ void __init paging_init(void) } current->mm =NULL ; - -for (zone =0 ; zone <MAX_NR_ZONES ; zone++) - zones_size[zone] =0x0 ; - zones_size[ZONE_DMA ] = num_pages; -free_area_init (zones_size); + max_zone_pfn[ZONE_DMA ] =PFN_DOWN (_ramend); +free_area_init (max_zone_pfn); }int cf_tlb_miss (struct pt_regs *regs,int write,int dtlb,int extension_word)
arch/nds32/mm/init.c renamed from arch/nds32/mm/init.c~mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes +4 -7
@@ -31,16 +31,13 @@ EXPORT_SYMBOL(empty_zero_page);static void __init zone_sizes_init (void ) { -unsigned long zones_size[MAX_NR_ZONES ]; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 }; -/* Clear the zone sizes */ -memset (zones_size,0 ,sizeof (zones_size)); - - zones_size[ZONE_NORMAL ] = max_low_pfn; + max_zone_pfn[ZONE_NORMAL ] = max_low_pfn;#ifdef CONFIG_HIGHMEM - zones_size[ZONE_HIGHMEM ] = max_pfn; + max_zone_pfn[ZONE_HIGHMEM ] = max_pfn;#endif -free_area_init (zones_size); +free_area_init (max_zone_pfn); }
arch/nios2/mm/init.c renamed from arch/nios2/mm/init.c~mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes +3 -5
@@ -46,17 +46,15 @@ pgd_t *pgd_current;*/ void __init paging_init (void ) { -unsigned long zones_size[MAX_NR_ZONES ]; - -memset (zones_size,0 ,sizeof (zones_size)); +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 };pagetable_init (); pgd_current = swapper_pg_dir; - zones_size[ZONE_NORMAL ] = max_mapnr; + max_zone_pfn[ZONE_NORMAL ] = max_mapnr;/* pass the memory from the bootmem allocator to the main allocator */ -free_area_init (zones_size); +free_area_init (max_zone_pfn);flush_dcache_range ((unsigned long )empty_zero_page, (unsigned long )empty_zero_page +PAGE_SIZE );
arch/openrisc/mm/init.c renamed from arch/openrisc/mm/init.c~mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes +3 -6
@@ -45,17 +45,14 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gastatic void __init zone_sizes_init (void ) { -unsigned long zones_size[MAX_NR_ZONES ]; - -/* Clear the zone sizes */ -memset (zones_size,0 ,sizeof (zones_size)); +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 };/* * We use only ZONE_NORMAL */ - zones_size[ZONE_NORMAL ] = max_low_pfn; + max_zone_pfn[ZONE_NORMAL ] = max_low_pfn; -free_area_init (zones_size); +free_area_init (max_zone_pfn); }extern const char _s_kernel_ro[], _e_kernel_ro[];
arch/um/kernel/mem.c renamed from arch/um/kernel/mem.c~mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes +4 -8
@@ -158,8 +158,8 @@ static void __init fixaddr_user_init( vovoid __init paging_init (void ) { -unsigned long zones_size[MAX_NR_ZONES ], vaddr; -int i; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 }; +unsigned long vaddr; empty_zero_page = (unsigned long *)memblock_alloc_low (PAGE_SIZE ,PAGE_SIZE );
@@ -167,12 +167,8 @@ void __init paging_init(void)panic ("%s: Failed to allocate %lu bytes align=%lx\n" , __func__,PAGE_SIZE ,PAGE_SIZE ); -for (i =0 ; i <ARRAY_SIZE (zones_size); i++) - zones_size[i] =0 ; - - zones_size[ZONE_NORMAL ] = (end_iomem >>PAGE_SHIFT ) - - (uml_physmem >>PAGE_SHIFT ); -free_area_init (zones_size); + max_zone_pfn[ZONE_NORMAL ] = end_iomem >>PAGE_SHIFT ; +free_area_init (max_zone_pfn);/* * Fixed mappings, only the page table structure has to be
include/linux/mm.h renamed from include/linux/mm.h~mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes +1 -1
@@ -2272,7 +2272,7 @@ static inline spinlock_t *pud_lock(struc }extern void __init pagecache_init (void ); -extern void free_area_init (unsigned long * zones_size); +extern void free_area_init (unsigned long * max_zone_pfn);extern void __init free_area_init_node (int nid,unsigned long * zones_size,unsigned long zone_start_pfn,unsigned long *zholes_size);extern void free_initmem (void );
mm/page_alloc.c renamed from mm/page_alloc.c~mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes +2 -3
@@ -7700,11 +7700,10 @@ void __init set_dma_reserve(unsigned lon dma_reserve = new_dma_reserve; } -void __init free_area_init (unsigned long *zones_size) +void __init free_area_init (unsigned long *max_zone_pfn) {init_unavailable_mem (); -free_area_init_node (0 , zones_size, -__pa (PAGE_OFFSET ) >>PAGE_SHIFT ,NULL ); +free_area_init_nodes (max_zone_pfn); }static int page_alloc_cpu_dead (unsigned int cpu)
_
Patches currently in -mm which might be from [email protected] are
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ mm-use-free_area_init-instead-of-free_area_init_nodes.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm: use free_area_init() instead of free_area_init_nodes() has been added to the -mm tree. Its filename is mm-use-free_area_init-instead-of-free_area_init_nodes.patch
The patch titled
Subject: mm: use free_area_init() instead of free_area_init_nodes()
has been added to the -mm tree. Its filename is
mm-use-free_area_init-instead-of-free_area_init_nodes.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-use-free_area_init-instead-of-free_area_init_nodes.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-use-free_area_init-instead-of-free_area_init_nodes.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: mm: use free_area_init() instead of free_area_init_nodes()
free_area_init() has effectively became a wrapper for free_area_init_nodes() and there is no point of keeping it. Still free_area_init() name is shorter and more general as it does not imply necessity to initialize multiple nodes.
Rename free_area_init_nodes() to free_area_init(), update the callers and drop old version of free_area_init().
---
arch/arm64/mm/init.c | 2 +- arch/ia64/mm/contig.c | 2 +- arch/ia64/mm/discontig.c | 2 +- arch/microblaze/mm/init.c | 2 +- arch/mips/loongson64/numa.c | 2 +- arch/mips/mm/init.c | 2 +- arch/mips/sgi-ip27/ip27-memory.c | 2 +- arch/powerpc/mm/mem.c | 2 +- arch/riscv/mm/init.c | 2 +- arch/s390/mm/init.c | 2 +- arch/sh/mm/init.c | 2 +- arch/sparc/mm/init_64.c | 2 +- arch/x86/mm/init.c | 2 +- include/linux/mm.h | 7 +++---- mm/page_alloc.c | 10 ++-------- 15 files changed, 18 insertions(+), 25 deletions(-)
arch/arm64/mm/init.c renamed from arch/arm64/mm/init.c~mm-use-free_area_init-instead-of-free_area_init_nodes +1 -1
@@ -206,7 +206,7 @@ static void __init zone_sizes_init(unsig#endif max_zone_pfns[ZONE_NORMAL ] = max; -free_area_init_nodes (max_zone_pfns); +free_area_init (max_zone_pfns); }#else
arch/ia64/mm/contig.c renamed from arch/ia64/mm/contig.c~mm-use-free_area_init-instead-of-free_area_init_nodes +1 -1
@@ -210,6 +210,6 @@ paging_init (void) printk("Virtual mem_map starts at 0x%p\n", mem_map); }#endif /* !CONFIG_VIRTUAL_MEM_MAP */ -free_area_init_nodes (max_zone_pfns); +free_area_init (max_zone_pfns); zero_page_memmap_ptr =virt_to_page (ia64_imva (empty_zero_page)); }
arch/ia64/mm/discontig.c renamed from arch/ia64/mm/discontig.c~mm-use-free_area_init-instead-of-free_area_init_nodes +1 -1
@@ -627,7 +627,7 @@ void __init paging_init(void) max_zone_pfns[ZONE_DMA32 ] = max_dma;#endif max_zone_pfns[ZONE_NORMAL ] = max_pfn; -free_area_init_nodes (max_zone_pfns); +free_area_init (max_zone_pfns); zero_page_memmap_ptr =virt_to_page (ia64_imva (empty_zero_page)); }
arch/microblaze/mm/init.c renamed from arch/microblaze/mm/init.c~mm-use-free_area_init-instead-of-free_area_init_nodes +1 -1
@@ -112,7 +112,7 @@ static void __init paging_init(void)#endif /* We don't have holes in memory map */ -free_area_init_nodes (zones_size); +free_area_init (zones_size); }void __init setup_memory (void )
arch/mips/loongson64/numa.c renamed from arch/mips/loongson64/numa.c~mm-use-free_area_init-instead-of-free_area_init_nodes +1 -1
@@ -247,7 +247,7 @@ void __init paging_init(void) zones_size[ZONE_DMA32 ] =MAX_DMA32_PFN ;#endif zones_size[ZONE_NORMAL ] = max_low_pfn; -free_area_init_nodes (zones_size); +free_area_init (zones_size); }void __init mem_init (void )
arch/mips/mm/init.c renamed from arch/mips/mm/init.c~mm-use-free_area_init-instead-of-free_area_init_nodes +1 -1
@@ -418,7 +418,7 @@ void __init paging_init(void) }#endif -free_area_init_nodes (max_zone_pfns); +free_area_init (max_zone_pfns); }#ifdef CONFIG_64BIT
arch/mips/sgi-ip27/ip27-memory.c renamed from arch/mips/sgi-ip27/ip27-memory.c~mm-use-free_area_init-instead-of-free_area_init_nodes +1 -1
@@ -419,7 +419,7 @@ void __init paging_init(void)pagetable_init (); zones_size[ZONE_NORMAL ] = max_low_pfn; -free_area_init_nodes (zones_size); +free_area_init (zones_size); }void __init mem_init (void )
arch/powerpc/mm/mem.c renamed from arch/powerpc/mm/mem.c~mm-use-free_area_init-instead-of-free_area_init_nodes +1 -1
@@ -271,7 +271,7 @@ void __init paging_init(void) max_zone_pfns[ZONE_HIGHMEM ] = max_pfn;#endif -free_area_init_nodes (max_zone_pfns); +free_area_init (max_zone_pfns);mark_nonram_nosave (); }
arch/riscv/mm/init.c renamed from arch/riscv/mm/init.c~mm-use-free_area_init-instead-of-free_area_init_nodes +1 -1
@@ -39,7 +39,7 @@ static void __init zone_sizes_init(void)#endif max_zone_pfns[ZONE_NORMAL ] = max_low_pfn; -free_area_init_nodes (max_zone_pfns); +free_area_init (max_zone_pfns); }static void setup_zero_page (void )
arch/s390/mm/init.c renamed from arch/s390/mm/init.c~mm-use-free_area_init-instead-of-free_area_init_nodes +1 -1
@@ -122,7 +122,7 @@ void __init paging_init(void)memset (max_zone_pfns,0 ,sizeof (max_zone_pfns)); max_zone_pfns[ZONE_DMA ] =PFN_DOWN (MAX_DMA_ADDRESS ); max_zone_pfns[ZONE_NORMAL ] = max_low_pfn; -free_area_init_nodes (max_zone_pfns); +free_area_init (max_zone_pfns); }void mark_rodata_ro (void )
arch/sh/mm/init.c renamed from arch/sh/mm/init.c~mm-use-free_area_init-instead-of-free_area_init_nodes +1 -1
@@ -334,7 +334,7 @@ void __init paging_init(void)memset (max_zone_pfns,0 ,sizeof (max_zone_pfns)); max_zone_pfns[ZONE_NORMAL ] = max_low_pfn; -free_area_init_nodes (max_zone_pfns); +free_area_init (max_zone_pfns); }unsigned int mem_init_done =0 ;
arch/sparc/mm/init_64.c renamed from arch/sparc/mm/init_64.c~mm-use-free_area_init-instead-of-free_area_init_nodes +1 -1
@@ -2488,7 +2488,7 @@ void __init paging_init(void) max_zone_pfns[ZONE_NORMAL ] = end_pfn; -free_area_init_nodes (max_zone_pfns); +free_area_init (max_zone_pfns); }printk ("Booting Linux...\n" );
arch/x86/mm/init.c renamed from arch/x86/mm/init.c~mm-use-free_area_init-instead-of-free_area_init_nodes +1 -1
@@ -949,7 +949,7 @@ void __init zone_sizes_init(void) max_zone_pfns[ZONE_HIGHMEM ] = max_pfn;#endif -free_area_init_nodes (max_zone_pfns); +free_area_init (max_zone_pfns); }__visible DEFINE_PER_CPU_SHARED_ALIGNED (struct tlb_state ,cpu_tlbstate ) = {
include/linux/mm.h renamed from include/linux/mm.h~mm-use-free_area_init-instead-of-free_area_init_nodes +3 -4
@@ -2272,7 +2272,6 @@ static inline spinlock_t *pud_lock(struc }extern void __init pagecache_init (void ); -extern void free_area_init (unsigned long * max_zone_pfn);extern void __init free_area_init_node (int nid,unsigned long * zones_size,unsigned long zone_start_pfn,unsigned long *zholes_size);extern void free_initmem (void );
@@ -2353,21 +2352,21 @@ static inline unsigned long get_num_phys* * An architecture is expected to register range of page frames backed by * physical memory with memblock_add[_node]() before calling -* free_area_init_nodes() passing in the PFN each zone ends at. At a basic +* free_area_init() passing in the PFN each zone ends at. At a basic * usage, an architecture is expected to do something like * * unsigned long max_zone_pfns[MAX_NR_ZONES] = {max_dma, max_normal_pfn, * max_highmem_pfn}; * for_each_valid_physical_page_range() * memblock_add_node(base, size, nid) -* free_area_init_nodes(max_zone_pfns); +* free_area_init(max_zone_pfns); * * free_bootmem_with_active_regions() calls free_bootmem_node() for each * registered physical page range. Similarly * sparse_memory_present_with_active_regions() calls memory_present() for * each range when SPARSEMEM is enabled. */ -extern void free_area_init_nodes (unsigned long *max_zone_pfn); +void free_area_init (unsigned long *max_zone_pfn);unsigned long node_map_pfn_alignment (void );unsigned long __absent_pages_in_range (int nid,unsigned long start_pfn,unsigned long end_pfn);
mm/page_alloc.c renamed from mm/page_alloc.c~mm-use-free_area_init-instead-of-free_area_init_nodes +2 -7
@@ -7428,7 +7428,7 @@ static void check_for_memory(pg_data_t * }/** -* free_area_init_nodes - Initialise all pg_data_t and zone data +* free_area_init - Initialise all pg_data_t and zone data * @max_zone_pfn: an array of max PFNs for each zone * * This will call free_area_init_node() for each active node in the system.
@@ -7440,7 +7440,7 @@ static void check_for_memory(pg_data_t ** starts where the previous one ended. For example, ZONE_DMA32 starts * at arch_max_dma_pfn. */ -void __init free_area_init_nodes (unsigned long *max_zone_pfn) +void __init free_area_init (unsigned long *max_zone_pfn) {unsigned long start_pfn, end_pfn;int i, nid;
@@ -7700,12 +7700,6 @@ void __init set_dma_reserve(unsigned lon dma_reserve = new_dma_reserve; } -void __init free_area_init (unsigned long *max_zone_pfn) -{ -init_unavailable_mem (); -free_area_init_nodes (max_zone_pfn); -}
+ alpha-simplify-detection-of-memory-zone-boundaries.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: alpha: simplify detection of memory zone boundaries has been added to the -mm tree. Its filename is alpha-simplify-detection-of-memory-zone-boundaries.patch
The patch titled
Subject: alpha: simplify detection of memory zone boundaries
has been added to the -mm tree. Its filename is
alpha-simplify-detection-of-memory-zone-boundaries.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/alpha-simplify-detection-of-memory-zone-boundaries.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/alpha-simplify-detection-of-memory-zone-boundaries.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: alpha: simplify detection of memory zone boundaries
free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones.
After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures.
Using this function instead of free_area_init_node() simplifies the zone detection.
---
arch/alpha/mm/numa.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-)
arch/alpha/mm/numa.c renamed from arch/alpha/mm/numa.c~alpha-simplify-detection-of-memory-zone-boundaries +4 -14
@@ -202,8 +202,7 @@ setup_memory(void *kernel_end)void __init paging_init (void ) { -unsigned int nid; -unsigned long zones_size[MAX_NR_ZONES ] = {0 , }; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 , };unsigned long dma_local_pfn;/*
@@ -215,19 +214,10 @@ void __init paging_init(void)*/ dma_local_pfn =virt_to_phys ((char *)MAX_DMA_ADDRESS ) >>PAGE_SHIFT ; -for_each_online_node (nid) { -unsigned long start_pfn =NODE_DATA (nid)->node_start_pfn; -unsigned long end_pfn = start_pfn +NODE_DATA (nid)->node_present_pages; + max_zone_pfn[ZONE_DMA ] = dma_local_pfn; + max_zone_pfn[ZONE_NORMAL ] = max_pfn; -if (dma_local_pfn >= end_pfn - start_pfn) - zones_size[ZONE_DMA ] = end_pfn - start_pfn; -else { - zones_size[ZONE_DMA ] = dma_local_pfn; - zones_size[ZONE_NORMAL ] = (end_pfn - start_pfn) - dma_local_pfn; - } -node_set_state (nid,N_NORMAL_MEMORY ); -free_area_init_node (nid, zones_size, start_pfn,NULL ); - } +free_area_init (max_zone_pfn);/* Initialize the kernel's ZERO_PGE. */ memset ((void *)ZERO_PGE ,0 ,PAGE_SIZE );
_
Patches currently in -mm which might be from [email protected] are
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ arm-simplify-detection-of-memory-zone-boundaries.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: arm: simplify detection of memory zone boundaries has been added to the -mm tree. Its filename is arm-simplify-detection-of-memory-zone-boundaries.patch
The patch titled
Subject: arm: simplify detection of memory zone boundaries
has been added to the -mm tree. Its filename is
arm-simplify-detection-of-memory-zone-boundaries.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/arm-simplify-detection-of-memory-zone-boundaries.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/arm-simplify-detection-of-memory-zone-boundaries.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: arm: simplify detection of memory zone boundaries
free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones.
After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures.
Using this function instead of free_area_init_node() simplifies the zone detection.
---
arch/arm/mm/init.c | 66 ++++--------------------------------------- 1 file changed, 7 insertions(+), 59 deletions(-)
arch/arm/mm/init.c renamed from arch/arm/mm/init.c~arm-simplify-detection-of-memory-zone-boundaries +7 -59
@@ -92,18 +92,6 @@ EXPORT_SYMBOL(arm_dma_zone_size);*/ phys_addr_t arm_dma_limit;unsigned long arm_dma_pfn_limit; - -static void __init arm_adjust_dma_zone (unsigned long *size,unsigned long *hole, -unsigned long dma_size) -{ -if (size[0 ] <= dma_size) -return ; - - size[ZONE_NORMAL ] = size[0 ] - dma_size; - size[ZONE_DMA ] = dma_size; - hole[ZONE_NORMAL ] = hole[0 ]; - hole[ZONE_DMA ] =0 ; -}#endif void __init setup_dma_zone (const struct machine_desc *mdesc)
@@ -121,56 +109,16 @@ void __init setup_dma_zone(const structstatic void __init zone_sizes_init (unsigned long min,unsigned long max_low,unsigned long max_high) { -unsigned long zone_size[MAX_NR_ZONES ], zhole_size[MAX_NR_ZONES ]; -struct memblock_region *reg; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 }; -/* -* initialise the zones. -*/ -memset (zone_size,0 ,sizeof (zone_size)); - -/* -* The memory size has already been determined. If we need -* to do anything fancy with the allocation of this memory -* to the zones, now is the time to do it. -*/ - zone_size[0 ] = max_low - min; -#ifdef CONFIG_HIGHMEM - zone_size[ZONE_HIGHMEM ] = max_high - max_low; +#ifdef CONFIG_ZONE_DMA + max_zone_pfn[ZONE_DMA ] =min (arm_dma_pfn_limit, max_low);#endif - -/* -* Calculate the size of the holes. -* holes = node_size - sum(bank_sizes) -*/ -memcpy (zhole_size, zone_size,sizeof (zhole_size)); -for_each_memblock (memory, reg) { -unsigned long start =memblock_region_memory_base_pfn (reg); -unsigned long end =memblock_region_memory_end_pfn (reg); - -if (start < max_low) { -unsigned long low_end =min (end, max_low); - zhole_size[0 ] -= low_end - start; - } + max_zone_pfn[ZONE_NORMAL ] = max_low;#ifdef CONFIG_HIGHMEM -if (end > max_low) { -unsigned long high_start =max (start, max_low); - zhole_size[ZONE_HIGHMEM ] -= end - high_start; - } + max_zone_pfn[ZONE_HIGHMEM ] = max_high;#endif - } - -#ifdef CONFIG_ZONE_DMA -/* -* Adjust the sizes according to any special requirements for -* this machine type. -*/ -if (arm_dma_zone_size) -arm_adjust_dma_zone (zone_size, zhole_size, - arm_dma_zone_size >>PAGE_SHIFT ); -#endif - -free_area_init_node (0 , zone_size, min, zhole_size); +free_area_init (max_zone_pfn); }#ifdef CONFIG_HAVE_ARCH_PFN_VALID
@@ -306,7 +254,7 @@ void __init bootmem_init(void)sparse_init ();/* -* Now free the memory - free_area_init_node needs +* Now free the memory - free_area_init needs * the sparse mem_map arrays initialized by sparse_init() * for memmap_init_zone(), otherwise all PFNs are invalid. */
_
Patches currently in -mm which might be from [email protected] are
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: arm64: simplify detection of memory zone boundaries for UMA configs has been added to the -mm tree. Its filename is…
The patch titled
Subject: arm64: simplify detection of memory zone boundaries for UMA configs
has been added to the -mm tree. Its filename is
arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: arm64: simplify detection of memory zone boundaries for UMA configs
The free_area_init() function only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones.
After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures.
Using this function instead of free_area_init_node() simplifies the zone detection.
---
arch/arm64/mm/init.c | 54 ----------------------------------------- 1 file changed, 54 deletions(-)
arch/arm64/mm/init.c renamed from arch/arm64/mm/init.c~arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs +0 -53
@@ -192,8 +192,6 @@ static phys_addr_t __init max_zone_phys(return min (offset + (1ULL << zone_bits),memblock_end_of_DRAM ()); } -#ifdef CONFIG_NUMA -static void __init zone_sizes_init (unsigned long min,unsigned long max) {unsigned long max_zone_pfns[MAX_NR_ZONES ] = {0 };
@@ -209,58 +207,6 @@ static void __init zone_sizes_init(unsigfree_area_init (max_zone_pfns); } -#else - -static void __init zone_sizes_init (unsigned long min,unsigned long max) -{ -struct memblock_region *reg; -unsigned long zone_size[MAX_NR_ZONES ], zhole_size[MAX_NR_ZONES ]; -unsigned long __maybe_unused max_dma, max_dma32; - -memset (zone_size,0 ,sizeof (zone_size)); - - max_dma = max_dma32 = min; -#ifdef CONFIG_ZONE_DMA - max_dma = max_dma32 =PFN_DOWN (arm64_dma_phys_limit); - zone_size[ZONE_DMA ] = max_dma - min; -#endif -#ifdef CONFIG_ZONE_DMA32 - max_dma32 =PFN_DOWN (arm64_dma32_phys_limit); - zone_size[ZONE_DMA32 ] = max_dma32 - max_dma; -#endif - zone_size[ZONE_NORMAL ] = max - max_dma32; - -memcpy (zhole_size, zone_size,sizeof (zhole_size)); - -for_each_memblock (memory, reg) { -unsigned long start =memblock_region_memory_base_pfn (reg); -unsigned long end =memblock_region_memory_end_pfn (reg); - -#ifdef CONFIG_ZONE_DMA -if (start >= min && start < max_dma) { -unsigned long dma_end =min (end, max_dma); - zhole_size[ZONE_DMA ] -= dma_end - start; - start = dma_end; - } -#endif -#ifdef CONFIG_ZONE_DMA32 -if (start >= max_dma && start < max_dma32) { -unsigned long dma32_end =min (end, max_dma32); - zhole_size[ZONE_DMA32 ] -= dma32_end - start; - start = dma32_end; - } -#endif -if (start >= max_dma32 && start < max) { -unsigned long normal_end =min (end, max); - zhole_size[ZONE_NORMAL ] -= normal_end - start; - } - } - -free_area_init_node (0 , zone_size, min, zhole_size); -} - -#endif /* CONFIG_NUMA */
+ csky-simplify-detection-of-memory-zone-boundaries.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: csky: simplify detection of memory zone boundaries has been added to the -mm tree. Its filename is csky-simplify-detection-of-memory-zone-boundaries.patch
The patch titled
Subject: csky: simplify detection of memory zone boundaries
has been added to the -mm tree. Its filename is
csky-simplify-detection-of-memory-zone-boundaries.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/csky-simplify-detection-of-memory-zone-boundaries.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/csky-simplify-detection-of-memory-zone-boundaries.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: csky: simplify detection of memory zone boundaries
The free_area_init() function only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones.
After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures.
Using this function instead of free_area_init_node() simplifies the zone detection.
---
arch/csky/kernel/setup.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-)
arch/csky/kernel/setup.c renamed from arch/csky/kernel/setup.c~csky-simplify-detection-of-memory-zone-boundaries +11 -15
@@ -26,7 +26,9 @@ struct screen_info screen_info = {static void __init csky_memblock_init (void ) { -unsigned long zone_size[MAX_NR_ZONES ]; +unsigned long lowmem_size =PFN_DOWN (LOWMEM_LIMIT -PHYS_OFFSET_OFFSET ); +unsigned long sseg_size =PFN_DOWN (SSEG_SIZE -PHYS_OFFSET_OFFSET ); +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 };signed long size;memblock_reserve (__pa (_stext), _end - _stext);
@@ -36,28 +38,22 @@ static void __init csky_memblock_init(vomemblock_dump_all (); -memset (zone_size,0 ,sizeof (zone_size)); - min_low_pfn =PFN_UP (memblock_start_of_DRAM ()); max_low_pfn = max_pfn =PFN_DOWN (memblock_end_of_DRAM ()); size = max_pfn - min_low_pfn; -if (size <=PFN_DOWN (SSEG_SIZE -PHYS_OFFSET_OFFSET )) - zone_size[ZONE_NORMAL ] = size; -else if (size <PFN_DOWN (LOWMEM_LIMIT -PHYS_OFFSET_OFFSET )) { - zone_size[ZONE_NORMAL ] = -PFN_DOWN (SSEG_SIZE -PHYS_OFFSET_OFFSET ); - max_low_pfn = min_low_pfn + zone_size[ZONE_NORMAL ]; - }else { - zone_size[ZONE_NORMAL ] = -PFN_DOWN (LOWMEM_LIMIT -PHYS_OFFSET_OFFSET ); - max_low_pfn = min_low_pfn + zone_size[ZONE_NORMAL ]; +if (size >= lowmem_size) { + max_low_pfn = min_low_pfn + lowmem_size;write_mmu_msa1 (read_mmu_msa0 () +SSEG_SIZE ); + }else if (size > sseg_size) { + max_low_pfn = min_low_pfn + sseg_size; } + max_zone_pfn[ZONE_NORMAL ] = max_low_pfn; +#ifdef CONFIG_HIGHMEM - zone_size[ZONE_HIGHMEM ] = max_pfn - max_low_pfn; + max_zone_pfn[ZONE_HIGHMEM ] = max_pfn; highstart_pfn = max_low_pfn; highend_pfn = max_pfn;
@@ -66,7 +62,7 @@ static void __init csky_memblock_init(vodma_contiguous_reserve (0 ); -free_area_init_node (0 , zone_size, min_low_pfn,NULL ); +free_area_init (max_zone_pfn); }void __init setup_arch (char **cmdline_p)
_
Patches currently in -mm which might be from [email protected] are
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ m68k-mm-simplify-detection-of-memory-zone-boundaries.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: m68k: mm: simplify detection of memory zone boundaries has been added to the -mm tree. Its filename is m68k-mm-simplify-detection-of-memory-zone-boundaries.patch
The patch titled
Subject: m68k: mm: simplify detection of memory zone boundaries
has been added to the -mm tree. Its filename is
m68k-mm-simplify-detection-of-memory-zone-boundaries.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/m68k-mm-simplify-detection-of-memory-zone-boundaries.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/m68k-mm-simplify-detection-of-memory-zone-boundaries.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: m68k: mm: simplify detection of memory zone boundaries
free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones.
After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures.
Using this function instead of free_area_init_node() simplifies the zone detection.
---
arch/m68k/mm/motorola.c | 11 +++++------ arch/m68k/mm/sun3mmu.c | 10 +++------- 2 files changed, 8 insertions(+), 13 deletions(-)
arch/m68k/mm/motorola.c renamed from arch/m68k/mm/motorola.c~m68k-mm-simplify-detection-of-memory-zone-boundaries +5 -6
@@ -365,7 +365,7 @@ static void __init map_node(int node)*/ void __init paging_init (void ) { -unsigned long zones_size[MAX_NR_ZONES ] = {0 , }; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 , };unsigned long min_addr, max_addr;unsigned long addr;int i;
@@ -448,11 +448,10 @@ void __init paging_init(void)#ifdef DEBUG printk ("before free_area_init\n" );#endif -for (i =0 ; i < m68k_num_memory; i++) { - zones_size[ZONE_DMA ] = m68k_memory[i].size >>PAGE_SHIFT ; -free_area_init_node (i, zones_size, - m68k_memory[i].addr >>PAGE_SHIFT ,NULL ); +for (i =0 ; i < m68k_num_memory; i++)if (node_present_pages (i))node_set_state (i,N_NORMAL_MEMORY ); - } + + max_zone_pfn[ZONE_DMA ] =memblock_end_of_DRAM (); +free_area_init (max_zone_pfn); }
arch/m68k/mm/sun3mmu.c renamed from arch/m68k/mm/sun3mmu.c~m68k-mm-simplify-detection-of-memory-zone-boundaries +3 -6
@@ -42,7 +42,7 @@ void __init paging_init(void)unsigned long address;unsigned long next_pgtable;unsigned long bootmem_end; -unsigned long zones_size[MAX_NR_ZONES ] = {0 , }; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 , };unsigned long size; empty_zero_page =memblock_alloc (PAGE_SIZE ,PAGE_SIZE );
@@ -89,14 +89,10 @@ void __init paging_init(void) current->mm =NULL ;/* memory sizing is a hack stolen from motorola.c.. hope it works for us */ - zones_size[ZONE_DMA ] = ((unsigned long )high_memory -PAGE_OFFSET ) >>PAGE_SHIFT ; + max_zone_pfn[ZONE_DMA ] = ((unsigned long )high_memory) >>PAGE_SHIFT ;/* I really wish I knew why the following change made things better... -- Sam */ -/* free_area_init(zones_size); */ -free_area_init_node (0 , zones_size, - (__pa (PAGE_OFFSET ) >>PAGE_SHIFT ) +1 ,NULL ); +free_area_init (max_zone_pfn); } -
+ parisc-simplify-detection-of-memory-zone-boundaries.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: parisc: simplify detection of memory zone boundaries has been added to the -mm tree. Its filename is parisc-simplify-detection-of-memory-zone-boundaries.patch
The patch titled
Subject: parisc: simplify detection of memory zone boundaries
has been added to the -mm tree. Its filename is
parisc-simplify-detection-of-memory-zone-boundaries.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/parisc-simplify-detection-of-memory-zone-boundaries.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/parisc-simplify-detection-of-memory-zone-boundaries.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: parisc: simplify detection of memory zone boundaries
free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones.
After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures.
Using this function instead of free_area_init_node() simplifies the zone detection.
---
arch/parisc/mm/init.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-)
arch/parisc/mm/init.c renamed from arch/parisc/mm/init.c~parisc-simplify-detection-of-memory-zone-boundaries +3 -19
@@ -675,27 +675,11 @@ static void __init gateway_init(void)static void __init parisc_bootmem_free (void ) { -unsigned long zones_size[MAX_NR_ZONES ] = {0 , }; -unsigned long holes_size[MAX_NR_ZONES ] = {0 , }; -unsigned long mem_start_pfn = ~0UL , mem_end_pfn =0 , mem_size_pfn =0 ; -int i; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 , }; -for (i =0 ; i < npmem_ranges; i++) { -unsigned long start = pmem_ranges[i].start_pfn; -unsigned long size = pmem_ranges[i].pages; -unsigned long end = start + size; + max_zone_pfn[0 ] =memblock_end_of_DRAM (); -if (mem_start_pfn > start) - mem_start_pfn = start; -if (mem_end_pfn < end) - mem_end_pfn = end; - mem_size_pfn += size; - } - - zones_size[0 ] = mem_end_pfn - mem_start_pfn; - holes_size[0 ] = zones_size[0 ] - mem_size_pfn; - -free_area_init_node (0 , zones_size, mem_start_pfn, holes_size); +free_area_init (max_zone_pfn); }void __init paging_init (void )
_
Patches currently in -mm which might be from [email protected] are
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ sparc32-simplify-detection-of-memory-zone-boundaries.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: sparc32: simplify detection of memory zone boundaries has been added to the -mm tree. Its filename is sparc32-simplify-detection-of-memory-zone-boundaries.patch
The patch titled
Subject: sparc32: simplify detection of memory zone boundaries
has been added to the -mm tree. Its filename is
sparc32-simplify-detection-of-memory-zone-boundaries.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/sparc32-simplify-detection-of-memory-zone-boundaries.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/sparc32-simplify-detection-of-memory-zone-boundaries.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: sparc32: simplify detection of memory zone boundaries
free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones.
After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures.
Using this function instead of free_area_init_node() simplifies the zone detection.
---
arch/sparc/mm/srmmu.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-)
arch/sparc/mm/srmmu.c renamed from arch/sparc/mm/srmmu.c~sparc32-simplify-detection-of-memory-zone-boundaries +5 -16
@@ -1008,24 +1008,13 @@ void __init srmmu_paging_init(void)kmap_init (); { -unsigned long zones_size[MAX_NR_ZONES ]; -unsigned long zholes_size[MAX_NR_ZONES ]; -unsigned long npages; -int znum; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 }; -for (znum =0 ; znum <MAX_NR_ZONES ; znum++) - zones_size[znum] = zholes_size[znum] =0 ; + max_zone_pfn[ZONE_DMA ] = max_low_pfn; + max_zone_pfn[ZONE_NORMAL ] = max_low_pfn; + max_zone_pfn[ZONE_HIGHMEM ] = highend_pfn; - npages = max_low_pfn - pfn_base; - - zones_size[ZONE_DMA ] = npages; - zholes_size[ZONE_DMA ] = npages - pages_avail; - - npages = highend_pfn - max_low_pfn; - zones_size[ZONE_HIGHMEM ] = npages; - zholes_size[ZONE_HIGHMEM ] = npages -calc_highpages (); - -free_area_init_node (0 , zones_size, pfn_base, zholes_size); +free_area_init (max_zone_pfn); } }
_
Patches currently in -mm which might be from [email protected] are
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ unicore32-simplify-detection-of-memory-zone-boundaries.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: unicore32: simplify detection of memory zone boundaries has been added to the -mm tree. Its filename is unicore32-simplify-detection-of-memory-zone-boundaries.patch
The patch titled
Subject: unicore32: simplify detection of memory zone boundaries
has been added to the -mm tree. Its filename is
unicore32-simplify-detection-of-memory-zone-boundaries.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/unicore32-simplify-detection-of-memory-zone-boundaries.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/unicore32-simplify-detection-of-memory-zone-boundaries.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: unicore32: simplify detection of memory zone boundaries
free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones.
After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures.
Using this function instead of free_area_init_node() simplifies the zone detection.
---
arch/unicore32/include/asm/memory.h | 2 - arch/unicore32/include/mach/memory.h | 6 +-- arch/unicore32/kernel/pci.c | 14 +------- arch/unicore32/mm/init.c | 43 +++++-------------------- 4 files changed, 15 insertions(+), 50 deletions(-)
arch/unicore32/include/asm/memory.h renamed from arch/unicore32/include/asm/memory.h~unicore32-simplify-detection-of-memory-zone-boundaries +1 -1
@@ -60,7 +60,7 @@#ifndef __ASSEMBLY__#ifndef arch_adjust_zones -#define arch_adjust_zones (size, holes) do { } while (0) +#define arch_adjust_zones (max_zone_pfn) do { } while (0)#endif /*
arch/unicore32/include/mach/memory.h renamed from arch/unicore32/include/mach/memory.h~unicore32-simplify-detection-of-memory-zone-boundaries +3 -3
@@ -25,10 +25,10 @@#if !defined(__ASSEMBLY__) && defined(CONFIG_PCI ) -void puv3_pci_adjust_zones (unsigned long *size,unsigned long *holes); +void puv3_pci_adjust_zones (unsigned long *max_zone_pfn); -#define arch_adjust_zones (size, holes) \ - puv3_pci_adjust_zones(size, holes) +#define arch_adjust_zones (max_zone_pfn) \ + puv3_pci_adjust_zones(max_zone_pfn)#endif
arch/unicore32/kernel/pci.c renamed from arch/unicore32/kernel/pci.c~unicore32-simplify-detection-of-memory-zone-boundaries +2 -12
@@ -133,21 +133,11 @@ static int pci_puv3_map_irq(const struct* This is really ugly and we need a better way of specifying * DMA-capable regions of memory. */ -void __init puv3_pci_adjust_zones (unsigned long *zone_size, -unsigned long *zhole_size) +void __init puv3_pci_adjust_zones (unsigned long max_zone_pfn) {unsigned int sz =SZ_128M >>PAGE_SHIFT ; -/* -* Only adjust if > 128M on current system -*/ -if (zone_size[0 ] <= sz) -return ; - - zone_size[1 ] = zone_size[0 ] - sz; - zone_size[0 ] = sz; - zhole_size[1 ] = zhole_size[0 ]; - zhole_size[0 ] =0 ; + max_zone_pfn[ZONE_DMA ] = sz; }/*
arch/unicore32/mm/init.c renamed from arch/unicore32/mm/init.c~unicore32-simplify-detection-of-memory-zone-boundaries +9 -34
66 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ xtensa-simplify-detection-of-memory-zone-boundaries.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: xtensa: simplify detection of memory zone boundaries has been added to the -mm tree. Its filename is xtensa-simplify-detection-of-memory-zone-boundaries.patch
The patch titled
Subject: xtensa: simplify detection of memory zone boundaries
has been added to the -mm tree. Its filename is
xtensa-simplify-detection-of-memory-zone-boundaries.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/xtensa-simplify-detection-of-memory-zone-boundaries.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/xtensa-simplify-detection-of-memory-zone-boundaries.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: xtensa: simplify detection of memory zone boundaries
free_area_init() only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones.
After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available to all architectures.
Using this function instead of free_area_init_node() simplifies the zone detection.
---
arch/xtensa/mm/init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/xtensa/mm/init.c renamed from arch/xtensa/mm/init.c~xtensa-simplify-detection-of-memory-zone-boundaries +4 -4
@@ -70,13 +70,13 @@ void __init bootmem_init(void)void __init zones_init (void ) {/* All pages are DMA-able, so we put them all in the DMA zone. */ -unsigned long zones_size[MAX_NR_ZONES ] = { - [ZONE_NORMAL ] = max_low_pfn -ARCH_PFN_OFFSET , +unsigned long max_zone_pfn[MAX_NR_ZONES ] = { + [ZONE_NORMAL ] = max_low_pfn, #ifdef CONFIG_HIGHMEM - [ZONE_HIGHMEM ] = max_pfn - max_low_pfn, + [ZONE_HIGHMEM ] = max_pfn, #endif }; -free_area_init_node (0 , zones_size,ARCH_PFN_OFFSET ,NULL ); +free_area_init (max_zone_pfn); }#ifdef CONFIG_HIGHMEM
_
Patches currently in -mm which might be from [email protected] are
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ mm-memmap_init-iterate-over-memblock-regions-rather-that-check-each-pfn.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm: memmap_init: iterate over memblock regions rather that check each PFN has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm: memmap_init: iterate over memblock regions rather that check each PFN
has been added to the -mm tree. Its filename is
mm-memmap_init-iterate-over-memblock-regions-rather-that-check-each-pfn.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-memmap_init-iterate-over-memblock-regions-rather-that-check-each-pfn.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-memmap_init-iterate-over-memblock-regions-rather-that-check-each-pfn.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Baoquan He <[email protected]>
Subject: mm: memmap_init: iterate over memblock regions rather that check each PFN
When called during boot the memmap_init_zone() function checks if each PFN is valid and actually belongs to the node being initialized using early_pfn_valid() and early_pfn_in_nid().
Each such check may cost up to O(log(n)) where n is the number of memory banks, so for large amount of memory overall time spent in early_pfn*() becomes substantial.
Since the information is anyway present in memblock, we can iterate over memblock memory regions in memmap_init() and only call memmap_init_zone() for PFN ranges that are know to be valid and in the appropriate node.
---
mm/page_alloc.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
mm/page_alloc.c renamed from mm/page_alloc.c~mm-memmap_init-iterate-over-memblock-regions-rather-that-check-each-pfn +16 -10
@@ -5995,14 +5995,6 @@ void __meminit memmap_init_zone(unsigned* function. They do not exist on hotplugged memory. */ if (context ==MEMMAP_EARLY ) { -if (!early_pfn_valid (pfn)) { - pfn =next_pfn (pfn); -continue ; - } -if (!early_pfn_in_nid (pfn, nid)) { - pfn++; -continue ; - }if (overlap_memmap_init (zone, &pfn))continue ;if (defer_init (nid, pfn, end_pfn))
@@ -6118,9 +6110,23 @@ static void __meminit zone_init_free_lis }void __meminit __weak memmap_init (unsigned long size,int nid, -unsigned long zone,unsigned long start_pfn) +unsigned long zone, +unsigned long range_start_pfn) { -memmap_init_zone (size, nid, zone, start_pfn,MEMMAP_EARLY ,NULL ); +unsigned long start_pfn, end_pfn; +unsigned long range_end_pfn = range_start_pfn + size; +int i; + +for_each_mem_pfn_range (i, nid, &start_pfn, &end_pfn,NULL ) { + start_pfn =clamp (start_pfn, range_start_pfn, range_end_pfn); + end_pfn =clamp (end_pfn, range_start_pfn, range_end_pfn); + +if (end_pfn > start_pfn) { + size = end_pfn - start_pfn; +memmap_init_zone (size, nid, zone, start_pfn, +MEMMAP_EARLY ,NULL ); + } + } }static int zone_batchsize (struct zone *zone)
_
Patches currently in -mm which might be from [email protected] are
mm-memmap_init-iterate-over-memblock-regions-rather-that-check-each-pfn.patch
+ mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm: remove early_pfn_in_nid() and CONFIG_NODES_SPAN_OTHER_NODES has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm: remove early_pfn_in_nid() and CONFIG_NODES_SPAN_OTHER_NODES
has been added to the -mm tree. Its filename is
mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: mm: remove early_pfn_in_nid() and CONFIG_NODES_SPAN_OTHER_NODES
commit f47ac088c406 ("mm: memmap_init: iterate over memblock regions rather that check each PFN") made early_pfn_in_nid() obsolete and since CONFIG_NODES_SPAN_OTHER_NODES is only used to pick a stub or a real implementation of early_pfn_in_nid() it is also not needed anymore.
Remove both early_pfn_in_nid() and the CONFIG_NODES_SPAN_OTHER_NODES.
---
arch/powerpc/Kconfig | 9 --------- arch/sparc/Kconfig | 9 --------- arch/x86/Kconfig | 9 --------- mm/page_alloc.c | 20 -------------------- 4 files changed, 47 deletions(-)
arch/powerpc/Kconfig renamed from arch/powerpc/Kconfig~mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes +0 -9
@@ -686,15 +686,6 @@ config ARCH_MEMORY_PROBE def_bool y depends on MEMORY_HOTPLUG -# Some NUMA nodes have memory ranges that span -# other nodes. Even though a pfn is valid and -# between a node's start and end pfns, it may not -# reside on that node. See memmap_init_zone() -# for details. -config NODES_SPAN_OTHER_NODES - def_bool y - depends on NEED_MULTIPLE_NODES - config STDBINUTILS bool "Using standard binutils settings" depends on 44x
arch/sparc/Kconfig renamed from arch/sparc/Kconfig~mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes +0 -9
@@ -286,15 +286,6 @@ config NODES_SHIFT Specify the maximum number of NUMA Nodes available on the target system. Increases memory reserved to accommodate various tables. -# Some NUMA nodes have memory ranges that span -# other nodes. Even though a pfn is valid and -# between a node's start and end pfns, it may not -# reside on that node. See memmap_init_zone() -# for details. -config NODES_SPAN_OTHER_NODES - def_bool y - depends on NEED_MULTIPLE_NODES - config ARCH_SPARSEMEM_ENABLE def_bool y if SPARC64 select SPARSEMEM_VMEMMAP_ENABLE
arch/x86/Kconfig renamed from arch/x86/Kconfig~mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes +0 -9
@@ -1582,15 +1582,6 @@ config X86_64_ACPI_NUMA ---help--- Enable ACPI SRAT based node topology detection. -# Some NUMA nodes have memory ranges that span -# other nodes. Even though a pfn is valid and -# between a node's start and end pfns, it may not -# reside on that node. See memmap_init_zone() -# for details. -config NODES_SPAN_OTHER_NODES - def_bool y - depends on X86_64_ACPI_NUMA - config NUMA_EMU bool "NUMA emulation" depends on NUMA
mm/page_alloc.c renamed from mm/page_alloc.c~mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes +0 -19
@@ -1541,26 +1541,6 @@ int __meminit early_pfn_to_nid(unsigned }#endif /* CONFIG_NEED_MULTIPLE_NODES */ -#ifdef CONFIG_NODES_SPAN_OTHER_NODES -/* Only safe to use early in boot when initialisation is single-threaded */ -static inline bool __meminit early_pfn_in_nid (unsigned long pfn,int node) -{ -int nid; - - nid =__early_pfn_to_nid (pfn, &early_pfnnid_cache); -if (nid >=0 && nid != node) -return false; -return true; -} - -#else -static inline bool __meminit early_pfn_in_nid (unsigned long pfn,int node) -{ -return true; -} -#endif -
+ mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm: free_area_init: allow defining max_zone_pfn in descending order has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm: free_area_init: allow defining max_zone_pfn in descending order
has been added to the -mm tree. Its filename is
mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: mm: free_area_init: allow defining max_zone_pfn in descending order
Some architectures (e.g. ARC) have the ZONE_HIGHMEM zone below the ZONE_NORMAL. Allowing free_area_init() parse max_zone_pfn array even it is sorted in descending order allows using free_area_init() on such architectures.
Add top -> down traversal of max_zone_pfn array in free_area_init() and use the latter in ARC node/zone initialization.
---
arch/arc/mm/init.c | 36 +++++++----------------------------- mm/page_alloc.c | 24 +++++++++++++++++++----- 2 files changed, 26 insertions(+), 34 deletions(-)
arch/arc/mm/init.c renamed from arch/arc/mm/init.c~mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order +7 -29
@@ -63,11 +63,13 @@ void __init early_init_dt_add_memory_arc low_mem_sz = size; in_use =1 ; +memblock_add_node (base, size,0 ); }else {#ifdef CONFIG_HIGHMEM high_mem_start = base; high_mem_sz = size; in_use =1 ; +memblock_add_node (base, size,1 );#endif }
@@ -83,8 +85,7 @@ void __init early_init_dt_add_memory_arc*/ void __init setup_arch_memory (void ) { -unsigned long zones_size[MAX_NR_ZONES ]; -unsigned long zones_holes[MAX_NR_ZONES ]; +unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 }; init_mm.start_code = (unsigned long )_text; init_mm.end_code = (unsigned long )_etext;
@@ -115,7 +116,6 @@ void __init setup_arch_memory(void)* the crash */ -memblock_add_node (low_mem_start, low_mem_sz,0 );memblock_reserve (CONFIG_LINUX_LINK_BASE ,__pa (_end) -CONFIG_LINUX_LINK_BASE );
@@ -133,22 +133,7 @@ void __init setup_arch_memory(void)memblock_dump_all ();/*----------------- node/zones setup --------------------------*/ -memset (zones_size,0 ,sizeof (zones_size)); -memset (zones_holes,0 ,sizeof (zones_holes)); - - zones_size[ZONE_NORMAL ] = max_low_pfn - min_low_pfn; - zones_holes[ZONE_NORMAL ] =0 ; - -/* -* We can't use the helper free_area_init(zones[]) because it uses -* PAGE_OFFSET to compute the @min_low_pfn which would be wrong -* when our kernel doesn't start at PAGE_OFFSET, i.e. -* PAGE_OFFSET != CONFIG_LINUX_RAM_BASE -*/ -free_area_init_node (0 ,/* node-id */ - zones_size,/* num pages per zone */ - min_low_pfn,/* first pfn of node */ - zones_holes);/* holes */ + max_zone_pfn[ZONE_NORMAL ] = max_low_pfn;#ifdef CONFIG_HIGHMEM /*
@@ -168,20 +153,13 @@ void __init setup_arch_memory(void) min_high_pfn =PFN_DOWN (high_mem_start); max_high_pfn =PFN_DOWN (high_mem_start + high_mem_sz); - zones_size[ZONE_NORMAL ] =0 ; - zones_holes[ZONE_NORMAL ] =0 ; - - zones_size[ZONE_HIGHMEM ] = max_high_pfn - min_high_pfn; - zones_holes[ZONE_HIGHMEM ] =0 ; - -free_area_init_node (1 ,/* node-id */ - zones_size,/* num pages per zone */ - min_high_pfn,/* first pfn of node */ - zones_holes);/* holes */ + max_zone_pfn[ZONE_HIGHMEM ] = max_high_pfn; high_memory = (void *)(min_high_pfn <<PAGE_SHIFT );kmap_init ();#endif + +free_area_init (max_zone_pfn); }/*
mm/page_alloc.c renamed from mm/page_alloc.c~mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order +19 -5
@@ -7429,7 +7429,8 @@ static void check_for_memory(pg_data_t *void __init free_area_init (unsigned long *max_zone_pfn) {unsigned long start_pfn, end_pfn; -int i, nid; +int i, nid, zone; +bool descending = false;/* Record where the zone boundaries are */ memset(arch_zone_lowest_possible_pfn, 0,
@@ -7439,13 +7440,26 @@ void __init free_area_init(unsigned long start_pfn =find_min_pfn_with_active_regions (); +/* +* Some architecturs, e.g. ARC may have ZONE_HIGHMEM below +* ZONE_NORMAL. For such cases we allow max_zone_pfn sorted in the +* descending order +*/ +if (MAX_NR_ZONES >1 && max_zone_pfn[0 ] > max_zone_pfn[1 ]) + descending = true; +for (i =0 ; i <MAX_NR_ZONES ; i++) { -if (i ==ZONE_MOVABLE ) +if (descending) + zone =MAX_NR_ZONES - i -1 ; +else + zone = i; + +if (zone ==ZONE_MOVABLE )continue ; - end_pfn =max (max_zone_pfn[i], start_pfn); - arch_zone_lowest_possible_pfn[i] = start_pfn; - arch_zone_highest_possible_pfn[i] = end_pfn; + end_pfn =max (max_zone_pfn[zone], start_pfn); + arch_zone_lowest_possible_pfn[zone] = start_pfn; + arch_zone_highest_possible_pfn[zone] = end_pfn; start_pfn = end_pfn; }
_
Patches currently in -mm which might be from [email protected] are
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm: rename free_area_init_node() to free_area_init_memoryless_node() has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm: rename free_area_init_node() to free_area_init_memoryless_node()
has been added to the -mm tree. Its filename is
mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: mm: rename free_area_init_node() to free_area_init_memoryless_node()
free_area_init_node() is only used by x86 to initialize a memory-less nodes. Make its name reflect this and drop all the function parameters except node ID as they are anyway zero.
---
arch/x86/mm/numa.c | 5 +---- include/linux/mm.h | 9 +++------ mm/page_alloc.c | 7 ++----- 3 files changed, 6 insertions(+), 15 deletions(-)
arch/x86/mm/numa.c renamed from arch/x86/mm/numa.c~mm-rename-free_area_init_node-to-free_area_init_memoryless_node +1 -4
@@ -737,12 +737,9 @@ void __init x86_numa_init(void)static void __init init_memory_less_node (int nid) { -unsigned long zones_size[MAX_NR_ZONES ] = {0 }; -unsigned long zholes_size[MAX_NR_ZONES ] = {0 }; -/* Allocate and initialize node data. Memory-less node is now online.*/ alloc_node_data (nid); -free_area_init_node (nid, zones_size,0 , zholes_size); +free_area_init_memoryless_node (nid);/* * All zonelists will be built later in start_kernel() after per cpu
include/linux/mm.h renamed from include/linux/mm.h~mm-rename-free_area_init_node-to-free_area_init_memoryless_node +3 -6
@@ -2272,8 +2272,7 @@ static inline spinlock_t *pud_lock(struc }extern void __init pagecache_init (void ); -extern void __init free_area_init_node (int nid,unsigned long * zones_size, -unsigned long zone_start_pfn,unsigned long *zholes_size); +extern void __init free_area_init_memoryless_node (int nid);extern void free_initmem (void );/*
@@ -2345,10 +2344,8 @@ static inline unsigned long get_num_phys/* * Using memblock node mappings, an architecture may initialise its -* zones, allocate the backing mem_map and account for memory holes in a more -* architecture independent manner. This is a substitute for creating the -* zone_sizes[] and zholes_size[] arrays and passing them to -* free_area_init_node() +* zones, allocate the backing mem_map and account for memory holes in an +* architecture independent manner. * * An architecture is expected to register range of page frames backed by * physical memory with memblock_add[_node]() before calling
mm/page_alloc.c renamed from mm/page_alloc.c~mm-rename-free_area_init_node-to-free_area_init_memoryless_node +2 -5
@@ -6979,12 +6979,9 @@ static void __init __free_area_init_nodefree_area_init_core (pgdat); } -void __init free_area_init_node (int nid,unsigned long *zones_size, -unsigned long node_start_pfn, -unsigned long *zholes_size) +void __init free_area_init_memoryless_node (int nid) { -__free_area_init_node (nid, zones_size, node_start_pfn, zholes_size, - true); +__free_area_init_node (nid,NULL ,0 ,NULL , false); }#if !defined(CONFIG_FLAT_NODE_MEM_MAP )
_
Patches currently in -mm which might be from [email protected] are
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ mm-clean-up-free_area_init_node-and-its-helpers.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm: clean up free_area_init_node() and its helpers has been added to the -mm tree. Its filename is mm-clean-up-free_area_init_node-and-its-helpers.patch
The patch titled
Subject: mm: clean up free_area_init_node() and its helpers
has been added to the -mm tree. Its filename is
mm-clean-up-free_area_init_node-and-its-helpers.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-clean-up-free_area_init_node-and-its-helpers.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-clean-up-free_area_init_node-and-its-helpers.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: mm: clean up free_area_init_node() and its helpers
free_area_init_node() now always uses memblock info and the zone PFN limits so it does not need the backwards compatibility functions to calculate the zone spanned and absent pages. The removal of the compat_ versions of zone_{abscent,spanned}_pages_in_node() in turn, makes zone_size and zhole_size parameters unused.
The node_start_pfn is determined by get_pfn_range_for_nid(), so there is no need to pass it to free_area_init_node().
As a result, the only required parameter to free_area_init_node() is the node ID, all the rest are removed along with no longer used compat_zone_{abscent,spanned}_pages_in_node() helpers.
---
mm/page_alloc.c | 104 +++++++++------------------------------------- 1 file changed, 22 insertions(+), 82 deletions(-)
mm/page_alloc.c renamed from mm/page_alloc.c~mm-clean-up-free_area_init_node-and-its-helpers +22 -82
@@ -6441,8 +6441,7 @@ static unsigned long __init zone_spannedunsigned long node_start_pfn, unsigned long node_end_pfn, unsigned long *zone_start_pfn, - unsigned long *zone_end_pfn, - unsigned long *ignored) + unsigned long *zone_end_pfn) { unsigned long zone_low = arch_zone_lowest_possible_pfn[zone_type];unsigned long zone_high = arch_zone_highest_possible_pfn[zone_type];
@@ -6506,8 +6505,7 @@ unsigned long __init absent_pages_in_ranstatic unsigned long __init zone_absent_pages_in_node (int nid,unsigned long zone_type,unsigned long node_start_pfn, -unsigned long node_end_pfn, -unsigned long *ignored) +unsigned long node_end_pfn) {unsigned long zone_low = arch_zone_lowest_possible_pfn[zone_type];unsigned long zone_high = arch_zone_highest_possible_pfn[zone_type];
@@ -6554,43 +6552,9 @@ static unsigned long __init zone_absent_return nr_absent; } -static inline unsigned long __init compat_zone_spanned_pages_in_node (int nid, -unsigned long zone_type, -unsigned long node_start_pfn, -unsigned long node_end_pfn, -unsigned long *zone_start_pfn, -unsigned long *zone_end_pfn, -unsigned long *zones_size) -{ -unsigned int zone; - - *zone_start_pfn = node_start_pfn; -for (zone =0 ; zone < zone_type; zone++) - *zone_start_pfn += zones_size[zone]; - - *zone_end_pfn = *zone_start_pfn + zones_size[zone_type]; - -return zones_size[zone_type]; -} - -static inline unsigned long __init compat_zone_absent_pages_in_node (int nid, -unsigned long zone_type, -unsigned long node_start_pfn, -unsigned long node_end_pfn, -unsigned long *zholes_size) -{ -if (!zholes_size) -return 0 ; - -return zholes_size[zone_type]; -} -static void __init calculate_node_totalpages (struct pglist_data *pgdat,unsigned long node_start_pfn, -unsigned long node_end_pfn, -unsigned long *zones_size, -unsigned long *zholes_size, -bool compat) +unsigned long node_end_pfn) {unsigned long realtotalpages =0 , totalpages =0 ;enum zone_type i;
@@ -6601,31 +6565,14 @@ static void __init calculate_node_totalpunsigned long spanned, absent;unsigned long size, real_size; -if (compat) { - spanned =compat_zone_spanned_pages_in_node ( - pgdat->node_id, i, - node_start_pfn, - node_end_pfn, - &zone_start_pfn, - &zone_end_pfn, - zones_size); - absent =compat_zone_absent_pages_in_node ( - pgdat->node_id, i, - node_start_pfn, - node_end_pfn, - zholes_size); - }else { - spanned =zone_spanned_pages_in_node (pgdat->node_id, i, - node_start_pfn, - node_end_pfn, - &zone_start_pfn, - &zone_end_pfn, - zones_size); - absent =zone_absent_pages_in_node (pgdat->node_id, i, - node_start_pfn, - node_end_pfn, - zholes_size); - } + spanned =zone_spanned_pages_in_node (pgdat->node_id, i, + node_start_pfn, + node_end_pfn, + &zone_start_pfn, + &zone_end_pfn); + absent =zone_absent_pages_in_node (pgdat->node_id, i, + node_start_pfn, + node_end_pfn); size = spanned; real_size = size - absent;
@@ -6947,10 +6894,7 @@ static inline void pgdat_set_deferred_rastatic inline void pgdat_set_deferred_range (pg_data_t *pgdat) {}#endif -static void __init __free_area_init_node (int nid,unsigned long *zones_size, -unsigned long node_start_pfn, -unsigned long *zholes_size, -bool compat) +static void __init free_area_init_node (int nid) {pg_data_t *pgdat =NODE_DATA (nid);unsigned long start_pfn =0 ;
@@ -6959,19 +6903,16 @@ static void __init __free_area_init_node/* pg_data_t should be reset to zero when it's allocated */ WARN_ON (pgdat->nr_zones || pgdat->kswapd_classzone_idx); +get_pfn_range_for_nid (nid, &start_pfn, &end_pfn); + pgdat->node_id = nid; - pgdat->node_start_pfn = node_start_pfn; + pgdat->node_start_pfn = start_pfn; pgdat->per_cpu_nodestats =NULL ; -if (!compat) { -get_pfn_range_for_nid (nid, &start_pfn, &end_pfn); -pr_info ("Initmem setup node %d [mem %#018Lx-%#018Lx]\n" , nid, - (u64 )start_pfn <<PAGE_SHIFT , - end_pfn ? ((u64 )end_pfn <<PAGE_SHIFT ) -1 :0 ); - }else { - start_pfn = node_start_pfn; - } -calculate_node_totalpages (pgdat, start_pfn, end_pfn, - zones_size, zholes_size, compat); + +pr_info ("Initmem setup node %d [mem %#018Lx-%#018Lx]\n" , nid, + (u64 )start_pfn <<PAGE_SHIFT , + end_pfn ? ((u64 )end_pfn <<PAGE_SHIFT ) -1 :0 ); +calculate_node_totalpages (pgdat, start_pfn, end_pfn);alloc_node_mem_map (pgdat);pgdat_set_deferred_range (pgdat);
@@ -6981,7 +6922,7 @@ static void __init __free_area_init_nodevoid __init free_area_init_memoryless_node (int nid) { -__free_area_init_node (nid,NULL ,0 ,NULL , false); +free_area_init_node (nid); }#if !defined(CONFIG_FLAT_NODE_MEM_MAP )
@@ -7509,8 +7450,7 @@ void __init free_area_init(unsigned longinit_unavailable_mem ();for_each_online_node (nid) {pg_data_t *pgdat =NODE_DATA (nid); -__free_area_init_node (nid,NULL , -find_min_pfn_for_node (nid),NULL , false); +free_area_init_node (nid);/* Any memory on that node */ if (pgdat->node_present_pages)
_
Patches currently in -mm which might be from [email protected] are
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ mm-simplify-find_min_pfn_with_active_regions.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm: simplify find_min_pfn_with_active_regions() has been added to the -mm tree. Its filename is mm-simplify-find_min_pfn_with_active_regions.patch
The patch titled
Subject: mm: simplify find_min_pfn_with_active_regions()
has been added to the -mm tree. Its filename is
mm-simplify-find_min_pfn_with_active_regions.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-simplify-find_min_pfn_with_active_regions.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-simplify-find_min_pfn_with_active_regions.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: mm: simplify find_min_pfn_with_active_regions()
find_min_pfn_with_active_regions() calls find_min_pfn_for_node() with nid parameter set to MAX_NUMNODES. This makes the find_min_pfn_for_node() traverse all memblock memory regions although the first PFN in the system can be easily found with memblock_start_of_DRAM().
Use memblock_start_of_DRAM() in find_min_pfn_with_active_regions() and drop now unused find_min_pfn_for_node().
---
mm/page_alloc.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-)
mm/page_alloc.c renamed from mm/page_alloc.c~mm-simplify-find_min_pfn_with_active_regions +1 -19
@@ -7071,24 +7071,6 @@ unsigned long __init node_map_pfn_alignmreturn ~accl_mask +1 ; } -/* Find the lowest pfn for a node */ -static unsigned long __init find_min_pfn_for_node (int nid) -{ -unsigned long min_pfn =ULONG_MAX ; -unsigned long start_pfn; -int i; - -for_each_mem_pfn_range (i, nid, &start_pfn,NULL ,NULL ) - min_pfn =min (min_pfn, start_pfn); - -if (min_pfn ==ULONG_MAX ) { -pr_warn ("Could not find start_pfn for node %d\n" , nid); -return 0 ; - } - -return min_pfn; -} -/** * find_min_pfn_with_active_regions - Find the minimum PFN registered *
@@ -7097,7 +7079,7 @@ static unsigned long __init find_min_pfn*/ unsigned long __init find_min_pfn_with_active_regions (void ) { -return find_min_pfn_for_node (MAX_NUMNODES ); +return PHYS_PFN (memblock_start_of_DRAM ()); }/*
_
Patches currently in -mm which might be from [email protected] are
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ docs-vm-update-memory-models-documentation.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: docs/vm: update memory-models documentation has been added to the -mm tree. Its filename is docs-vm-update-memory-models-documentation.patch
The patch titled
Subject: docs/vm: update memory-models documentation
has been added to the -mm tree. Its filename is
docs-vm-update-memory-models-documentation.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/docs-vm-update-memory-models-documentation.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/docs-vm-update-memory-models-documentation.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: docs/vm: update memory-models documentation
To reflect the updates to free_area_init() family of functions.
---
Documentation/vm/memory-model.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
Documentation/vm/memory-model.rst renamed from Documentation/vm/memory-model.rst~docs-vm-update-memory-models-documentation +4 -5
@@ -46,11 +46,10 @@ maps the entire physical memory. For mos have entries in the `mem_map` array. The `struct page` objects corresponding to the holes are never fully initialized. -To allocate the `mem_map` array, architecture specific setup code -should call :c:func:`free_area_init_node` function or its convenience -wrapper :c:func:`free_area_init`. Yet, the mappings array is not -usable until the call to :c:func:`memblock_free_all` that hands all -the memory to the page allocator. +To allocate the `mem_map` array, architecture specific setup code should +call :c:func:`free_area_init` function. Yet, the mappings array is not +usable until the call to :c:func:`memblock_free_all` that hands all the +memory to the page allocator. If an architecture enables `CONFIG_ARCH_HAS_HOLES_MEMORYMODEL` option, it may free parts of the `mem_map` array that do not cover the
_
Patches currently in -mm which might be from [email protected] are
mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ mm-page_allocc-bad_-is-not-necessary-when-pagehwpoison.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm/page_alloc.c: bad_[reason|flags] is not necessary when PageHWPoison has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm/page_alloc.c: bad_[reason|flags] is not necessary when PageHWPoison
has been added to the -mm tree. Its filename is
mm-page_allocc-bad_-is-not-necessary-when-pagehwpoison.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-page_allocc-bad_-is-not-necessary-when-pagehwpoison.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-page_allocc-bad_-is-not-necessary-when-pagehwpoison.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Wei Yang <[email protected]>
Subject: mm/page_alloc.c: bad_[reason|flags] is not necessary when PageHWPoison
Patch series "mm/page_alloc.c: cleanup on check page", v3.
This patchset does some cleanup related to check page.
1. Remove unnecessary bad_reason assignment
2. Remove bad_flags to bad_page()
3. Rename function for naming convention
4. Extract common part to check page
Thanks for suggestions from David Rientjes and Anshuman Khandual.
This patch (of 5):
Since function returns directly, bad_[reason|flags] is not used any where. And move this to the first.
This is a following cleanup for commit e570f56cccd21 ("mm:check_new_page_bad() directly returns in __PG_HWPOISON case")
---
mm/page_alloc.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
mm/page_alloc.c renamed from mm/page_alloc.c~mm-page_allocc-bad_-is-not-necessary-when-pagehwpoison +5 -7
@@ -2096,19 +2096,17 @@ static void check_new_page_bad(struct paconst char *bad_reason =NULL ;unsigned long bad_flags =0 ; +if (unlikely (page->flags & __PG_HWPOISON)) { +/* Don't complain about hwpoisoned pages */ +page_mapcount_reset (page);/* remove PageBuddy */ +return ; + }if (unlikely (atomic_read (&page->_mapcount) !=-1 )) bad_reason ="nonzero mapcount" ;if (unlikely (page->mapping !=NULL )) bad_reason ="non-NULL mapping" ;if (unlikely (page_ref_count (page) !=0 )) bad_reason ="nonzero _refcount" ; -if (unlikely (page->flags & __PG_HWPOISON)) { - bad_reason ="HWPoisoned (hardware-corrupted)" ; - bad_flags = __PG_HWPOISON; -/* Don't complain about hwpoisoned pages */ -page_mapcount_reset (page);/* remove PageBuddy */ -return ; - }if (unlikely (page->flags &PAGE_FLAGS_CHECK_AT_PREP )) { bad_reason ="PAGE_FLAGS_CHECK_AT_PREP flag set" ; bad_flags =PAGE_FLAGS_CHECK_AT_PREP ;
_
Patches currently in -mm which might be from [email protected] are
mm-page_allocc-bad_-is-not-necessary-when-pagehwpoison.patch mm-page_allocc-bad_flags-is-not-necessary-for-bad_page.patch mm-page_allocc-rename-free_pages_check_bad-to-check_free_page_bad.patch mm-page_allocc-rename-free_pages_check-to-check_free_page.patch mm-page_allocc-extract-check__page_bad-common-part-to-page_bad_reason.patch
+ mm-page_allocc-bad_flags-is-not-necessary-for-bad_page.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm/page_alloc.c: bad_flags is not necessary for bad_page() has been added to the -mm tree. Its filename is mm-page_allocc-bad_flags-is-not-necessary-for-bad_page.patch
The patch titled
Subject: mm/page_alloc.c: bad_flags is not necessary for bad_page()
has been added to the -mm tree. Its filename is
mm-page_allocc-bad_flags-is-not-necessary-for-bad_page.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-page_allocc-bad_flags-is-not-necessary-for-bad_page.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-page_allocc-bad_flags-is-not-necessary-for-bad_page.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Wei Yang <[email protected]>
Subject: mm/page_alloc.c: bad_flags is not necessary for bad_page()
After commit 5b57b8f22709 ("mm/debug.c: always print flags in dump_page()"), page->flags is always printed for a bad page. It is not necessary to have bad_flags any more.
---
mm/page_alloc.c | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-)
mm/page_alloc.c renamed from mm/page_alloc.c~mm-page_allocc-bad_flags-is-not-necessary-for-bad_page +10 -24
@@ -607,8 +607,7 @@ static inline int __maybe_unused bad_ran }#endif -static void bad_page (struct page *page,const char *reason, -unsigned long bad_flags) +static void bad_page (struct page *page,const char *reason) {static unsigned long resume;static unsigned long nr_shown;
@@ -637,10 +636,6 @@ static void bad_page(struct page *page,pr_alert ("BUG: Bad page state in process %s pfn:%05lx\n" , current->comm,page_to_pfn (page));__dump_page (page, reason); - bad_flags &= page->flags; -if (bad_flags) -pr_alert ("bad because of flags: %#lx(%pGp)\n" , - bad_flags, &bad_flags);dump_page_owner (page);print_modules ();
@@ -1077,11 +1072,7 @@ static inline bool page_expected_state(sstatic void free_pages_check_bad (struct page *page) { -const char *bad_reason; -unsigned long bad_flags; - - bad_reason =NULL ; - bad_flags =0 ; +const char *bad_reason =NULL ;if (unlikely (atomic_read (&page->_mapcount) !=-1 )) bad_reason ="nonzero mapcount" ;
@@ -1089,15 +1080,13 @@ static void free_pages_check_bad(struct bad_reason ="non-NULL mapping" ;if (unlikely (page_ref_count (page) !=0 )) bad_reason ="nonzero _refcount" ; -if (unlikely (page->flags &PAGE_FLAGS_CHECK_AT_FREE )) { +if (unlikely (page->flags &PAGE_FLAGS_CHECK_AT_FREE )) bad_reason ="PAGE_FLAGS_CHECK_AT_FREE flag(s) set" ; - bad_flags =PAGE_FLAGS_CHECK_AT_FREE ; - }#ifdef CONFIG_MEMCG if (unlikely (page->mem_cgroup)) bad_reason ="page still charged to cgroup" ;#endif -bad_page (page, bad_reason, bad_flags); +bad_page (page, bad_reason); }static inline int free_pages_check (struct page *page)
@@ -1128,7 +1117,7 @@ static int free_tail_pages_check(structcase 1 :/* the first tail page: ->mapping may be compound_mapcount() */ if (unlikely (compound_mapcount (page))) { -bad_page (page,"nonzero compound_mapcount" ,0 ); +bad_page (page,"nonzero compound_mapcount" ); goto out; }break ;
@@ -1140,17 +1129,17 @@ static int free_tail_pages_check(structbreak ;default :if (page->mapping !=TAIL_MAPPING ) { -bad_page (page,"corrupted mapping in tail page" ,0 ); +bad_page (page,"corrupted mapping in tail page" ); goto out; }break ; }if (unlikely (!PageTail (page))) { -bad_page (page,"PageTail not set" ,0 ); +bad_page (page,"PageTail not set" ); goto out; }if (unlikely (compound_head (page) != head_page)) { -bad_page (page,"compound_head not consistent" ,0 ); +bad_page (page,"compound_head not consistent" ); goto out; } ret =0 ;
@@ -2094,7 +2083,6 @@ static inline void expand(struct zone *zstatic void check_new_page_bad (struct page *page) {const char *bad_reason =NULL ; -unsigned long bad_flags =0 ;if (unlikely (page->flags & __PG_HWPOISON)) {/* Don't complain about hwpoisoned pages */
@@ -2107,15 +2095,13 @@ static void check_new_page_bad(struct pa bad_reason ="non-NULL mapping" ;if (unlikely (page_ref_count (page) !=0 )) bad_reason ="nonzero _refcount" ; -if (unlikely (page->flags &PAGE_FLAGS_CHECK_AT_PREP )) { +if (unlikely (page->flags &PAGE_FLAGS_CHECK_AT_PREP )) bad_reason ="PAGE_FLAGS_CHECK_AT_PREP flag set" ; - bad_flags =PAGE_FLAGS_CHECK_AT_PREP ; - }#ifdef CONFIG_MEMCG if (unlikely (page->mem_cgroup)) bad_reason ="page still charged to cgroup" ;#endif -bad_page (page, bad_reason, bad_flags); +bad_page (page, bad_reason); }/*
_
Patches currently in -mm which might be from [email protected] are
mm-page_allocc-bad_-is-not-necessary-when-pagehwpoison.patch mm-page_allocc-bad_flags-is-not-necessary-for-bad_page.patch mm-page_allocc-rename-free_pages_check_bad-to-check_free_page_bad.patch mm-page_allocc-rename-free_pages_check-to-check_free_page.patch mm-page_allocc-extract-check__page_bad-common-part-to-page_bad_reason.patch
+ mm-page_allocc-rename-free_pages_check_bad-to-check_free_page_bad.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm/page_alloc.c: rename free_pages_check_bad() to check_free_page_bad() has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm/page_alloc.c: rename free_pages_check_bad() to check_free_page_bad()
has been added to the -mm tree. Its filename is
mm-page_allocc-rename-free_pages_check_bad-to-check_free_page_bad.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-page_allocc-rename-free_pages_check_bad-to-check_free_page_bad.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-page_allocc-rename-free_pages_check_bad-to-check_free_page_bad.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Wei Yang <[email protected]>
Subject: mm/page_alloc.c: rename free_pages_check_bad() to check_free_page_bad()
free_pages_check_bad() is the counterpart of check_new_page_bad(). Rename it to use the same naming convention.
---
mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c renamed from mm/page_alloc.c~mm-page_allocc-rename-free_pages_check_bad-to-check_free_page_bad +2 -2
@@ -1070,7 +1070,7 @@ static inline bool page_expected_state(sreturn true; } -static void free_pages_check_bad (struct page *page) +static void check_free_page_bad (struct page *page) {const char *bad_reason =NULL ;
@@ -1095,7 +1095,7 @@ static inline int free_pages_check(strucreturn 0 ;/* Something has gone sideways, find it */ -free_pages_check_bad (page); +check_free_page_bad (page);return 1 ; }
_
Patches currently in -mm which might be from [email protected] are
mm-page_allocc-bad_-is-not-necessary-when-pagehwpoison.patch mm-page_allocc-bad_flags-is-not-necessary-for-bad_page.patch mm-page_allocc-rename-free_pages_check_bad-to-check_free_page_bad.patch mm-page_allocc-rename-free_pages_check-to-check_free_page.patch mm-page_allocc-extract-check__page_bad-common-part-to-page_bad_reason.patch
+ mm-page_allocc-rename-free_pages_check-to-check_free_page.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm/page_alloc.c: rename free_pages_check() to check_free_page() has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm/page_alloc.c: rename free_pages_check() to check_free_page()
has been added to the -mm tree. Its filename is
mm-page_allocc-rename-free_pages_check-to-check_free_page.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-page_allocc-rename-free_pages_check-to-check_free_page.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-page_allocc-rename-free_pages_check-to-check_free_page.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Wei Yang <[email protected]>
Subject: mm/page_alloc.c: rename free_pages_check() to check_free_page()
free_pages_check() is the counterpart of check_new_page(). Rename it to use the same naming convention.
---
mm/page_alloc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
mm/page_alloc.c renamed from mm/page_alloc.c~mm-page_allocc-rename-free_pages_check-to-check_free_page +5 -5
@@ -1089,7 +1089,7 @@ static void check_free_page_bad(struct pbad_page (page, bad_reason); } -static inline int free_pages_check (struct page *page) +static inline int check_free_page (struct page *page) {if (likely (page_expected_state (page,PAGE_FLAGS_CHECK_AT_FREE )))return 0 ;
@@ -1181,7 +1181,7 @@ static __always_inline bool free_pages_pfor (i =1 ; i < (1 << order); i++) {if (compound) bad +=free_tail_pages_check (page, page + i); -if (unlikely (free_pages_check (page + i))) { +if (unlikely (check_free_page (page + i))) { bad++;continue ; }
@@ -1193,7 +1193,7 @@ static __always_inline bool free_pages_pif (memcg_kmem_enabled () &&PageKmemcg (page))__memcg_kmem_uncharge_page (page, order);if (check_free) - bad +=free_pages_check (page); + bad +=check_free_page (page);if (bad)return false;
@@ -1240,7 +1240,7 @@ static bool free_pcp_prepare(struct pagestatic bool bulkfree_pcp_prepare (struct page *page) {if (debug_pagealloc_enabled_static ()) -return free_pages_check (page); +return check_free_page (page);else return false; }
@@ -1261,7 +1261,7 @@ static bool free_pcp_prepare(struct pagestatic bool bulkfree_pcp_prepare (struct page *page) { -return free_pages_check (page); +return check_free_page (page); }#endif /* CONFIG_DEBUG_VM */
_
Patches currently in -mm which might be from [email protected] are
mm-page_allocc-bad_-is-not-necessary-when-pagehwpoison.patch mm-page_allocc-bad_flags-is-not-necessary-for-bad_page.patch mm-page_allocc-rename-free_pages_check_bad-to-check_free_page_bad.patch mm-page_allocc-rename-free_pages_check-to-check_free_page.patch mm-page_allocc-extract-check__page_bad-common-part-to-page_bad_reason.patch
+ mm-page_allocc-extract-check__page_bad-common-part-to-page_bad_reason.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm/page_alloc.c: extract check_[new|free]_page_bad() common part to page_bad_reason() has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm/page_alloc.c: extract check_[new|free]_page_bad() common part to page_bad_reason()
has been added to the -mm tree. Its filename is
mm-page_allocc-extract-check__page_bad-common-part-to-page_bad_reason.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-page_allocc-extract-check__page_bad-common-part-to-page_bad_reason.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-page_allocc-extract-check__page_bad-common-part-to-page_bad_reason.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Wei Yang <[email protected]>
Subject: mm/page_alloc.c: extract check_[new|free]_page_bad() common part to page_bad_reason()
We share similar code in check_[new|free]_page_bad() to get the page's bad reason.
Let's extract it and reduce code duplication.
---
mm/page_alloc.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-)
mm/page_alloc.c renamed from mm/page_alloc.c~mm-page_allocc-extract-check__page_bad-common-part-to-page_bad_reason +17 -19
@@ -1070,7 +1070,7 @@ static inline bool page_expected_state(sreturn true; } -static void check_free_page_bad (struct page *page) +static const char *page_bad_reason (struct page *page,unsigned long flags) {const char *bad_reason =NULL ;
@@ -1080,13 +1080,23 @@ static void check_free_page_bad(struct p bad_reason ="non-NULL mapping" ;if (unlikely (page_ref_count (page) !=0 )) bad_reason ="nonzero _refcount" ; -if (unlikely (page->flags &PAGE_FLAGS_CHECK_AT_FREE )) - bad_reason ="PAGE_FLAGS_CHECK_AT_FREE flag(s) set" ; +if (unlikely (page->flags & flags)) { +if (flags ==PAGE_FLAGS_CHECK_AT_PREP ) + bad_reason ="PAGE_FLAGS_CHECK_AT_PREP flag(s) set" ; +else + bad_reason ="PAGE_FLAGS_CHECK_AT_FREE flag(s) set" ; + }#ifdef CONFIG_MEMCG if (unlikely (page->mem_cgroup)) bad_reason ="page still charged to cgroup" ;#endif -bad_page (page, bad_reason); +return bad_reason; +} + +static void check_free_page_bad (struct page *page) +{ +bad_page (page, +page_bad_reason (page,PAGE_FLAGS_CHECK_AT_FREE )); }static inline int check_free_page (struct page *page)
@@ -2082,26 +2092,14 @@ static inline void expand(struct zone *zstatic void check_new_page_bad (struct page *page) { -const char *bad_reason =NULL ; -if (unlikely (page->flags & __PG_HWPOISON)) {/* Don't complain about hwpoisoned pages */ page_mapcount_reset (page);/* remove PageBuddy */ return ; } -if (unlikely (atomic_read (&page->_mapcount) !=-1 )) - bad_reason ="nonzero mapcount" ; -if (unlikely (page->mapping !=NULL )) - bad_reason ="non-NULL mapping" ; -if (unlikely (page_ref_count (page) !=0 )) - bad_reason ="nonzero _refcount" ; -if (unlikely (page->flags &PAGE_FLAGS_CHECK_AT_PREP )) - bad_reason ="PAGE_FLAGS_CHECK_AT_PREP flag set" ; -#ifdef CONFIG_MEMCG -if (unlikely (page->mem_cgroup)) - bad_reason ="page still charged to cgroup" ; -#endif -bad_page (page, bad_reason); + +bad_page (page, +page_bad_reason (page,PAGE_FLAGS_CHECK_AT_PREP )); }/*
_
Patches currently in -mm which might be from [email protected] are
mm-page_allocc-bad_-is-not-necessary-when-pagehwpoison.patch mm-page_allocc-bad_flags-is-not-necessary-for-bad_page.patch mm-page_allocc-rename-free_pages_check_bad-to-check_free_page_bad.patch mm-page_allocc-rename-free_pages_check-to-check_free_page.patch mm-page_allocc-extract-check__page_bad-common-part-to-page_bad_reason.patch
+ dynamic_debug-add-an-option-to-enable-dynamic-debug-for-modules-only.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: dynamic_debug: add an option to enable dynamic debug for modules only has been added to the -mm tree. Its filename is…
The patch titled
Subject: dynamic_debug: add an option to enable dynamic debug for modules only
has been added to the -mm tree. Its filename is
dynamic_debug-add-an-option-to-enable-dynamic-debug-for-modules-only.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/dynamic_debug-add-an-option-to-enable-dynamic-debug-for-modules-only.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/dynamic_debug-add-an-option-to-enable-dynamic-debug-for-modules-only.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Orson Zhai <[email protected]>
Subject: dynamic_debug: add an option to enable dynamic debug for modules only
Instead of enabling dynamic debug globally with CONFIG_DYNAMIC_DEBUG, CONFIG_DYNAMIC_DEBUG_CORE will only enable core function of dynamic debug. With the DEBUG_MODULE defined for any modules, dynamic debug will be tied to them.
This is useful for people who only want to enable dynamic debug for kernel modules without worrying about kernel image size and memory consumption increasing too much.
---
Documentation/admin-guide/dynamic-debug-howto.rst | 7 ++++-- include/linux/dev_printk.h | 6 +++-- include/linux/dynamic_debug.h | 2 - include/linux/printk.h | 14 +++++++----- lib/Kconfig.debug | 12 ++++++++++ lib/Makefile | 2 - lib/dynamic_debug.c | 9 ++++++- 7 files changed, 39 insertions(+), 13 deletions(-)
Documentation/admin-guide/dynamic-debug-howto.rst renamed from Documentation/admin-guide/dynamic-debug-howto.rst~dynamic_debug-add-an-option-to-enable-dynamic-debug-for-modules-only +5 -2
@@ -13,8 +13,11 @@ kernel code to obtain additional kernel ``print_hex_dump_debug()``/``print_hex_dump_bytes()`` calls can be dynamically enabled per-callsite. -If ``CONFIG_DYNAMIC_DEBUG`` is not set, ``print_hex_dump_debug()`` is just -shortcut for ``print_hex_dump(KERN_DEBUG)``. +If ``CONFIG_DYNAMIC_DEBUG_CORE`` is set, only the modules with ``DEBUG_MODULE`` +defined will be tied into dynamic debug. + +If ``CONFIG_DYNAMIC_DEBUG`` or ``CONFIG_DYNAMIC_DEBUG_CORE`` is not set, +``print_hex_dump_debug()`` is just shortcut for ``print_hex_dump(KERN_DEBUG)``. For ``print_hex_dump_debug()``/``print_hex_dump_bytes()``, format string is its ``prefix_str`` argument, if it is constant string; or ``hexdump``
include/linux/dev_printk.h renamed from include/linux/dev_printk.h~dynamic_debug-add-an-option-to-enable-dynamic-debug-for-modules-only +4 -2
@@ -109,7 +109,8 @@ void _dev_info(const struct device *dev,#define dev_info (dev, fmt, ...) \ _dev_info(dev, dev_fmt(fmt), ##__VA_ARGS__) -#if defined(CONFIG_DYNAMIC_DEBUG ) +#if defined(CONFIG_DYNAMIC_DEBUG ) || \ + (defined(CONFIG_DYNAMIC_DEBUG_CORE ) && defined(DEBUG_MODULE ))#define dev_dbg (dev, fmt, ...) \ dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)#elif defined(DEBUG )
@@ -181,7 +182,8 @@ do { \ dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__)#define dev_info_ratelimited (dev, fmt, ...) \ dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__) -#if defined(CONFIG_DYNAMIC_DEBUG ) +#if defined(CONFIG_DYNAMIC_DEBUG ) || \ + (defined(CONFIG_DYNAMIC_DEBUG_CORE ) && defined(DEBUG_MODULE ))/* descriptor check is first to prevent flooding with "callbacks suppressed" */ #define dev_dbg_ratelimited (dev, fmt, ...) \ do { \
include/linux/dynamic_debug.h renamed from include/linux/dynamic_debug.h~dynamic_debug-add-an-option-to-enable-dynamic-debug-for-modules-only +1 -1
@@ -48,7 +48,7 @@ struct _ddebug { -#if defined(CONFIG_DYNAMIC_DEBUG ) +#if defined(CONFIG_DYNAMIC_DEBUG_CORE )int ddebug_add_module (struct _ddebug *tab,unsigned int n,const char *modname);extern int ddebug_remove_module (const char *mod_name);
include/linux/printk.h renamed from include/linux/printk.h~dynamic_debug-add-an-option-to-enable-dynamic-debug-for-modules-only +9 -5
@@ -286,8 +286,9 @@ extern int kptr_restrict;/* * These can be used to print at the various log levels. * All of these will print unconditionally, although note that pr_debug() -* and other debug macros are compiled out unless either DEBUG is defined -* or CONFIG_DYNAMIC_DEBUG is set. +* and other debug macros are compiled out unless either DEBUG is defined, +* CONFIG_DYNAMIC_DEBUG is set, or CONFIG_DYNAMIC_DEBUG_CORE is set when +* DEBUG_MODULE being defined for any modules. */ #define pr_emerg (fmt, ...) \ printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
@@ -322,7 +323,8 @@ extern int kptr_restrict;/* If you are writing a driver, please use dev_dbg instead */ -#if defined(CONFIG_DYNAMIC_DEBUG ) +#if defined(CONFIG_DYNAMIC_DEBUG ) || \ + (defined(CONFIG_DYNAMIC_DEBUG_CORE ) && defined(DEBUG_MODULE ))#include <linux/dynamic_debug.h> /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */
@@ -448,7 +450,8 @@ extern int kptr_restrict;#endif /* If you are writing a driver, please use dev_dbg instead */ -#if defined(CONFIG_DYNAMIC_DEBUG ) +#if defined(CONFIG_DYNAMIC_DEBUG ) || \ + (defined(CONFIG_DYNAMIC_DEBUG_CORE ) && defined(DEBUG_MODULE ))/* descriptor check is first to prevent flooding with "callbacks suppressed" */ #define pr_debug_ratelimited (fmt, ...) \ do { \
@@ -495,7 +498,8 @@ static inline void print_hex_dump_bytes(#endif -#if defined(CONFIG_DYNAMIC_DEBUG ) +#if defined(CONFIG_DYNAMIC_DEBUG ) || \ + (defined(CONFIG_DYNAMIC_DEBUG_CORE ) && defined(DEBUG_MODULE ))#define print_hex_dump_debug (prefix_str, prefix_type, rowsize, \ groupsize, buf, len, ascii) \ dynamic_hex_dump(prefix_str, prefix_type, rowsize, \
lib/dynamic_debug.c renamed from lib/dynamic_debug.c~dynamic_debug-add-an-option-to-enable-dynamic-debug-for-modules-only +7 -2
@@ -1032,8 +1032,13 @@ static int __init dynamic_debug_init(voiint verbose_bytes =0 ;if (&__start___verbose == &__stop___verbose) { -pr_warn ("_ddebug table is empty in a CONFIG_DYNAMIC_DEBUG build\n" ); -return 1 ; +if (IS_ENABLED (CONFIG_DYNAMIC_DEBUG )) { +pr_warn ("_ddebug table is empty in a CONFIG_DYNAMIC_DEBUG build\n" ); +return 1 ; + } +pr_info ("Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build\n" ); + ddebug_init_success =1 ; +return 0 ; } iter = __start___verbose; modname = iter->modname;
lib/Kconfig.debug renamed from lib/Kconfig.debug~dynamic_debug-add-an-option-to-enable-dynamic-debug-for-modules-only +12 -0
@@ -99,6 +99,7 @@ config DYNAMIC_DEBUG default n depends on PRINTK depends on (DEBUG_FS || PROC_FS) + select DYNAMIC_DEBUG_CORE help Compiles debug level messages into the kernel, which would not
@@ -165,6 +166,17 @@ config DYNAMIC_DEBUG See Documentation/admin-guide/dynamic-debug-howto.rst for additional information. +config DYNAMIC_DEBUG_CORE + bool "Enable core function of dynamic debug support" + depends on PRINTK + depends on (DEBUG_FS || PROC_FS) + help + Enable core functional support of dynamic debug. It is useful + when you want to tie dynamic debug to your kernel modules with + DEBUG_MODULE defined for each of them, especially for the case + of embedded system where the kernel image size is sensitive for + people. + config SYMBOLIC_ERRNAME bool "Support symbolic error names in printf" default y if PRINTK
lib/Makefile renamed from lib/Makefile~dynamic_debug-add-an-option-to-enable-dynamic-debug-for-modules-only +1 -1
@@ -186,7 +186,7 @@ lib-$(CONFIG_GENERIC_BUG) += bug.o obj-$(CONFIG_HAVE_ARCH_TRACEHOOK) += syscall.o -obj-$(CONFIG_DYNAMIC_DEBUG) += dynamic_debug.o +obj-$(CONFIG_DYNAMIC_DEBUG_CORE) += dynamic_debug.o obj-$(CONFIG_SYMBOLIC_ERRNAME) += errname.o obj-$(CONFIG_NLATTR) += nlattr.o
_
Patches currently in -mm which might be from [email protected] are
dynamic_debug-add-an-option-to-enable-dynamic-debug-for-modules-only.patch
+ mm-gup-return-eintr-when-gup-is-interrupted-by-fatal-signals.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm, gup: return EINTR when gup is interrupted by fatal signals has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm, gup: return EINTR when gup is interrupted by fatal signals
has been added to the -mm tree. Its filename is
mm-gup-return-eintr-when-gup-is-interrupted-by-fatal-signals.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-gup-return-eintr-when-gup-is-interrupted-by-fatal-signals.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-gup-return-eintr-when-gup-is-interrupted-by-fatal-signals.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Michal Hocko <[email protected]>
Subject: mm, gup: return EINTR when gup is interrupted by fatal signals
EINTR is the usual error code which other killable interfaces return. This is the case for the other fatal_signal_pending break out from the same function. Make the code consistent.
ERESTARTSYS is also quite confusing because the signal is fatal and so no restart will happen before returning to the userspace.
---
mm/gup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/gup.c renamed from mm/gup.c~mm-gup-return-eintr-when-gup-is-interrupted-by-fatal-signals +1 -1
@@ -1088,7 +1088,7 @@ retry:* potentially allocating memory. */ if (fatal_signal_pending (current)) { - ret = -ERESTARTSYS ; + ret = -EINTR ; goto out; }cond_resched ();
_
Patches currently in -mm which might be from [email protected] are
mm-gup-return-eintr-when-gup-is-interrupted-by-fatal-signals.patch mm-clarify-__gfp_memalloc-usage.patch
+ squashfs-squashfs_fsh-replace-zero-length-array-with-flexible-array-member.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: fs/squashfs/squashfs_fs.h: replace zero-length array with flexible-array member has been added to the -mm tree. Its filename is…
The patch titled
Subject: fs/squashfs/squashfs_fs.h: replace zero-length array with flexible-array member
has been added to the -mm tree. Its filename is
squashfs-squashfs_fsh-replace-zero-length-array-with-flexible-array-member.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/squashfs-squashfs_fsh-replace-zero-length-array-with-flexible-array-member.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/squashfs-squashfs_fsh-replace-zero-length-array-with-flexible-array-member.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: "Gustavo A. R. Silva" <[email protected]>
Subject: fs/squashfs/squashfs_fs.h: replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99:
struct foo {
int stuff;
struct boo array[];
};By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on.
Also, notice that dynamic memory allocations won't be affected by this change:
"Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1]
This issue was found with the help of Coccinelle.
[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")
---
fs/squashfs/squashfs_fs.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
fs/squashfs/squashfs_fs.h renamed from fs/squashfs/squashfs_fs.h~squashfs-squashfs_fsh-replace-zero-length-array-with-flexible-array-member +8 -8
@@ -262,7 +262,7 @@ struct squashfs_dir_index {__le32 index;__le32 start_block;__le32 size; -unsigned char name[0 ]; +unsigned char name[]; };struct squashfs_base_inode {
@@ -327,7 +327,7 @@ struct squashfs_symlink_inode {__le32 inode_number;__le32 nlink;__le32 symlink_size; -char symlink[0 ]; +char symlink[]; };struct squashfs_reg_inode {
@@ -341,7 +341,7 @@ struct squashfs_reg_inode {__le32 fragment;__le32 offset;__le32 file_size; -__le16 block_list[0 ]; +__le16 block_list[]; };struct squashfs_lreg_inode {
@@ -358,7 +358,7 @@ struct squashfs_lreg_inode {__le32 fragment;__le32 offset;__le32 xattr; -__le16 block_list[0 ]; +__le16 block_list[]; };struct squashfs_dir_inode {
@@ -389,7 +389,7 @@ struct squashfs_ldir_inode {__le16 i_count;__le16 offset;__le32 xattr; -struct squashfs_dir_index index[0 ]; +struct squashfs_dir_index index[]; };union squashfs_inode {
@@ -410,7 +410,7 @@ struct squashfs_dir_entry {__le16 inode_number;__le16 type;__le16 size; -char name[0 ]; +char name[]; };struct squashfs_dir_header {
@@ -428,12 +428,12 @@ struct squashfs_fragment_entry {struct squashfs_xattr_entry {__le16 type;__le16 size; -char data[0 ]; +char data[]; };struct squashfs_xattr_val {__le32 vsize; -char value[0 ]; +char value[]; };struct squashfs_xattr_id {
_
Patches currently in -mm which might be from [email protected] are
squashfs-squashfs_fsh-replace-zero-length-array-with-flexible-array-member.patch
+ squashfs-migrate-from-ll_rw_block-usage-to-bio.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: squashfs: migrate from ll_rw_block usage to BIO has been added to the -mm tree. Its filename is squashfs-migrate-from-ll_rw_block-usage-to-bio.patch
The patch titled
Subject: squashfs: migrate from ll_rw_block usage to BIO
has been added to the -mm tree. Its filename is
squashfs-migrate-from-ll_rw_block-usage-to-bio.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/squashfs-migrate-from-ll_rw_block-usage-to-bio.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/squashfs-migrate-from-ll_rw_block-usage-to-bio.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Philippe Liard <[email protected]>
Subject: squashfs: migrate from ll_rw_block usage to BIO
ll_rw_block() function has been deprecated in favor of BIO which appears to come with large performance improvements.
This patch decreases boot time by close to 40% when using squashfs for the root file-system. This is observed at least in the context of starting an Android VM on Chrome OS using crosvm
(https://chromium.googlesource.com/chromiumos/platform/crosvm). The patch was tested on 4.19 as well as master.
This patch is largely based on Adrien Schildknecht's patch that was originally sent as https://lkml.org/lkml/2017/9/22/814 though with some significant changes and simplifications while also taking Phillip Lougher's feedback into account, around preserving support for FILE_CACHE in particular.
---
fs/squashfs/block.c | 273 ++++++++++++++-------------- fs/squashfs/decompressor.h | 5 fs/squashfs/decompressor_multi.c | 9 fs/squashfs/decompressor_single.c | 9 fs/squashfs/lz4_wrapper.c | 17 + fs/squashfs/lzo_wrapper.c | 17 + fs/squashfs/squashfs.h | 4 fs/squashfs/xz_wrapper.c | 51 ++--- fs/squashfs/zlib_wrapper.c | 63 +++--- fs/squashfs/zstd_wrapper.c | 62 +++--- 10 files changed, 276 insertions(+), 234 deletions(-)
fs/squashfs/block.c renamed from fs/squashfs/block.c~squashfs-migrate-from-ll_rw_block-usage-to-bio +146 -127
@@ -13,6 +13,7 @@* datablocks and metadata blocks. */ +#include <linux/blkdev.h> #include <linux/fs.h> #include <linux/vfs.h> #include <linux/slab.h>
@@ -27,45 +28,104 @@#include "page_actor.h" /* -* Read the metadata block length, this is stored in the first two -* bytes of the metadata block. +* Returns the amount of bytes copied to the page actor. */ -static struct buffer_head *get_block_length (struct super_block *sb, -u64 *cur_index,int *offset,int *length) +static int copy_bio_to_actor (struct bio *bio, +struct squashfs_page_actor *actor, +int offset,int req_length) +{ +void *actor_addr =squashfs_first_page (actor); +struct bvec_iter_all iter_all = {}; +struct bio_vec *bvec =bvec_init_iter_all (&iter_all); +int copied_bytes =0 ; +int actor_offset =0 ; + +if (WARN_ON_ONCE (!bio_next_segment (bio, &iter_all))) +return 0 ; + +while (copied_bytes < req_length) { +int bytes_to_copy =min_t (int, bvec->bv_len - offset, +PAGE_SIZE - actor_offset); + + bytes_to_copy =min_t (int, bytes_to_copy, + req_length - copied_bytes); +memcpy (actor_addr + actor_offset, +page_address (bvec->bv_page) + bvec->bv_offset + offset, + bytes_to_copy); + + actor_offset += bytes_to_copy; + copied_bytes += bytes_to_copy; + offset += bytes_to_copy; + +if (actor_offset >=PAGE_SIZE ) { + actor_addr =squashfs_next_page (actor); +if (!actor_addr) +break ; + actor_offset =0 ; + } +if (offset >= bvec->bv_len) { +if (!bio_next_segment (bio, &iter_all)) +break ; + offset =0 ; + } + } +squashfs_finish_page (actor); +return copied_bytes; +} + +static int squashfs_bio_read (struct super_block *sb,u64 index,int length, +struct bio **biop,int *block_offset) {struct squashfs_sb_info *msblk = sb->s_fs_info; -struct buffer_head *bh; +const u64 read_start =round_down (index, msblk->devblksize); +const sector_t block = read_start >> msblk->devblksize_log2; +const u64 read_end =round_up (index + length, msblk->devblksize); +const sector_t block_end = read_end >> msblk->devblksize_log2; +int offset = read_start -round_down (index,PAGE_SIZE ); +int total_len = (block_end - block) << msblk->devblksize_log2; +const int page_count =DIV_ROUND_UP (total_len + offset,PAGE_SIZE ); +int error, i; +struct bio *bio; - bh =sb_bread (sb, *cur_index); -if (bh ==NULL ) -return NULL ; - -if (msblk->devblksize - *offset ==1 ) { - *length = (unsigned char ) bh->b_data[*offset]; -put_bh (bh); - bh =sb_bread (sb, ++(*cur_index)); -if (bh ==NULL ) -return NULL ; - *length |= (unsigned char ) bh->b_data[0 ] <<8 ; - *offset =1 ; - }else { - *length = (unsigned char ) bh->b_data[*offset] | - (unsigned char ) bh->b_data[*offset +1 ] <<8 ; - *offset +=2 ; - -if (*offset == msblk->devblksize) { -put_bh (bh); - bh =sb_bread (sb, ++(*cur_index)); -if (bh ==NULL ) -return NULL ; - *offset =0 ; + bio =bio_alloc (GFP_NOIO , page_count); +if (!bio) +return -ENOMEM ; + +bio_set_dev (bio, sb->s_bdev); + bio->bi_opf =READ ; + bio->bi_iter.bi_sector = block * (msblk->devblksize >>SECTOR_SHIFT ); + +for (i =0 ; i < page_count; ++i) { +unsigned int len = + min_t(unsigned int, PAGE_SIZE - offset, total_len); +struct page *page =alloc_page (GFP_NOIO ); + +if (!page) { + error = -ENOMEM ; + goto out_free_bio; } +if (!bio_add_page (bio, page, len, offset)) { + error = -EIO ; + goto out_free_bio; + } + offset =0 ; + total_len -= len; } -return bh; + error =submit_bio_wait (bio); +if (error) + goto out_free_bio; + + *biop = bio; + *block_offset = index & ((1 << msblk->devblksize_log2) -1 ); +return 0 ; + +out_free_bio: +bio_free_pages (bio); +bio_put (bio); +return error; } -/* * Read and decompress a metadata block or datablock. Length is non-zero * if a datablock is being read (the size is stored elsewhere in the
@@ -76,129 +136,88 @@ static struct buffer_head *get_block_len* algorithms). */ int squashfs_read_data (struct super_block *sb,u64 index,int length, -u64 *next_index,struct squashfs_page_actor *output) +u64 *next_index,struct squashfs_page_actor *output) {struct squashfs_sb_info *msblk = sb->s_fs_info; -struct buffer_head **bh; -int offset = index & ((1 << msblk->devblksize_log2) -1 ); -u64 cur_index = index >> msblk->devblksize_log2; -int bytes, compressed, b =0 , k =0 , avail, i; - - bh =kcalloc (((output->length + msblk->devblksize -1 ) - >> msblk->devblksize_log2) +1 ,sizeof (*bh),GFP_KERNEL ); -if (bh ==NULL ) -return -ENOMEM ; +struct bio *bio =NULL ; +int compressed; +int res; +int offset;if (length) {/* * Datablock. */ - bytes = -offset; compressed =SQUASHFS_COMPRESSED_BLOCK (length); length =SQUASHFS_COMPRESSED_SIZE_BLOCK (length); -if (next_index) - *next_index = index + length; -TRACE ("Block @ 0x%llx, %scompressed size %d, src size %d\n" , index, compressed ?"" :"un" , length, output->length); - -if (length <0 || length > output->length || - (index + length) > msblk->bytes_used) - goto read_failure; - -for (b =0 ; bytes < length; b++, cur_index++) { - bh[b] =sb_getblk (sb, cur_index); -if (bh[b] ==NULL ) - goto block_release; - bytes += msblk->devblksize; - } -ll_rw_block (REQ_OP_READ ,0 , b, bh); }else {/* * Metadata block. */ -if ((index +2 ) > msblk->bytes_used) - goto read_failure; - - bh[0 ] =get_block_length (sb, &cur_index, &offset, &length); -if (bh[0 ] ==NULL ) - goto read_failure; - b =1 ; +const u8 *data; +struct bvec_iter_all iter_all = {}; +struct bio_vec *bvec =bvec_init_iter_all (&iter_all); + +if (index +2 > msblk->bytes_used) { + res = -EIO ; + goto out; + } + res =squashfs_bio_read (sb, index,2 , &bio, &offset); +if (res) + goto out; + +if (WARN_ON_ONCE (!bio_next_segment (bio, &iter_all))) { + res = -EIO ; + goto out_free_bio; + } +/* Extract the length of the metadata block */ + data =page_address (bvec->bv_page) + bvec->bv_offset; + length = data[offset]; +if (offset <= bvec->bv_len -1 ) { + length |= data[offset +1 ] <<8 ; + }else { +if (WARN_ON_ONCE (!bio_next_segment (bio, &iter_all))) { + res = -EIO ; + goto out_free_bio; + } + data =page_address (bvec->bv_page) + bvec->bv_offset; + length |= data[0 ] <<8 ; + } +bio_free_pages (bio); +bio_put (bio); - bytes = msblk->devblksize - offset; compressed =SQUASHFS_COMPRESSED (length); length =SQUASHFS_COMPRESSED_SIZE (length); -if (next_index) - *next_index = index + length +2 ; + index +=2 ;TRACE ("Block @ 0x%llx, %scompressed size %d\n" , index, - compressed ?"" :"un" , length); - -if (length <0 || length > output->length || - (index + length) > msblk->bytes_used) - goto block_release; - -for (; bytes < length; b++) { - bh[b] =sb_getblk (sb, ++cur_index); -if (bh[b] ==NULL ) - goto block_release; - bytes += msblk->devblksize; - } -ll_rw_block (REQ_OP_READ ,0 , b -1 , bh +1 ); + compressed ?"" :"un" , length); } +if (next_index) + *next_index = index + length; -for (i =0 ; i < b; i++) { -wait_on_buffer (bh[i]); -if (!buffer_uptodate (bh[i])) - goto block_release; - } + res =squashfs_bio_read (sb, index, length, &bio, &offset); +if (res) + goto out;if (compressed) { -if (!msblk->stream) - goto read_failure; - length =squashfs_decompress (msblk, bh, b, offset, length, - output); -if (length <0 ) - goto read_failure; - }else { -/* -* Block is uncompressed. -*/ -int in, pg_offset =0 ; -void *data =squashfs_first_page (output); - -for (bytes = length; k < b; k++) { - in =min (bytes, msblk->devblksize - offset); - bytes -= in; -while (in) { -if (pg_offset ==PAGE_SIZE ) { - data =squashfs_next_page (output); - pg_offset =0 ; - } - avail =min_t (int, in,PAGE_SIZE - - pg_offset); -memcpy (data + pg_offset, bh[k]->b_data + offset, - avail); - in -= avail; - pg_offset += avail; - offset += avail; - } - offset =0 ; -put_bh (bh[k]); +if (!msblk->stream) { + res = -EIO ; + goto out_free_bio; } -squashfs_finish_page (output); + res =squashfs_decompress (msblk, bio, offset, length, output); + }else { + res =copy_bio_to_actor (bio, output, offset, length); } -kfree (bh); -return length; +out_free_bio: +bio_free_pages (bio); +bio_put (bio); +out: +if (res <0 ) +ERROR ("Failed to read block 0x%llx: %d\n" , index, res); -block_release: -for (; k < b; k++) -put_bh (bh[k]); - -read_failure: -ERROR ("squashfs_read_data failed to read block 0x%llx\n" , - (unsigned long long ) index); -kfree (bh); -return -EIO ; +return res; }
fs/squashfs/decompressor.h renamed from fs/squashfs/decompressor.h~squashfs-migrate-from-ll_rw_block-usage-to-bio +3 -2
@@ -10,13 +10,14 @@* decompressor.h */ +#include <linux/bio.h> +struct squashfs_decompressor {void *(*init)(struct squashfs_sb_info *,void *);void *(*comp_opts)(struct squashfs_sb_info *,void *,int );void (*free)(void *);int (*decompress)(struct squashfs_sb_info *,void *, -struct buffer_head **,int ,int ,int , -struct squashfs_page_actor *); +struct bio *,int ,int ,struct squashfs_page_actor *);int id;char *name;int supported;
fs/squashfs/decompressor_multi.c renamed from fs/squashfs/decompressor_multi.c~squashfs-migrate-from-ll_rw_block-usage-to-bio +5 -4
@@ -6,7 +6,7 @@#include <linux/types.h> #include <linux/mutex.h> #include <linux/slab.h> -#include <linux/buffer_head.h> +#include <linux/bio.h> #include <linux/sched.h> #include <linux/wait.h> #include <linux/cpumask.h>
@@ -180,14 +180,15 @@ wait: } -int squashfs_decompress (struct squashfs_sb_info *msblk,struct buffer_head **bh, -int b,int offset,int length,struct squashfs_page_actor *output) +int squashfs_decompress (struct squashfs_sb_info *msblk,struct bio *bio, +int offset,int length, +struct squashfs_page_actor *output) {int res;struct squashfs_stream *stream = msblk->stream;struct decomp_stream *decomp_stream =get_decomp_stream (msblk, stream); res = msblk->decompressor->decompress (msblk, decomp_stream->stream, - bh, b, offset, length, output); + bio, offset, length, output);put_decomp_stream (decomp_stream, stream);if (res <0 ) ERROR("%s decompression failed, data probably corrupt\n",
fs/squashfs/decompressor_single.c renamed from fs/squashfs/decompressor_single.c~squashfs-migrate-from-ll_rw_block-usage-to-bio +5 -4
@@ -7,7 +7,7 @@#include <linux/types.h> #include <linux/mutex.h> #include <linux/slab.h> -#include <linux/buffer_head.h> +#include <linux/bio.h> #include "squashfs_fs.h" #include "squashfs_fs_sb.h"
@@ -59,14 +59,15 @@ void squashfs_decompressor_destroy(struc } } -int squashfs_decompress (struct squashfs_sb_info *msblk,struct buffer_head **bh, -int b,int offset,int length,struct squashfs_page_actor *output) +int squashfs_decompress (struct squashfs_sb_info *msblk,struct bio *bio, +int offset,int length, +struct squashfs_page_actor *output) {int res;struct squashfs_stream *stream = msblk->stream;mutex_lock (&stream->mutex); - res = msblk->decompressor->decompress (msblk, stream->stream, bh, b, + res = msblk->decompressor->decompress (msblk, stream->stream, bio, offset, length, output);mutex_unlock (&stream->mutex);
fs/squashfs/lz4_wrapper.c renamed from fs/squashfs/lz4_wrapper.c~squashfs-migrate-from-ll_rw_block-usage-to-bio +10 -7
@@ -4,7 +4,7 @@* Phillip Lougher <[email protected]> */ -#include <linux/buffer_head.h> +#include <linux/bio.h> #include <linux/mutex.h> #include <linux/slab.h> #include <linux/vmalloc.h>
@@ -89,20 +89,23 @@ static void lz4_free(void *strm)static int lz4_uncompress (struct squashfs_sb_info *msblk,void *strm, -struct buffer_head **bh,int b,int offset,int length, +struct bio *bio,int offset,int length,struct squashfs_page_actor *output) { +struct bvec_iter_all iter_all = {}; +struct bio_vec *bvec =bvec_init_iter_all (&iter_all);struct squashfs_lz4 *stream = strm;void *buff = stream->input, *data; -int avail, i, bytes = length, res; +int bytes = length, res; -for (i =0 ; i < b; i++) { - avail =min (bytes, msblk->devblksize - offset); -memcpy (buff, bh[i]->b_data + offset, avail); +while (bio_next_segment (bio, &iter_all)) { +int avail =min (bytes, ((int )bvec->bv_len) - offset); + + data =page_address (bvec->bv_page) + bvec->bv_offset; +memcpy (buff, data + offset, avail); buff += avail; bytes -= avail; offset =0 ; -put_bh (bh[i]); } res = LZ4_decompress_safe(stream->input, stream->output,
fs/squashfs/lzo_wrapper.c renamed from fs/squashfs/lzo_wrapper.c~squashfs-migrate-from-ll_rw_block-usage-to-bio +10 -7
@@ -9,7 +9,7 @@*/ #include <linux/mutex.h> -#include <linux/buffer_head.h> +#include <linux/bio.h> #include <linux/slab.h> #include <linux/vmalloc.h> #include <linux/lzo.h>
@@ -63,21 +63,24 @@ static void lzo_free(void *strm)static int lzo_uncompress (struct squashfs_sb_info *msblk,void *strm, -struct buffer_head **bh,int b,int offset,int length, +struct bio *bio,int offset,int length,struct squashfs_page_actor *output) { +struct bvec_iter_all iter_all = {}; +struct bio_vec *bvec =bvec_init_iter_all (&iter_all);struct squashfs_lzo *stream = strm;void *buff = stream->input, *data; -int avail, i, bytes = length, res; +int bytes = length, res;size_t out_len = output->length; -for (i =0 ; i < b; i++) { - avail =min (bytes, msblk->devblksize - offset); -memcpy (buff, bh[i]->b_data + offset, avail); +while (bio_next_segment (bio, &iter_all)) { +int avail =min (bytes, ((int )bvec->bv_len) - offset); + + data =page_address (bvec->bv_page) + bvec->bv_offset; +memcpy (buff, data + offset, avail); buff += avail; bytes -= avail; offset =0 ; -put_bh (bh[i]); } res = lzo1x_decompress_safe(stream->input, (size_t)length,
fs/squashfs/squashfs.h renamed from fs/squashfs/squashfs.h~squashfs-migrate-from-ll_rw_block-usage-to-bio +2 -2
@@ -40,8 +40,8 @@ extern void *squashfs_decompressor_setup/* decompressor_xxx.c */ extern void *squashfs_decompressor_create (struct squashfs_sb_info *,void *);extern void squashfs_decompressor_destroy (struct squashfs_sb_info *); -extern int squashfs_decompress (struct squashfs_sb_info *,struct buffer_head **, -int ,int ,int ,struct squashfs_page_actor *); +extern int squashfs_decompress (struct squashfs_sb_info *,struct bio *, +int ,int ,struct squashfs_page_actor *);extern int squashfs_max_decompressors (void );/* export.c */
fs/squashfs/xz_wrapper.c renamed from fs/squashfs/xz_wrapper.c~squashfs-migrate-from-ll_rw_block-usage-to-bio +29 -22
81 lines not on this page · raw message
fs/squashfs/zlib_wrapper.c renamed from fs/squashfs/zlib_wrapper.c~squashfs-migrate-from-ll_rw_block-usage-to-bio +34 -29
99 lines not on this page · raw message
fs/squashfs/zstd_wrapper.c renamed from fs/squashfs/zstd_wrapper.c~squashfs-migrate-from-ll_rw_block-usage-to-bio +30 -25
98 lines not on this page · raw message
+ checkpatch-fix-a-typo-in-the-regex-for-allocfunctions.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: checkpatch: fix a typo in the regex for $allocFunctions has been added to the -mm tree. Its filename is checkpatch-fix-a-typo-in-the-regex-for-allocfunctions.patch
The patch titled
Subject: checkpatch: fix a typo in the regex for $allocFunctions
has been added to the -mm tree. Its filename is
checkpatch-fix-a-typo-in-the-regex-for-allocfunctions.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/checkpatch-fix-a-typo-in-the-regex-for-allocfunctions.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/checkpatch-fix-a-typo-in-the-regex-for-allocfunctions.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Christophe JAILLET <[email protected]>
Subject: checkpatch: fix a typo in the regex for $allocFunctions
Here, we look for function such as 'netdev_alloc_skb_ip_align', so a '_' is missing in the regex.
To make sure:
grep -r --include=*.c skbip_a * | wc ==> 0 results
grep -r --include=*.c skb_ip_a * | wc ==> 112 results
---
scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl renamed from scripts/checkpatch.pl~checkpatch-fix-a-typo-in-the-regex-for-allocfunctions +1 -1
@@ -479,7 +479,7 @@ our $allocFunctions = qr{(?x: (?:kv|k|v)[czm]alloc(?:_node|_array)? | kstrdup(?:_const)? | kmemdup(?:_nul)?) | - (?:\w+)?alloc_skb(?:ip_align)? | + (?:\w+)?alloc_skb(?:_ip_align)? | # dev_alloc_skb/netdev_alloc_skb, et al dma_alloc_coherent )};
_
Patches currently in -mm which might be from [email protected] are
lib-math-avoid-trailing-n-hidden-in-pr_fmt.patch checkpatch-fix-a-typo-in-the-regex-for-allocfunctions.patch
+ powerpc-pseries-hotplug-memory-stop-checking-is_mem_section_removable.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: powerpc/pseries/hotplug-memory: stop checking is_mem_section_removable() has been added to the -mm tree. Its filename is…
The patch titled
Subject: powerpc/pseries/hotplug-memory: stop checking is_mem_section_removable()
has been added to the -mm tree. Its filename is
powerpc-pseries-hotplug-memory-stop-checking-is_mem_section_removable.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/powerpc-pseries-hotplug-memory-stop-checking-is_mem_section_removable.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/powerpc-pseries-hotplug-memory-stop-checking-is_mem_section_removable.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: David Hildenbrand <[email protected]>
Subject: powerpc/pseries/hotplug-memory: stop checking is_mem_section_removable()
In commit 53cdc1cb29e8 ("drivers/base/memory.c: indicate all memory blocks as removable"), the user space interface to compute whether a memory block can be offlined (exposed via /sys/devices/system/memory/memoryX/removable) has effectively been deprecated. We want to remove the leftovers of the kernel implementation.
When offlining a memory block (mm/memory_hotplug.c:__offline_pages()), we'll start by:
1. Testing if it contains any holes, and reject if so
2. Testing if pages belong to different zones, and reject if so
3. Isolating the page range, checking if it contains any unmovable pages
Using is_mem_section_removable() before trying to offline is not only racy, it can easily result in false positives/negatives. Let's stop manually checking is_mem_section_removable(), and let device_offline() handle it completely instead. We can remove the racy is_mem_section_removable() implementation next.
We now take more locks (e.g., memory hotplug lock when offlining and the zone lock when isolating), but maybe we should optimize that implementation instead if this ever becomes a real problem (after all, memory unplug is already an expensive operation). We started using is_mem_section_removable() in commit 51925fb3c5c9 ("powerpc/pseries:
Implement memory hotplug remove in the kernel"), with the initial hotremove support of lmbs.
---
arch/powerpc/platforms/pseries/hotplug-memory.c | 26 +------------- 1 file changed, 3 insertions(+), 23 deletions(-)
arch/powerpc/platforms/pseries/hotplug-memory.c renamed from arch/powerpc/platforms/pseries/hotplug-memory.c~powerpc-pseries-hotplug-memory-stop-checking-is_mem_section_removable +1 -21
@@ -337,39 +337,19 @@ static int pseries_remove_mem_node(strucstatic bool lmb_is_removable (struct drmem_lmb *lmb) { -int i, scns_per_block; -bool rc = true; -unsigned long pfn, block_sz; -u64 phys_addr; -if (!(lmb->flags &DRCONF_MEM_ASSIGNED ))return false; - block_sz =memory_block_size_bytes (); - scns_per_block = block_sz /MIN_MEMORY_BLOCK_SIZE ; - phys_addr = lmb->base_addr; -#ifdef CONFIG_FA_DUMP /* * Don't hot-remove memory that falls in fadump boot memory area * and memory that is reserved for capturing old kernel memory. */ -if (is_fadump_memory_area (phys_addr, block_sz)) +if (is_fadump_memory_area (lmb->base_addr,memory_block_size_bytes ()))return false;#endif - -for (i =0 ; i < scns_per_block; i++) { - pfn =PFN_DOWN (phys_addr); -if (!pfn_in_present_section (pfn)) { - phys_addr +=MIN_MEMORY_BLOCK_SIZE ; -continue ; - } - - rc = rc &&is_mem_section_removable (pfn,PAGES_PER_SECTION ); - phys_addr +=MIN_MEMORY_BLOCK_SIZE ; - }
+ mm-memory_hotplug-remove-is_mem_section_removable.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm/memory_hotplug: remove is_mem_section_removable() has been added to the -mm tree. Its filename is mm-memory_hotplug-remove-is_mem_section_removable.patch
The patch titled
Subject: mm/memory_hotplug: remove is_mem_section_removable()
has been added to the -mm tree. Its filename is
mm-memory_hotplug-remove-is_mem_section_removable.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-memory_hotplug-remove-is_mem_section_removable.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-memory_hotplug-remove-is_mem_section_removable.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: David Hildenbrand <[email protected]>
Subject: mm/memory_hotplug: remove is_mem_section_removable()
Fortunately, all users of is_mem_section_removable() are gone. Get rid of it, including some now unnecessary functions.
---
include/linux/memory_hotplug.h | 7 -- mm/memory_hotplug.c | 75 ------------------------------- 2 files changed, 82 deletions(-)
include/linux/memory_hotplug.h renamed from include/linux/memory_hotplug.h~mm-memory_hotplug-remove-is_mem_section_removable +0 -7
@@ -314,19 +314,12 @@ static inline void pgdat_resize_init(str#ifdef CONFIG_MEMORY_HOTREMOVE -extern bool is_mem_section_removable (unsigned long pfn,unsigned long nr_pages);extern void try_offline_node (int nid);extern int offline_pages (unsigned long start_pfn,unsigned long nr_pages);extern int remove_memory (int nid,u64 start,u64 size);extern void __remove_memory (int nid,u64 start,u64 size);#else -static inline bool is_mem_section_removable (unsigned long pfn, -unsigned long nr_pages) -{ -return false; -} -static inline void try_offline_node (int nid) {}static inline int offline_pages (unsigned long start_pfn,unsigned long nr_pages)
mm/memory_hotplug.c renamed from mm/memory_hotplug.c~mm-memory_hotplug-remove-is_mem_section_removable +0 -73
76 lines not on this page · raw message
[folded-merged] mm-clarify-__gfp_memalloc-usage-update.patch removed from -mm tree
In reply to Andrew MortonThe patch titled Subject: mm-clarify-__gfp_memalloc-usage-update has been removed from the -mm tree. Its filename was mm-clarify-__gfp_memalloc-usage-update.patch
The patch titled
Subject: mm-clarify-__gfp_memalloc-usage-update
has been removed from the -mm tree. Its filename was
mm-clarify-__gfp_memalloc-usage-update.patch
This patch was dropped because it was folded into mm-clarify-__gfp_memalloc-usage.patch
------------------------------------------------------
From: Michal Hocko <[email protected]>
Subject: mm-clarify-__gfp_memalloc-usage-update
---
include/linux/gfp.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/gfp.h renamed from include/linux/gfp.h~mm-clarify-__gfp_memalloc-usage-update +2 -0
@@ -113,6 +113,8 @@ struct vm_area_struct;* Users of this flag have to be extremely careful to not deplete the reserve * completely and implement a throttling mechanism which controls the consumption * of the reserve based on the amount of freed memory. +* Usage of a pre-allocated pool (e.g. mempool) should be always considered before +* using this flag. * * %__GFP_NOMEMALLOC is used to explicitly forbid access to emergency reserves. * This takes precedence over the %__GFP_MEMALLOC flag if both are set.
_
Patches currently in -mm which might be from [email protected] are
mm-clarify-__gfp_memalloc-usage.patch
[folded-merged] mm-clarify-__gfp_memalloc-usage-update-checkpatch-fixes.patch removed from -mm tree
In reply to Andrew MortonThe patch titled Subject: mm-clarify-__gfp_memalloc-usage-update-checkpatch-fixes has been removed from the -mm tree. Its filename was mm-clarify-__gfp_memalloc-usage-update-checkpatch-fixes.patch
The patch titled
Subject: mm-clarify-__gfp_memalloc-usage-update-checkpatch-fixes
has been removed from the -mm tree. Its filename was
mm-clarify-__gfp_memalloc-usage-update-checkpatch-fixes.patch
This patch was dropped because it was folded into mm-clarify-__gfp_memalloc-usage.patch
------------------------------------------------------
From: Andrew Morton <[email protected]>
Subject: mm-clarify-__gfp_memalloc-usage-update-checkpatch-fixes
#23: FILE: include/linux/gfp.h:116:
+ * Usage of a pre-allocated pool (e.g. mempool) should be always considered before
WARNING: Missing Signed-off-by: line by nominal patch author 'Michal Hocko <[email protected]>'
total: 0 errors, 2 warnings, 8 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
./patches/mm-clarify-__gfp_memalloc-usage-update.patch has style problems, please review.
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
Please run checkpatch prior to sending patches
---
include/linux/gfp.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
include/linux/gfp.h renamed from include/linux/gfp.h~mm-clarify-__gfp_memalloc-usage-update-checkpatch-fixes +4 -4
@@ -111,10 +111,10 @@ struct vm_area_struct;* very shortly e.g. process exiting or swapping. Users either should * be the MM or co-ordinating closely with the VM (e.g. swap over NFS). * Users of this flag have to be extremely careful to not deplete the reserve -* completely and implement a throttling mechanism which controls the consumption -* of the reserve based on the amount of freed memory. -* Usage of a pre-allocated pool (e.g. mempool) should be always considered before -* using this flag. +* completely and implement a throttling mechanism which controls the +* consumption of the reserve based on the amount of freed memory. +* Usage of a pre-allocated pool (e.g. mempool) should be always considered +* before using this flag. * * %__GFP_NOMEMALLOC is used to explicitly forbid access to emergency reserves. * This takes precedence over the %__GFP_MEMALLOC flag if both are set.
_
Patches currently in -mm which might be from [email protected] are
maintainers-add-an-entry-for-kfifo-fix.patch drivers-tty-serial-sh-scic-suppress-uninitialized-var-warning.patch mm.patch memcg-optimize-memorynuma_stat-like-memorystat-fix.patch mm-clarify-__gfp_memalloc-usage.patch linux-next-fix.patch kernel-forkc-export-kernel_thread-to-modules.patch
+ maintainers-add-an-entry-for-kfifo-fix-fix.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: maintainers-add-an-entry-for-kfifo-fix-fix has been added to the -mm tree. Its filename is maintainers-add-an-entry-for-kfifo-fix-fix.patch
The patch titled
Subject: maintainers-add-an-entry-for-kfifo-fix-fix
has been added to the -mm tree. Its filename is
maintainers-add-an-entry-for-kfifo-fix-fix.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/maintainers-add-an-entry-for-kfifo-fix-fix.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/maintainers-add-an-entry-for-kfifo-fix-fix.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Andrew Morton <[email protected]>
Subject: maintainers-add-an-entry-for-kfifo-fix-fix
remove colon, per Bartosz
---
MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS renamed from MAINTAINERS~maintainers-add-an-entry-for-kfifo-fix-fix +1 -1
@@ -9412,7 +9412,7 @@ F: include/linux/keyctl.h F: include/uapi/linux/keyctl.h F: security/keys/ -KFIFO: +KFIFO M: Stefani Seibold <[email protected]> S: Maintained F: include/linux/kfifo.h
_
Patches currently in -mm which might be from [email protected] are
maintainers-add-an-entry-for-kfifo-fix.patch maintainers-add-an-entry-for-kfifo-fix-fix.patch drivers-tty-serial-sh-scic-suppress-uninitialized-var-warning.patch mm.patch memcg-optimize-memorynuma_stat-like-memorystat-fix.patch linux-next-fix.patch kernel-forkc-export-kernel_thread-to-modules.patch
+ mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2.patch added to -mm tree
In reply to Andrew MortonThe patch titled
The patch titled
Subject: mm/hugetlb: fix a typo in comment "manitained"->"maintained"
has been added to the -mm tree. Its filename is
mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Ethon Paul <[email protected]>
Subject: mm/hugetlb: fix a typo in comment "manitained"->"maintained"
There are some typos in comment, fix them.
line 83, s/mased on/based on
line 472, s/ruturns/returns
line 987, s/reverves/reserves
line 1489, s/ Otherwse/Otherwise
line 4431, s/a active/an active
---
mm/hugetlb.c | 10 +++++----- mm/mmap.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-)
mm/hugetlb.c renamed from mm/hugetlb.c~mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2 +5 -5
@@ -85,7 +85,7 @@ static inline void unlock_or_release_subspin_unlock (&spool->lock);/* If no pages are used, and no other handles to the subpool -* remain, give up any reservations mased on minimum size and +* remain, give up any reservations based on minimum size and * free the subpool */ if (free) {if (spool->min_hpages !=-1 )
@@ -473,7 +473,7 @@ out_of_memory:* * Return the number of new huge pages added to the map. This number is greater * than or equal to zero. If file_region entries needed to be allocated for -* this operation and we were not able to allocate, it ruturns -ENOMEM. +* this operation and we were not able to allocate, it returns -ENOMEM. * region_add of regions of length 1 never allocate file_regions and cannot * fail; region_chg will always allocate at least 1 entry and a region_add for * 1 page will only require at most 1 entry.
@@ -988,7 +988,7 @@ static bool vma_has_reserves(struct vm_a* We know VM_NORESERVE is not set. Therefore, there SHOULD * be a region map for all pages. The only situation where * there is no region map is if a hole was punched via -* fallocate. In this case, there really are no reverves to +* fallocate. In this case, there really are no reserves to * use. This situation is indicated if chg != 0. */ if (chg)
@@ -1519,7 +1519,7 @@ static void prep_compound_gigantic_page(* For gigantic hugepages allocated through bootmem at * boot, it's safer to be consistent with the not-gigantic * hugepages and clear the PG_reserved bit from all tail pages -* too. Otherwse drivers using get_user_pages() to access tail +* too. Otherwise drivers using get_user_pages() to access tail * pages may get the reference counting wrong if they see * PG_reserved set on a tail page (despite the head page not * having PG_reserved set). Enforcing this consistency between
@@ -4466,7 +4466,7 @@ vm_fault_t hugetlb_fault(struct mm_struc/* * entry could be a migration/hwpoison entry at this point, so this * check prevents the kernel from going below assuming that we have -* a active hugepage in pagecache. This goto expects the 2nd page fault, +* an active hugepage in pagecache. This goto expects the 2nd page fault, * and is_hugetlb_entry_(migration|hwpoisoned) check will properly * handle it. */
mm/mmap.c renamed from mm/mmap.c~mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2 +1 -1
@@ -1207,7 +1207,7 @@ struct vm_area_struct *vma_merge(struct }/* -* Rough compatbility check to quickly see if it's even worth looking +* Rough compatibility check to quickly see if it's even worth looking * at sharing an anon_vma. * * They need to have the same vm_file, and the flags can only differ
_
Patches currently in -mm which might be from [email protected] are
mm-memory_hotplug-fix-a-typo-in-comment-recoreded-recorded.patch mm-ksm-fix-a-typo-in-comment-alreaady-already.patch mm-ksm-fix-a-typo-in-comment-alreaady-already-v2.patch mm-mmap-fix-a-typo-in-comment-compatbility-compatibility.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2.patch mm-vmsan-fix-some-typos-in-comment.patch mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch mm-memblock-fix-a-typo-in-comment-implict-implicit.patch mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch mm-frontswap-fix-some-typos-in-frontswapc.patch mm-memcg-fix-some-typos-in-memcontrolc.patch mm-fix-a-typo-in-comment-strucure-structure.patch mm-slub-fix-a-typo-in-comment-disambiguiation-disambiguation.patch mm-sparse-fix-a-typo-in-comment-convienence-convenience.patch mm-page-writeback-fix-a-typo-in-comment-effictive-effective.patch mm-memory-fix-a-typo-in-comment-attampt-attempt.patch
+ mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2-checkpatch-fixes.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2-checkpatch-fixes has been added to the -mm tree. Its filename is…
The patch titled
Subject: mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2-checkpatch-fixes
has been added to the -mm tree. Its filename is
mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2-checkpatch-fixes.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2-checkpatch-fixes.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2-checkpatch-fixes.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Andrew Morton <[email protected]>
Subject: mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2-checkpatch-fixes
WARNING: line over 80 characters
#65: FILE: mm/hugetlb.c:4469:
+ * an active hugepage in pagecache. This goto expects the 2nd page fault,
total: 0 errors, 1 warnings, 48 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
./patches/mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2.patch has style problems, please review.
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
Please run checkpatch prior to sending patches
---
mm/hugetlb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
mm/hugetlb.c renamed from mm/hugetlb.c~mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2-checkpatch-fixes +3 -3
@@ -4466,9 +4466,9 @@ vm_fault_t hugetlb_fault(struct mm_struc/* * entry could be a migration/hwpoison entry at this point, so this * check prevents the kernel from going below assuming that we have -* an active hugepage in pagecache. This goto expects the 2nd page fault, -* and is_hugetlb_entry_(migration|hwpoisoned) check will properly -* handle it. +* an active hugepage in pagecache. This goto expects the 2nd page +* fault, and is_hugetlb_entry_(migration|hwpoisoned) check will +* properly handle it. */ if (!pte_present (entry)) goto out_mutex;
_
Patches currently in -mm which might be from [email protected] are
maintainers-add-an-entry-for-kfifo-fix.patch maintainers-add-an-entry-for-kfifo-fix-fix.patch drivers-tty-serial-sh-scic-suppress-uninitialized-var-warning.patch mm.patch
memcg-optimize-memorynuma_stat-like-memorystat-fix.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2-checkpatch-fixes.patch linux-next-fix.patch kernel-forkc-export-kernel_thread-to-modules.patch
+ mm-ksm-fix-a-typo-in-comment-alreaady-already-v2.patch added to -mm tree
In reply to Andrew MortonThe patch titled
The patch titled
Subject: mm: ksm: fix a typo in comment "alreaady"->"already"
has been added to the -mm tree. Its filename is
mm-ksm-fix-a-typo-in-comment-alreaady-already-v2.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-ksm-fix-a-typo-in-comment-alreaady-already-v2.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-ksm-fix-a-typo-in-comment-alreaady-already-v2.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Ethon Paul <[email protected]>
Subject: mm: ksm: fix a typo in comment "alreaady"->"already"
There are some typos in comment, fix them.
s/wrprotected/write protected
s/undeflow/underflow
---
mm/ksm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
mm/ksm.c renamed from mm/ksm.c~mm-ksm-fix-a-typo-in-comment-alreaady-already-v2 +4 -4
@@ -612,7 +612,7 @@ static struct stable_node *alloc_stable_* Move the old stable node to the second dimension * queued in the hlist_dup. The invariant is that all * dup stable_nodes in the chain->hlist point to pages -* that are wrprotected and have the exact same +* that are write protected and have the exact same * content. */ stable_node_chain_add_dup (dup, chain);
@@ -1608,7 +1608,7 @@ again:* continue. All KSM pages belonging to the * stable_node dups in a stable_node chain * have the same content and they're -* wrprotected at all times. Any will work +* write protected at all times. Any will work * fine to continue the walk. */ tree_page = get_ksm_page(stable_node_any,
@@ -1843,7 +1843,7 @@ again:* continue. All KSM pages belonging to the * stable_node dups in a stable_node chain * have the same content and they're -* wrprotected at all times. Any will work +* write protected at all times. Any will work * fine to continue the walk. */ tree_page = get_ksm_page(stable_node_any,
@@ -2001,7 +2001,7 @@ static void stable_tree_append(struct rm* duplicate. page_migration could break later if rmap breaks, * so we can as well crash here. We really need to check for * rmap_hlist_len == STABLE_NODE_CHAIN, but we can as well check -* for other negative values as an undeflow if detected here +* for other negative values as an underflow if detected here * for the first time (and not when decreasing rmap_hlist_len) * would be sign of memory corruption in the stable_node. */
_
Patches currently in -mm which might be from [email protected] are
mm-memory_hotplug-fix-a-typo-in-comment-recoreded-recorded.patch mm-ksm-fix-a-typo-in-comment-alreaady-already.patch mm-ksm-fix-a-typo-in-comment-alreaady-already-v2.patch mm-mmap-fix-a-typo-in-comment-compatbility-compatibility.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained.patch mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2.patch mm-vmsan-fix-some-typos-in-comment.patch mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch mm-memblock-fix-a-typo-in-comment-implict-implicit.patch mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch mm-frontswap-fix-some-typos-in-frontswapc.patch mm-memcg-fix-some-typos-in-memcontrolc.patch mm-fix-a-typo-in-comment-strucure-structure.patch mm-slub-fix-a-typo-in-comment-disambiguiation-disambiguation.patch mm-sparse-fix-a-typo-in-comment-convienence-convenience.patch mm-page-writeback-fix-a-typo-in-comment-effictive-effective.patch mm-memory-fix-a-typo-in-comment-attampt-attempt.patch
+ lib-add-might_fault-to-strncpy_from_user.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: lib: Add might_fault() to strncpy_from_user. has been added to the -mm tree. Its filename is lib-add-might_fault-to-strncpy_from_user.patch
The patch titled
Subject: lib: Add might_fault() to strncpy_from_user.
has been added to the -mm tree. Its filename is
lib-add-might_fault-to-strncpy_from_user.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/lib-add-might_fault-to-strncpy_from_user.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/lib-add-might_fault-to-strncpy_from_user.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: KP Singh <[email protected]>
Subject: lib: Add might_fault() to strncpy_from_user.
When updating a piece of broken logic from using get_user to strncpy_from_user, we noticed that a warning which is expected when calling a function that might fault from an atomic context with pagefaults enabled disappeared.
Not having this warning in place can lead to calling strncpy_from_user from an atomic context and eventually kernel crashes/stack corruption.
---
lib/strncpy_from_user.c | 1 + 1 file changed, 1 insertion(+)
lib/strncpy_from_user.c renamed from lib/strncpy_from_user.c~lib-add-might_fault-to-strncpy_from_user +1 -0
@@ -98,6 +98,7 @@ long strncpy_from_user(char *dst, const {unsigned long max_addr, src_addr; +might_fault ();if (unlikely (count <=0 ))return 0 ;
_
Patches currently in -mm which might be from [email protected] are
lib-add-might_fault-to-strncpy_from_user.patch
+ tools-build-tweak-unused-value-workaround.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: tools/build: tweak unused value workaround has been added to the -mm tree. Its filename is tools-build-tweak-unused-value-workaround.patch
The patch titled
Subject: tools/build: tweak unused value workaround
has been added to the -mm tree. Its filename is
tools-build-tweak-unused-value-workaround.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/tools-build-tweak-unused-value-workaround.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/tools-build-tweak-unused-value-workaround.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: George Burgess IV <[email protected]>
Subject: tools/build: tweak unused value workaround
Clang has -Wself-assign enabled by default under -Wall, which always gets -Werror'ed on this file, causing sync-compare-and-swap to be disabled by default. The generally-accepted way to spell "this value is intentionally unused," is casting it to void. This is accepted by both GCC and Clang with -Wall enabled: https://godbolt.org/z/qqZ9r3
---
tools/build/feature/test-sync-compare-and-swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/build/feature/test-sync-compare-and-swap.c renamed from tools/build/feature/test-sync-compare-and-swap.c~tools-build-tweak-unused-value-workaround +1 -1
@@ -7,7 +7,7 @@ int main(int argc, char *argv[]) {uint64_t old, new = argc; - argv = argv; + (void )argv;do { old =__sync_val_compare_and_swap (&x,0 ,0 ); }while (!__sync_bool_compare_and_swap (&x, old, new));
_
Patches currently in -mm which might be from [email protected] are
tools-build-tweak-unused-value-workaround.patch
+ h8300-remove-usage-of-__arch_use_5level_hack.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: h8300: remove usage of __ARCH_USE_5LEVEL_HACK has been added to the -mm tree. Its filename is
The patch titled
Subject: h8300: remove usage of __ARCH_USE_5LEVEL_HACK
has been added to the -mm tree. Its filename is
h8300-remove-usage-of-__arch_use_5level_hack.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/h8300-remove-usage-of-__arch_use_5level_hack.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/h8300-remove-usage-of-__arch_use_5level_hack.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: h8300: remove usage of __ARCH_USE_5LEVEL_HACK
Patch series "mm: remove __ARCH_HAS_5LEVEL_HACK", v4.
These patches convert several architectures to use page table folding and remove __ARCH_HAS_5LEVEL_HACK along with include/asm-generic/5level-fixup.h and include/asm-generic/pgtable-nop4d-hack.h. With that we'll have a single and consistent way of dealing with page table folding instead of a mix of three existing options.
The changes are mostly about mechanical replacement of pgd accessors with p4d ones and the addition of higher levels to page table traversals.
This patch (of 14):
h8300 is a nommu architecture and does not require fixup for upper layers of the page tables because it is already handled by the generic nommu implementation.
Remove definition of __ARCH_USE_5LEVEL_HACK inarch/h8300/include/asm/pgtable.h
---
arch/h8300/include/asm/pgtable.h | 1 - 1 file changed, 1 deletion(-)
arch/h8300/include/asm/pgtable.h renamed from arch/h8300/include/asm/pgtable.h~h8300-remove-usage-of-__arch_use_5level_hack +0 -1
@@ -1,7 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _H8300_PGTABLE_H#define _H8300_PGTABLE_H -#define __ARCH_USE_5LEVEL_HACK#include <asm-generic/pgtable-nopud.h> #include <asm-generic/pgtable.h> extern void paging_init (void );
_
Patches currently in -mm which might be from [email protected] are
h8300-remove-usage-of-__arch_use_5level_hack.patch arm-add-support-for-folded-p4d-page-tables.patch arm64-add-support-for-folded-p4d-page-tables.patch hexagon-remove-__arch_use_5level_hack.patch ia64-add-support-for-folded-p4d-page-tables.patch nios2-add-support-for-folded-p4d-page-tables.patch openrisc-add-support-for-folded-p4d-page-tables.patch powerpc-add-support-for-folded-p4d-page-tables.patch sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch sh-add-support-for-folded-p4d-page-tables.patch unicore32-remove-__arch_use_5level_hack.patch asm-generic-remove-pgtable-nop4d-hackh.patch mm-remove-__arch_has_5level_hack-and-include-asm-generic-5level-fixuph.patch mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ arm-add-support-for-folded-p4d-page-tables.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: arm: add support for folded p4d page tables has been added to the -mm tree. Its filename is arm-add-support-for-folded-p4d-page-tables.patch
The patch titled
Subject: arm: add support for folded p4d page tables
has been added to the -mm tree. Its filename is
arm-add-support-for-folded-p4d-page-tables.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/arm-add-support-for-folded-p4d-page-tables.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/arm-add-support-for-folded-p4d-page-tables.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: arm: add support for folded p4d page tables
Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate, and remove __ARCH_USE_5LEVEL_HACK.
---
arch/arm/include/asm/pgtable.h | 1 arch/arm/lib/uaccess_with_memcpy.c | 7 ++++ arch/arm/mach-sa1100/assabet.c | 2 - arch/arm/mm/dump.c | 29 +++++++++++++++---- arch/arm/mm/fault-armv.c | 7 ++++ arch/arm/mm/fault.c | 22 +++++++++----- arch/arm/mm/idmap.c | 3 +- arch/arm/mm/init.c | 2 - arch/arm/mm/ioremap.c | 12 ++++++-- arch/arm/mm/mm.h | 2 - arch/arm/mm/mmu.c | 35 +++++++++++++++++++---- arch/arm/mm/pgd.c | 40 ++++++++++++++++++++++----- 12 files changed, 125 insertions(+), 37 deletions(-)
arch/arm/include/asm/pgtable.h renamed from arch/arm/include/asm/pgtable.h~arm-add-support-for-folded-p4d-page-tables +0 -1
@@ -17,7 +17,6 @@#else -#define __ARCH_USE_5LEVEL_HACK#include <asm-generic/pgtable-nopud.h> #include <asm/memory.h> #include <asm/pgtable-hwdef.h>
arch/arm/lib/uaccess_with_memcpy.c renamed from arch/arm/lib/uaccess_with_memcpy.c~arm-add-support-for-folded-p4d-page-tables +6 -1
@@ -24,6 +24,7 @@ pin_page_for_write(const void __user *_a {unsigned long addr = (unsigned long )_addr;pgd_t *pgd; +p4d_t *p4d;pmd_t *pmd;pte_t *pte;pud_t *pud;
@@ -33,7 +34,11 @@ pin_page_for_write(const void __user *_aif (unlikely (pgd_none (*pgd) ||pgd_bad (*pgd)))return 0 ; - pud =pud_offset (pgd, addr); + p4d =p4d_offset (pgd, addr); +if (unlikely (p4d_none (*p4d) ||p4d_bad (*p4d))) +return 0 ; + + pud =pud_offset (p4d, addr);if (unlikely (pud_none (*pud) ||pud_bad (*pud)))return 0 ;
arch/arm/mach-sa1100/assabet.c renamed from arch/arm/mach-sa1100/assabet.c~arm-add-support-for-folded-p4d-page-tables +1 -1
@@ -633,7 +633,7 @@ static void __init map_sa1100_gpio_regs(int prot =PMD_TYPE_SECT |PMD_SECT_AP_WRITE |PMD_DOMAIN (DOMAIN_IO );pmd_t *pmd; - pmd =pmd_offset (pud_offset (pgd_offset_k (virt), virt), virt); + pmd =pmd_offset (pud_offset (p4d_offset (pgd_offset_k (virt), virt), virt), virt); *pmd =__pmd (phys | prot);flush_pmd_entry (pmd); }
arch/arm/mm/dump.c renamed from arch/arm/mm/dump.c~arm-add-support-for-folded-p4d-page-tables +23 -6
@@ -207,6 +207,7 @@ struct pg_level {static struct pg_level pg_level[] = { { }, {/* pgd */ + }, {/* p4d */ }, {/* pud */ }, {/* pmd */ .bits = section_bits,
@@ -308,7 +309,7 @@ static void walk_pte(struct pg_state *stfor (i =0 ; i <PTRS_PER_PTE ; i++, pte++) { addr = start + i *PAGE_SIZE ; -note_page (st, addr,4 ,pte_val (*pte), domain); +note_page (st, addr,5 ,pte_val (*pte), domain); } }
@@ -350,14 +351,14 @@ static void walk_pmd(struct pg_state *st addr +=SECTION_SIZE ; pmd++; domain =get_domain_name (pmd); -note_page (st, addr,3 ,pmd_val (*pmd), domain); +note_page (st, addr,4 ,pmd_val (*pmd), domain); } } } -static void walk_pud (struct pg_state *st,pgd_t *pgd,unsigned long start) +static void walk_pud (struct pg_state *st,p4d_t *p4d,unsigned long start) { -pud_t *pud =pud_offset (pgd,0 ); +pud_t *pud =pud_offset (p4d,0 );unsigned long addr;unsigned i;
@@ -366,7 +367,23 @@ static void walk_pud(struct pg_state *stif (!pud_none (*pud)) {walk_pmd (st, pud, addr); }else { -note_page (st, addr,2 ,pud_val (*pud),NULL ); +note_page (st, addr,3 ,pud_val (*pud),NULL ); + } + } +} + +static void walk_p4d (struct pg_state *st,pgd_t *pgd,unsigned long start) +{ +p4d_t *p4d =p4d_offset (pgd,0 ); +unsigned long addr; +unsigned i; + +for (i =0 ; i <PTRS_PER_P4D ; i++, p4d++) { + addr = start + i *P4D_SIZE ; +if (!p4d_none (*p4d)) { +walk_pud (st, p4d, addr); + }else { +note_page (st, addr,2 ,p4d_val (*p4d),NULL ); } } }
@@ -381,7 +398,7 @@ static void walk_pgd(struct pg_state *stfor (i =0 ; i <PTRS_PER_PGD ; i++, pgd++) { addr = start + i *PGDIR_SIZE ;if (!pgd_none (*pgd)) { -walk_pud (st, pgd, addr); +walk_p4d (st, pgd, addr); }else {note_page (st, addr,1 ,pgd_val (*pgd),NULL ); }
arch/arm/mm/fault-armv.c renamed from arch/arm/mm/fault-armv.c~arm-add-support-for-folded-p4d-page-tables +6 -1
@@ -91,6 +91,7 @@ static int adjust_pte(struct vm_area_str {spinlock_t *ptl;pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;pte_t *pte;
@@ -100,7 +101,11 @@ static int adjust_pte(struct vm_area_strif (pgd_none_or_clear_bad (pgd))return 0 ; - pud =pud_offset (pgd, address); + p4d =p4d_offset (pgd, address); +if (p4d_none_or_clear_bad (p4d)) +return 0 ; + + pud =pud_offset (p4d, address);if (pud_none_or_clear_bad (pud))return 0 ;
arch/arm/mm/fault.c renamed from arch/arm/mm/fault.c~arm-add-support-for-folded-p4d-page-tables +14 -8
@@ -43,19 +43,21 @@ void show_pte(const char *lvl, struct mmprintk ("%s[%08lx] *pgd=%08llx" , lvl, addr, (long long )pgd_val (*pgd)); do { + p4d_t *p4d; pud_t *pud; pmd_t *pmd; pte_t *pte; - if (pgd_none(*pgd)) + p4d = p4d_offset(pgd, addr); + if (p4d_none(*p4d)) break; - if (pgd_bad(*pgd)) { + if (p4d_bad(*p4d)) { pr_cont("(bad)"); break; } - pud = pud_offset(pgd, addr); + pud = pud_offset(p4d, addr); if (PTRS_PER_PUD != 1) pr_cont(", *pud=%08llx", (long long)pud_val(*pud));
@@ -405,6 +407,7 @@ do_translation_fault(unsigned long addr, {unsigned int index;pgd_t *pgd, *pgd_k; +p4d_t *p4d, *p4d_k;pud_t *pud, *pud_k;pmd_t *pmd, *pmd_k;
@@ -419,13 +422,16 @@ do_translation_fault(unsigned long addr, pgd =cpu_get_pgd () + index; pgd_k = init_mm.pgd + index; -if (pgd_none (*pgd_k)) + p4d =p4d_offset (pgd, addr); + p4d_k =p4d_offset (pgd_k, addr); + +if (p4d_none (*p4d_k)) goto bad_area; -if (!pgd_present (*pgd)) -set_pgd (pgd, *pgd_k); +if (!p4d_present (*p4d)) +set_p4d (p4d, *p4d_k); - pud =pud_offset (pgd, addr); - pud_k =pud_offset (pgd_k, addr); + pud =pud_offset (p4d, addr); + pud_k =pud_offset (p4d_k, addr);if (pud_none (*pud_k)) goto bad_area;
arch/arm/mm/idmap.c renamed from arch/arm/mm/idmap.c~arm-add-support-for-folded-p4d-page-tables +2 -1
@@ -68,7 +68,8 @@ static void idmap_add_pmd(pud_t *pud, unstatic void idmap_add_pud (pgd_t *pgd,unsigned long addr,unsigned long end,unsigned long prot) { -pud_t *pud =pud_offset (pgd, addr); +p4d_t *p4d =p4d_offset (pgd, addr); +pud_t *pud =pud_offset (p4d, addr);unsigned long next; do {
arch/arm/mm/init.c renamed from arch/arm/mm/init.c~arm-add-support-for-folded-p4d-page-tables +1 -1
@@ -571,7 +571,7 @@ static inline void section_update(unsign {pmd_t *pmd; - pmd =pmd_offset (pud_offset (pgd_offset (mm, addr), addr), addr); + pmd =pmd_off_k (addr);#ifdef CONFIG_ARM_LPAE pmd[0 ] =__pmd ((pmd_val (pmd[0 ]) & mask) | prot);
arch/arm/mm/ioremap.c renamed from arch/arm/mm/ioremap.c~arm-add-support-for-folded-p4d-page-tables +9 -3
@@ -142,12 +142,14 @@ static void unmap_area_sections(unsigned {unsigned long addr = virt, end = virt + (size & ~(SZ_1M -1 ));pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmdp;flush_cache_vunmap (addr, end); pgd =pgd_offset_k (addr); - pud =pud_offset (pgd, addr); + p4d =p4d_offset (pgd, addr); + pud =pud_offset (p4d, addr); pmdp =pmd_offset (pud, addr); do { pmd_t pmd = *pmdp;
@@ -190,6 +192,7 @@ remap_area_sections(unsigned long virt, {unsigned long addr = virt, end = virt + size;pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;
@@ -200,7 +203,8 @@ remap_area_sections(unsigned long virt,unmap_area_sections (virt, size); pgd =pgd_offset_k (addr); - pud =pud_offset (pgd, addr); + p4d =p4d_offset (pgd, addr); + pud =pud_offset (p4d, addr); pmd =pmd_offset (pud, addr); do { pmd[0] = __pmd(__pfn_to_phys(pfn) | type->prot_sect);
@@ -222,6 +226,7 @@ remap_area_supersections(unsigned long v {unsigned long addr = virt, end = virt + size;pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;
@@ -232,7 +237,8 @@ remap_area_supersections(unsigned long vunmap_area_sections (virt, size); pgd =pgd_offset_k (virt); - pud =pud_offset (pgd, addr); + p4d =p4d_offset (pgd, addr); + pud =pud_offset (p4d, addr); pmd =pmd_offset (pud, addr); do { unsigned long super_pmd_val, i;
arch/arm/mm/mm.h renamed from arch/arm/mm/mm.h~arm-add-support-for-folded-p4d-page-tables +1 -1
@@ -38,7 +38,7 @@ static inline pte_t get_top_pte(unsignedstatic inline pmd_t *pmd_off_k (unsigned long virt) { -return pmd_offset (pud_offset (pgd_offset_k (virt), virt), virt); +return pmd_offset (pud_offset (p4d_offset (pgd_offset_k (virt), virt), virt), virt); }struct mem_type {
arch/arm/mm/mmu.c renamed from arch/arm/mm/mmu.c~arm-add-support-for-folded-p4d-page-tables +29 -6
@@ -357,7 +357,8 @@ static pte_t *pte_offset_late_fixmap(pmdstatic inline pmd_t *__init fixmap_pmd (unsigned long addr) {pgd_t *pgd =pgd_offset_k (addr); -pud_t *pud =pud_offset (pgd, addr); +p4d_t *p4d =p4d_offset (pgd, addr); +pud_t *pud =pud_offset (p4d, addr);pmd_t *pmd =pmd_offset (pud, addr);return pmd;
@@ -801,12 +802,12 @@ static void __init alloc_init_pmd(pud_t }while (pmd++, addr = next, addr != end); } -static void __init alloc_init_pud (pgd_t *pgd,unsigned long addr, +static void __init alloc_init_pud (p4d_t *p4d,unsigned long addr,unsigned long end,phys_addr_t phys,const struct mem_type *type,void *(*alloc)(unsigned long sz),bool ng) { -pud_t *pud =pud_offset (pgd, addr); +pud_t *pud =pud_offset (p4d, addr);unsigned long next; do {
@@ -816,6 +817,21 @@ static void __init alloc_init_pud(pgd_t }while (pud++, addr = next, addr != end); } +static void __init alloc_init_p4d (pgd_t *pgd,unsigned long addr, +unsigned long end,phys_addr_t phys, +const struct mem_type *type, +void *(*alloc)(unsigned long sz),bool ng) +{ +p4d_t *p4d =p4d_offset (pgd, addr); +unsigned long next; + +do { + next =p4d_addr_end (addr, end); +alloc_init_pud (p4d, addr, next, phys, type, alloc, ng); + phys += next - addr; + }while (p4d++, addr = next, addr != end); +} +#ifndef CONFIG_ARM_LPAE static void __init create_36bit_mapping(struct mm_struct *mm, struct map_desc *md,
@@ -863,7 +879,8 @@ static void __init create_36bit_mapping( pgd =pgd_offset (mm, addr); end = addr + length; do { - pud_t *pud = pud_offset(pgd, addr); + p4d_t *p4d = p4d_offset(pgd, addr); + pud_t *pud = pud_offset(p4d, addr); pmd_t *pmd = pmd_offset(pud, addr); int i;
@@ -914,7 +931,7 @@ static void __init __create_mapping(stru do { unsigned long next = pgd_addr_end(addr, end); - alloc_init_pud(pgd, addr, next, phys, type, alloc, ng); + alloc_init_p4d(pgd, addr, next, phys, type, alloc, ng); phys += next - addr; addr = next;
@@ -950,7 +967,13 @@ void __init create_mapping_late(struct m bool ng) {#ifdef CONFIG_ARM_LPAE -pud_t *pud =pud_alloc (mm,pgd_offset (mm, md->virtual), md->virtual); +p4d_t *p4d; +pud_t *pud; + + p4d =p4d_alloc (mm,pgd_offset (mm, md->virtual), md->virtual); +if (!WARN_ON (!p4d)) +return ; + pud =pud_alloc (mm, p4d, md->virtual);if (WARN_ON (!pud))return ;pmd_alloc (mm, pud,0 );
arch/arm/mm/pgd.c renamed from arch/arm/mm/pgd.c~arm-add-support-for-folded-p4d-page-tables +33 -7
@@ -30,6 +30,7 @@pgd_t *pgd_alloc (struct mm_struct *mm) {pgd_t *new_pgd, *init_pgd; +p4d_t *new_p4d, *init_p4d;pud_t *new_pud, *init_pud;pmd_t *new_pmd, *init_pmd;pte_t *new_pte, *init_pte;
@@ -53,8 +54,12 @@ pgd_t *pgd_alloc(struct mm_struct *mm)/* * Allocate PMD table for modules and pkmap mappings. */ - new_pud =pud_alloc (mm, new_pgd +pgd_index (MODULES_VADDR ), + new_p4d =p4d_alloc (mm, new_pgd +pgd_index (MODULES_VADDR ),MODULES_VADDR ); +if (!new_p4d) + goto no_p4d; + + new_pud =pud_alloc (mm, new_p4d,MODULES_VADDR );if (!new_pud) goto no_pud;
@@ -69,7 +74,11 @@ pgd_t *pgd_alloc(struct mm_struct *mm)* contains the machine vectors. The vectors are always high * with LPAE. */ - new_pud =pud_alloc (mm, new_pgd,0 ); + new_p4d =p4d_alloc (mm, new_pgd,0 ); +if (!new_p4d) + goto no_p4d; + + new_pud =pud_alloc (mm, new_p4d,0 );if (!new_pud) goto no_pud;
@@ -91,7 +100,8 @@ pgd_t *pgd_alloc(struct mm_struct *mm)pmd_val (*new_pmd) |=PMD_DOMAIN (DOMAIN_VECTORS );#endif - init_pud =pud_offset (init_pgd,0 ); + init_p4d =p4d_offset (init_pgd,0 ); + init_pud =pud_offset (init_p4d,0 ); init_pmd =pmd_offset (init_pud,0 ); init_pte =pte_offset_map (init_pmd,0 );set_pte_ext (new_pte +0 , init_pte[0 ],0 );
@@ -108,6 +118,8 @@ no_pte: no_pmd:pud_free (mm, new_pud); no_pud: +p4d_free (mm, new_p4d); +no_p4d:__pgd_free (new_pgd); no_pgd:return NULL ;
@@ -116,6 +128,7 @@ no_pgd:void pgd_free (struct mm_struct *mm,pgd_t *pgd_base) {pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;pgtable_t pte;
@@ -127,7 +140,11 @@ void pgd_free(struct mm_struct *mm, pgd_if (pgd_none_or_clear_bad (pgd)) goto no_pgd; - pud =pud_offset (pgd,0 ); + p4d =p4d_offset (pgd,0 ); +if (p4d_none_or_clear_bad (p4d)) + goto no_p4d; + + pud =pud_offset (p4d,0 );if (pud_none_or_clear_bad (pud)) goto no_pud;
@@ -144,8 +161,11 @@ no_pmd:pmd_free (mm, pmd);mm_dec_nr_pmds (mm); no_pud: -pgd_clear (pgd); +p4d_clear (p4d);pud_free (mm, pud); +no_p4d: +pgd_clear (pgd); +p4d_free (mm, p4d); no_pgd: #ifdef CONFIG_ARM_LPAE/*
@@ -156,15 +176,21 @@ no_pgd:continue ;if (pgd_val (*pgd) &L_PGD_SWAPPER )continue ; - pud =pud_offset (pgd,0 ); + p4d =p4d_offset (pgd,0 ); +if (p4d_none_or_clear_bad (p4d)) +continue ; + pud =pud_offset (p4d,0 );if (pud_none_or_clear_bad (pud))continue ; pmd =pmd_offset (pud,0 );pud_clear (pud);pmd_free (mm, pmd);mm_dec_nr_pmds (mm); -pgd_clear (pgd); +p4d_clear (p4d);pud_free (mm, pud); +mm_dec_nr_puds (mm); +pgd_clear (pgd); + p4d_free(mm, p4d); }#endif __pgd_free (pgd_base);
_
Patches currently in -mm which might be from [email protected] are
h8300-remove-usage-of-__arch_use_5level_hack.patch arm-add-support-for-folded-p4d-page-tables.patch arm64-add-support-for-folded-p4d-page-tables.patch hexagon-remove-__arch_use_5level_hack.patch ia64-add-support-for-folded-p4d-page-tables.patch nios2-add-support-for-folded-p4d-page-tables.patch openrisc-add-support-for-folded-p4d-page-tables.patch powerpc-add-support-for-folded-p4d-page-tables.patch sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch sh-add-support-for-folded-p4d-page-tables.patch unicore32-remove-__arch_use_5level_hack.patch asm-generic-remove-pgtable-nop4d-hackh.patch mm-remove-__arch_has_5level_hack-and-include-asm-generic-5level-fixuph.patch mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ arm64-add-support-for-folded-p4d-page-tables.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: arm64: add support for folded p4d page tables has been added to the -mm tree. Its filename is arm64-add-support-for-folded-p4d-page-tables.patch
The patch titled
Subject: arm64: add support for folded p4d page tables
has been added to the -mm tree. Its filename is
arm64-add-support-for-folded-p4d-page-tables.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/arm64-add-support-for-folded-p4d-page-tables.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/arm64-add-support-for-folded-p4d-page-tables.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: arm64: add support for folded p4d page tables
Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate, replace 5level-fixup.h with pgtable-nop4d.h and remove __ARCH_USE_5LEVEL_HACK.
---
arch/arm64/include/asm/kvm_mmu.h | 10 - arch/arm64/include/asm/pgalloc.h | 10 - arch/arm64/include/asm/pgtable-types.h | 5 arch/arm64/include/asm/pgtable.h | 37 ++- arch/arm64/include/asm/stage2_pgtable.h | 48 +++-- arch/arm64/kernel/hibernate.c | 44 +++- arch/arm64/mm/fault.c | 9 arch/arm64/mm/hugetlbpage.c | 15 + arch/arm64/mm/kasan_init.c | 26 ++ arch/arm64/mm/mmu.c | 52 +++-- arch/arm64/mm/pageattr.c | 7 virt/kvm/arm/mmu.c | 209 ++++++++++++++++++---- 12 files changed, 368 insertions(+), 104 deletions(-)
arch/arm64/include/asm/kvm_mmu.h renamed from arch/arm64/include/asm/kvm_mmu.h~arm64-add-support-for-folded-p4d-page-tables +8 -2
@@ -172,8 +172,8 @@ void kvm_clear_hyp_idmap(void); __pmd(__phys_to_pmd_val(__pa(ptep)) | PMD_TYPE_TABLE)#define kvm_mk_pud (pmdp) \ __pud(__phys_to_pud_val(__pa(pmdp)) | PMD_TYPE_TABLE) -#define kvm_mk_pgd (pudp) \ - __pgd(__phys_to_pgd_val(__pa(pudp)) | PUD_TYPE_TABLE) +#define kvm_mk_p4d (pmdp) \ + __p4d(__phys_to_p4d_val(__pa(pmdp)) | PUD_TYPE_TABLE)#define kvm_set_pud (pudp, pud) set_pud(pudp, pud)
@@ -299,6 +299,12 @@ static inline bool kvm_s2pud_young(pud_t#define hyp_pud_table_empty (pudp) kvm_page_empty(pudp)#endif +#ifdef __PAGETABLE_P4D_FOLDED +#define hyp_p4d_table_empty (p4dp) (0) +#else +#define hyp_p4d_table_empty (p4dp) kvm_page_empty(p4dp) +#endif +struct kvm ;#define kvm_flush_dcache_to_poc (a,l) __flush_dcache_area((a), (l))
arch/arm64/include/asm/pgalloc.h renamed from arch/arm64/include/asm/pgalloc.h~arm64-add-support-for-folded-p4d-page-tables +5 -5
@@ -73,17 +73,17 @@ static inline void pud_free(struct mm_st free_page((unsigned long)pudp); } -static inline void __pgd_populate (pgd_t *pgdp,phys_addr_t pudp,pgdval_t prot) +static inline void __p4d_populate (p4d_t *p4dp,phys_addr_t pudp,p4dval_t prot) { -set_pgd (pgdp,__pgd (__phys_to_pgd_val (pudp) | prot)); +set_p4d (p4dp,__p4d (__phys_to_p4d_val (pudp) | prot)); } -static inline void pgd_populate (struct mm_struct *mm,pgd_t *pgdp,pud_t *pudp) +static inline void p4d_populate (struct mm_struct *mm,p4d_t *p4dp,pud_t *pudp) { -__pgd_populate (pgdp,__pa (pudp),PUD_TYPE_TABLE ); +__p4d_populate (p4dp,__pa (pudp),PUD_TYPE_TABLE ); }#else -static inline void __pgd_populate (pgd_t *pgdp,phys_addr_t pudp,pgdval_t prot) +static inline void __p4d_populate (p4d_t *p4dp,phys_addr_t pudp,p4dval_t prot) {BUILD_BUG (); }
arch/arm64/include/asm/pgtable.h renamed from arch/arm64/include/asm/pgtable.h~arm64-add-support-for-folded-p4d-page-tables +23 -14
@@ -298,6 +298,11 @@ static inline pte_t pgd_pte(pgd_t pgd)return __pte (pgd_val (pgd)); } +static inline pte_t p4d_pte (p4d_t p4d) +{ +return __pte (p4d_val (p4d)); +} +static inline pte_t pud_pte (pud_t pud) {return __pte (pud_val (pud));
@@ -401,6 +406,9 @@ static inline pmd_t pmd_mkdevmap(pmd_t p#define set_pmd_at (mm, addr, pmdp, pmd) set_pte_at(mm, addr, (pte_t *)pmdp, pmd_pte(pmd)) +#define __p4d_to_phys (p4d) __pte_to_phys(p4d_pte(p4d)) +#define __phys_to_p4d_val (phys) __phys_to_pte_val(phys) +#define __pgd_to_phys (pgd) __pte_to_phys(pgd_pte(pgd))#define __phys_to_pgd_val (phys) __phys_to_pte_val(phys)
@@ -588,49 +596,50 @@ static inline phys_addr_t pud_page_paddr#define pud_ERROR (pud) __pud_error(__FILE__, __LINE__, pud_val(pud)) -#define pgd_none (pgd) (!pgd_val(pgd)) -#define pgd_bad (pgd) (!(pgd_val(pgd) & 2)) -#define pgd_present (pgd) (pgd_val(pgd)) +#define p4d_none (p4d) (!p4d_val(p4d)) +#define p4d_bad (p4d) (!(p4d_val(p4d) & 2)) +#define p4d_present (p4d) (p4d_val(p4d)) -static inline void set_pgd (pgd_t *pgdp,pgd_t pgd) +static inline void set_p4d (p4d_t *p4dp,p4d_t p4d) { -if (in_swapper_pgdir (pgdp)) { -set_swapper_pgd (pgdp, pgd); +if (in_swapper_pgdir (p4dp)) { +set_swapper_pgd ((pgd_t *)p4dp,__pgd (p4d_val (p4d)));return ; } -WRITE_ONCE (*pgdp, pgd); +WRITE_ONCE (*p4dp, p4d);dsb (ishst);isb (); } -static inline void pgd_clear (pgd_t *pgdp) +static inline void p4d_clear (p4d_t *p4dp) { -set_pgd (pgdp,__pgd (0 )); +set_p4d (p4dp,__p4d (0 )); } -static inline phys_addr_t pgd_page_paddr (pgd_t pgd) +static inline phys_addr_t p4d_page_paddr (p4d_t p4d) { -return __pgd_to_phys (pgd); +return __p4d_to_phys (p4d); }/* Find an entry in the frst-level page table. */ #define pud_index (addr) (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1)) -#define pud_offset_phys (dir, addr) (pgd_page_paddr(READ_ONCE(*(dir))) + pud_index(addr) * sizeof(pud_t)) +#define pud_offset_phys (dir, addr) (p4d_page_paddr(READ_ONCE(*(dir))) + pud_index(addr) * sizeof(pud_t))#define pud_offset (dir, addr) ((pud_t *)__va(pud_offset_phys((dir), (addr))))#define pud_set_fixmap (addr) ((pud_t *)set_fixmap_offset(FIX_PUD, addr)) -#define pud_set_fixmap_offset (pgd, addr) pud_set_fixmap(pud_offset_phys(pgd, addr)) +#define pud_set_fixmap_offset (p4d, addr) pud_set_fixmap(pud_offset_phys(p4d, addr))#define pud_clear_fixmap () clear_fixmap(FIX_PUD) -#define pgd_page (pgd) pfn_to_page(__phys_to_pfn(__pgd_to_phys(pgd))) +#define p4d_page (p4d) pfn_to_page(__phys_to_pfn(__p4d_to_phys(p4d)))/* use ONLY for statically allocated translation tables */ #define pud_offset_kimg (dir,addr) ((pud_t *)__phys_to_kimg(pud_offset_phys((dir), (addr))))#else +#define p4d_page_paddr (p4d) ({ BUILD_BUG(); 0;})#define pgd_page_paddr (pgd) ({ BUILD_BUG(); 0;})/* Match pud_offset folding in <asm/generic/pgtable-nopud.h> */
arch/arm64/include/asm/pgtable-types.h renamed from arch/arm64/include/asm/pgtable-types.h~arm64-add-support-for-folded-p4d-page-tables +2 -3
@@ -14,6 +14,7 @@typedef u64 pteval_t ;typedef u64 pmdval_t ;typedef u64 pudval_t ; +typedef u64 p4dval_t ;typedef u64 pgdval_t ;/*
@@ -44,13 +45,11 @@ typedef struct { pteval_t pgprot; } pgpr#define __pgprot (x) ((pgprot_t) { (x) } )#if CONFIG_PGTABLE_LEVELS ==2 -#define __ARCH_USE_5LEVEL_HACK#include <asm-generic/pgtable-nopmd.h> #elif CONFIG_PGTABLE_LEVELS ==3 -#define __ARCH_USE_5LEVEL_HACK#include <asm-generic/pgtable-nopud.h> #elif CONFIG_PGTABLE_LEVELS ==4 -#include <asm-generic/5level-fixup.h> +#include <asm-generic/pgtable-nop4d.h> #endif #endif /* __ASM_PGTABLE_TYPES_H */
arch/arm64/include/asm/stage2_pgtable.h renamed from arch/arm64/include/asm/stage2_pgtable.h~arm64-add-support-for-folded-p4d-page-tables +37 -11
78 lines not on this page · raw message
arch/arm64/kernel/hibernate.c renamed from arch/arm64/kernel/hibernate.c~arm64-add-support-for-folded-p4d-page-tables +37 -7
85 lines not on this page · raw message
arch/arm64/mm/fault.c renamed from arch/arm64/mm/fault.c~arm64-add-support-for-folded-p4d-page-tables +8 -1
@@ -145,6 +145,7 @@ static void show_pte(unsigned long addr)pr_alert ("[%016lx] pgd=%016llx" , addr,pgd_val (pgd)); do { + p4d_t *p4dp, p4d; pud_t *pudp, pud; pmd_t *pmdp, pmd; pte_t *ptep, pte;
@@ -152,7 +153,13 @@ static void show_pte(unsigned long addr)if (pgd_none (pgd) ||pgd_bad (pgd))break ; - pudp =pud_offset (pgdp, addr); + p4dp =p4d_offset (pgdp, addr); + p4d =READ_ONCE (*p4dp); +pr_cont (", p4d=%016llx" ,p4d_val (p4d)); +if (p4d_none (p4d) ||p4d_bad (p4d)) +break ; + + pudp =pud_offset (p4dp, addr); pud =READ_ONCE (*pudp);pr_cont (", pud=%016llx" ,pud_val (pud));if (pud_none (pud) ||pud_bad (pud))
arch/arm64/mm/hugetlbpage.c renamed from arch/arm64/mm/hugetlbpage.c~arm64-add-support-for-folded-p4d-page-tables +12 -3
@@ -67,11 +67,13 @@ static int find_num_contig(struct mm_str pte_t *ptep, size_t *pgsize) {pgd_t *pgdp =pgd_offset (mm, addr); +p4d_t *p4dp;pud_t *pudp;pmd_t *pmdp; *pgsize =PAGE_SIZE ; - pudp =pud_offset (pgdp, addr); + p4dp =p4d_offset (pgdp, addr); + pudp =pud_offset (p4dp, addr); pmdp =pmd_offset (pudp, addr);if ((pte_t *)pmdp == ptep) { *pgsize =PMD_SIZE ;
@@ -217,12 +219,14 @@ pte_t *huge_pte_alloc(struct mm_struct * unsigned long addr, unsigned long sz) {pgd_t *pgdp; +p4d_t *p4dp;pud_t *pudp;pmd_t *pmdp;pte_t *ptep =NULL ; pgdp =pgd_offset (mm, addr); - pudp =pud_alloc (mm, pgdp, addr); + p4dp =p4d_offset (pgdp, addr); + pudp =pud_alloc (mm, p4dp, addr);if (!pudp)return NULL ;
@@ -259,6 +263,7 @@ pte_t *huge_pte_offset(struct mm_struct unsigned long addr, unsigned long sz) {pgd_t *pgdp; +p4d_t *p4dp;pud_t *pudp, pud;pmd_t *pmdp, pmd;
@@ -266,7 +271,11 @@ pte_t *huge_pte_offset(struct mm_structif (!pgd_present (READ_ONCE (*pgdp)))return NULL ; - pudp =pud_offset (pgdp, addr); + p4dp =p4d_offset (pgdp, addr); +if (!p4d_present (READ_ONCE (*p4dp))) +return NULL ; + + pudp =pud_offset (p4dp, addr); pud =READ_ONCE (*pudp);if (sz !=PUD_SIZE &&pud_none (pud))return NULL ;
arch/arm64/mm/kasan_init.c renamed from arch/arm64/mm/kasan_init.c~arm64-add-support-for-folded-p4d-page-tables +19 -7
@@ -84,17 +84,17 @@ static pmd_t *__init kasan_pmd_offset(pureturn early ?pmd_offset_kimg (pudp, addr) :pmd_offset (pudp, addr); } -static pud_t *__init kasan_pud_offset (pgd_t *pgdp,unsigned long addr,int node, +static pud_t *__init kasan_pud_offset (p4d_t *p4dp,unsigned long addr,int node,bool early) { -if (pgd_none (READ_ONCE (*pgdp))) { +if (p4d_none (READ_ONCE (*p4dp))) {phys_addr_t pud_phys = early ?__pa_symbol (kasan_early_shadow_pud) :kasan_alloc_zeroed_page (node); -__pgd_populate (pgdp, pud_phys,PMD_TYPE_TABLE ); +__p4d_populate (p4dp, pud_phys,PMD_TYPE_TABLE ); } -return early ?pud_offset_kimg (pgdp, addr) :pud_offset (pgdp, addr); +return early ?pud_offset_kimg (p4dp, addr) :pud_offset (p4dp, addr); } static void __init kasan_pte_populate(pmd_t *pmdp, unsigned long addr,
@@ -126,11 +126,11 @@ static void __init kasan_pmd_populate(pu }while (pmdp++, addr = next, addr != end &&pmd_none (READ_ONCE (*pmdp))); } -static void __init kasan_pud_populate (pgd_t *pgdp,unsigned long addr, +static void __init kasan_pud_populate (p4d_t *p4dp,unsigned long addr,unsigned long end,int node,bool early) {unsigned long next; -pud_t *pudp =kasan_pud_offset (pgdp, addr, node, early); +pud_t *pudp =kasan_pud_offset (p4dp, addr, node, early); do { next = pud_addr_end(addr, end);
@@ -138,6 +138,18 @@ static void __init kasan_pud_populate(pg }while (pudp++, addr = next, addr != end &&pud_none (READ_ONCE (*pudp))); } +static void __init kasan_p4d_populate (pgd_t *pgdp,unsigned long addr, +unsigned long end,int node,bool early) +{ +unsigned long next; +p4d_t *p4dp =p4d_offset (pgdp, addr); + +do { + next =p4d_addr_end (addr, end); +kasan_pud_populate (p4dp, addr, next, node, early); + }while (p4dp++, addr = next, addr != end); +} +static void __init kasan_pgd_populate (unsigned long addr,unsigned long end,int node,bool early) {
@@ -147,7 +159,7 @@ static void __init kasan_pgd_populate(un pgdp =pgd_offset_k (addr);do { next =pgd_addr_end (addr, end); -kasan_pud_populate (pgdp, addr, next, node, early); +kasan_p4d_populate (pgdp, addr, next, node, early); }while (pgdp++, addr = next, addr != end); }
arch/arm64/mm/mmu.c renamed from arch/arm64/mm/mmu.c~arm64-add-support-for-folded-p4d-page-tables +34 -18
127 lines not on this page · raw message
arch/arm64/mm/pageattr.c renamed from arch/arm64/mm/pageattr.c~arm64-add-support-for-folded-p4d-page-tables +6 -1
@@ -198,6 +198,7 @@ void __kernel_map_pages(struct page *pagbool kernel_page_present (struct page *page) {pgd_t *pgdp; +p4d_t *p4dp;pud_t *pudp, pud;pmd_t *pmdp, pmd;pte_t *ptep;
@@ -210,7 +211,11 @@ bool kernel_page_present(struct page *paif (pgd_none (READ_ONCE (*pgdp)))return false; - pudp =pud_offset (pgdp, addr); + p4dp =p4d_offset (pgdp, addr); +if (p4d_none (READ_ONCE (*p4dp))) +return false; + + pudp =pud_offset (p4dp, addr); pud =READ_ONCE (*pudp);if (pud_none (pud))return false;
virt/kvm/arm/mmu.c renamed from virt/kvm/arm/mmu.c~arm64-add-support-for-folded-p4d-page-tables +177 -32
388 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are
h8300-remove-usage-of-__arch_use_5level_hack.patch arm-add-support-for-folded-p4d-page-tables.patch arm64-add-support-for-folded-p4d-page-tables.patch hexagon-remove-__arch_use_5level_hack.patch ia64-add-support-for-folded-p4d-page-tables.patch nios2-add-support-for-folded-p4d-page-tables.patch openrisc-add-support-for-folded-p4d-page-tables.patch powerpc-add-support-for-folded-p4d-page-tables.patch sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch sh-add-support-for-folded-p4d-page-tables.patch unicore32-remove-__arch_use_5level_hack.patch asm-generic-remove-pgtable-nop4d-hackh.patch mm-remove-__arch_has_5level_hack-and-include-asm-generic-5level-fixuph.patch mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ hexagon-remove-__arch_use_5level_hack.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: hexagon: remove __ARCH_USE_5LEVEL_HACK has been added to the -mm tree. Its filename is hexagon-remove-__arch_use_5level_hack.patch
The patch titled
Subject: hexagon: remove __ARCH_USE_5LEVEL_HACK
has been added to the -mm tree. Its filename is
hexagon-remove-__arch_use_5level_hack.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/hexagon-remove-__arch_use_5level_hack.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/hexagon-remove-__arch_use_5level_hack.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: hexagon: remove __ARCH_USE_5LEVEL_HACK
The hexagon architecture has 2 level page tables and as such most of the page table folding is already implemented in asm-generic/pgtable-nopmd.h.
Fixup the only place in arch/hexagon to unfold the p4d level and remove __ARCH_USE_5LEVEL_HACK.
---
arch/hexagon/include/asm/fixmap.h | 4 ++-- arch/hexagon/include/asm/pgtable.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-)
arch/hexagon/include/asm/fixmap.h renamed from arch/hexagon/include/asm/fixmap.h~hexagon-remove-__arch_use_5level_hack +2 -2
@@ -16,7 +16,7 @@#include <asm-generic/fixmap.h> #define kmap_get_fixmap_pte (vaddr) \ - pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), \ - (vaddr)), (vaddr)), (vaddr)) + pte_offset_kernel(pmd_offset(pud_offset(p4d_offset(pgd_offset_k(vaddr), \ + (vaddr)), (vaddr)), (vaddr)), (vaddr))#endif
arch/hexagon/include/asm/pgtable.h renamed from arch/hexagon/include/asm/pgtable.h~hexagon-remove-__arch_use_5level_hack +0 -1
@@ -12,7 +12,6 @@* Page table definitions for Qualcomm Hexagon processor. */ #include <asm/page.h> -#define __ARCH_USE_5LEVEL_HACK#include <asm-generic/pgtable-nopmd.h> /* A handy thing to have if one has the RAM. Declared in head.S */
_
Patches currently in -mm which might be from [email protected] are
h8300-remove-usage-of-__arch_use_5level_hack.patch arm-add-support-for-folded-p4d-page-tables.patch arm64-add-support-for-folded-p4d-page-tables.patch hexagon-remove-__arch_use_5level_hack.patch ia64-add-support-for-folded-p4d-page-tables.patch nios2-add-support-for-folded-p4d-page-tables.patch openrisc-add-support-for-folded-p4d-page-tables.patch powerpc-add-support-for-folded-p4d-page-tables.patch sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch sh-add-support-for-folded-p4d-page-tables.patch unicore32-remove-__arch_use_5level_hack.patch asm-generic-remove-pgtable-nop4d-hackh.patch mm-remove-__arch_has_5level_hack-and-include-asm-generic-5level-fixuph.patch mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ ia64-add-support-for-folded-p4d-page-tables.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: ia64: add support for folded p4d page tables has been added to the -mm tree. Its filename is ia64-add-support-for-folded-p4d-page-tables.patch
The patch titled
Subject: ia64: add support for folded p4d page tables
has been added to the -mm tree. Its filename is
ia64-add-support-for-folded-p4d-page-tables.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/ia64-add-support-for-folded-p4d-page-tables.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/ia64-add-support-for-folded-p4d-page-tables.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: ia64: add support for folded p4d page tables
Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate, remove usage of __ARCH_USE_5LEVEL_HACK and replace 5level-fixup.h with pgtable-nop4d.h
---
arch/ia64/include/asm/pgalloc.h | 4 ++-- arch/ia64/include/asm/pgtable.h | 17 ++++++++--------- arch/ia64/mm/fault.c | 7 ++++++- arch/ia64/mm/hugetlbpage.c | 18 ++++++++++++------ arch/ia64/mm/init.c | 28 ++++++++++++++++++++++++---- 5 files changed, 52 insertions(+), 22 deletions(-)
arch/ia64/include/asm/pgalloc.h renamed from arch/ia64/include/asm/pgalloc.h~ia64-add-support-for-folded-p4d-page-tables +2 -2
@@ -36,9 +36,9 @@ static inline void pgd_free(struct mm_st#if CONFIG_PGTABLE_LEVELS ==4 static inline void -pgd_populate (struct mm_struct *mm,pgd_t * pgd_entry,pud_t * pud) +p4d_populate (struct mm_struct *mm,p4d_t * p4d_entry,pud_t * pud) { -pgd_val (*pgd_entry) =__pa (pud); +p4d_val (*p4d_entry) =__pa (pud); }static inline pud_t *pud_alloc_one (struct mm_struct *mm,unsigned long addr)
arch/ia64/include/asm/pgtable.h renamed from arch/ia64/include/asm/pgtable.h~ia64-add-support-for-folded-p4d-page-tables +8 -9
@@ -283,12 +283,12 @@ extern unsigned long VMALLOC_END;#define pud_page (pud) virt_to_page((pud_val(pud) + PAGE_OFFSET))#if CONFIG_PGTABLE_LEVELS ==4 -#define pgd_none (pgd) (!pgd_val(pgd)) -#define pgd_bad (pgd) (!ia64_phys_addr_valid(pgd_val(pgd))) -#define pgd_present (pgd) (pgd_val(pgd) != 0UL) -#define pgd_clear (pgdp) (pgd_val(*(pgdp)) = 0UL) -#define pgd_page_vaddr (pgd) ((unsigned long) __va(pgd_val(pgd) & _PFN_MASK)) -#define pgd_page (pgd) virt_to_page((pgd_val(pgd) + PAGE_OFFSET)) +#define p4d_none (p4d) (!p4d_val(p4d)) +#define p4d_bad (p4d) (!ia64_phys_addr_valid(p4d_val(p4d))) +#define p4d_present (p4d) (p4d_val(p4d) != 0UL) +#define p4d_clear (p4dp) (p4d_val(*(p4dp)) = 0UL) +#define p4d_page_vaddr (p4d) ((unsigned long) __va(p4d_val(p4d) & _PFN_MASK)) +#define p4d_page (p4d) virt_to_page((p4d_val(p4d) + PAGE_OFFSET))#endif /*
@@ -386,7 +386,7 @@ pgd_offset (const struct mm_struct *mm,#if CONFIG_PGTABLE_LEVELS ==4 /* Find an entry in the second-level page table.. */ #define pud_offset (dir,addr) \ - ((pud_t *) pgd_page_vaddr(*(dir)) + (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))) + ((pud_t *) p4d_page_vaddr(*(dir)) + (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1)))#endif /* Find an entry in the third-level page table.. */
@@ -580,10 +580,9 @@ extern struct page *zero_page_memmap_ptr#if CONFIG_PGTABLE_LEVELS ==3 -#define __ARCH_USE_5LEVEL_HACK#include <asm-generic/pgtable-nopud.h> #endif -#include <asm-generic/5level-fixup.h> +#include <asm-generic/pgtable-nop4d.h> #include <asm-generic/pgtable.h> #endif /* _ASM_IA64_PGTABLE_H */
arch/ia64/mm/fault.c renamed from arch/ia64/mm/fault.c~ia64-add-support-for-folded-p4d-page-tables +6 -1
@@ -29,6 +29,7 @@ static int mapped_kernel_page_is_present (unsigned long address) {pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;pte_t *ptep, pte;
@@ -37,7 +38,11 @@ mapped_kernel_page_is_present (unsignedif (pgd_none (*pgd) ||pgd_bad (*pgd))return 0 ; - pud =pud_offset (pgd, address); + p4d =p4d_offset (pgd, address); +if (p4d_none (*p4d) ||p4d_bad (*p4d)) +return 0 ; + + pud =pud_offset (p4d, address);if (pud_none (*pud) ||pud_bad (*pud))return 0 ;
arch/ia64/mm/hugetlbpage.c renamed from arch/ia64/mm/hugetlbpage.c~ia64-add-support-for-folded-p4d-page-tables +12 -6
@@ -30,12 +30,14 @@ huge_pte_alloc(struct mm_struct *mm, uns {unsigned long taddr =htlbpage_to_page (addr);pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;pte_t *pte =NULL ; pgd =pgd_offset (mm, taddr); - pud =pud_alloc (mm, pgd, taddr); + p4d =p4d_offset (pgd, taddr); + pud =pud_alloc (mm, p4d, taddr);if (pud) { pmd =pmd_alloc (mm, pud, taddr);if (pmd)
@@ -49,17 +51,21 @@ huge_pte_offset (struct mm_struct *mm, u {unsigned long taddr =htlbpage_to_page (addr);pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;pte_t *pte =NULL ; pgd =pgd_offset (mm, taddr);if (pgd_present (*pgd)) { - pud =pud_offset (pgd, taddr); -if (pud_present (*pud)) { - pmd =pmd_offset (pud, taddr); -if (pmd_present (*pmd)) - pte =pte_offset_map (pmd, taddr); + p4d =p4d_offset (pgd, addr); +if (p4d_present (*p4d)) { + pud =pud_offset (p4d, taddr); +if (pud_present (*pud)) { + pmd =pmd_offset (pud, taddr); +if (pmd_present (*pmd)) + pte =pte_offset_map (pmd, taddr); + } } }
arch/ia64/mm/init.c renamed from arch/ia64/mm/init.c~ia64-add-support-for-folded-p4d-page-tables +24 -4
@@ -208,6 +208,7 @@ static struct page * __init put_kernel_page (struct page *page, unsigned long address, pgprot_t pgprot) { pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;pte_t *pte;
@@ -215,7 +216,10 @@ put_kernel_page (struct page *page, unsi pgd =pgd_offset_k (address);/* note: this is NOT pgd_offset()! */ { - pud =pud_alloc (&init_mm, pgd, address); + p4d =p4d_alloc (&init_mm, pgd, address); +if (!p4d) + goto out; + pud =pud_alloc (&init_mm, p4d, address);if (!pud) goto out; pmd =pmd_alloc (&init_mm, pud, address);
@@ -382,6 +386,7 @@ int vmemmap_find_next_valid_pfn(int node do { pgd_t *pgd; + p4d_t *p4d; pud_t *pud; pmd_t *pmd; pte_t *pte;
@@ -392,7 +397,13 @@ int vmemmap_find_next_valid_pfn(int nodecontinue ; } - pud =pud_offset (pgd, end_address); + p4d =p4d_offset (pgd, end_address); +if (p4d_none (*p4d)) { + end_address +=P4D_SIZE ; +continue ; + } + + pud =pud_offset (p4d, end_address);if (pud_none (*pud)) { end_address +=PUD_SIZE ;continue ;
@@ -430,6 +441,7 @@ int __init create_mem_map_page_table(u64struct page *map_start, *map_end;int node;pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;pte_t *pte;
@@ -444,12 +456,20 @@ int __init create_mem_map_page_table(u64for (address = start_page; address < end_page; address +=PAGE_SIZE ) { pgd =pgd_offset_k (address);if (pgd_none (*pgd)) { + p4d =memblock_alloc_node (PAGE_SIZE ,PAGE_SIZE , node); +if (!p4d) + goto err_alloc; +pgd_populate (&init_mm, pgd, p4d); + } + p4d =p4d_offset (pgd, address); + +if (p4d_none (*p4d)) { pud =memblock_alloc_node (PAGE_SIZE ,PAGE_SIZE , node);if (!pud) goto err_alloc; -pgd_populate (&init_mm, pgd, pud); +p4d_populate (&init_mm, p4d, pud); } - pud =pud_offset (pgd, address); + pud =pud_offset (p4d, address);if (pud_none (*pud)) { pmd =memblock_alloc_node (PAGE_SIZE ,PAGE_SIZE , node);
_
Patches currently in -mm which might be from [email protected] are
h8300-remove-usage-of-__arch_use_5level_hack.patch arm-add-support-for-folded-p4d-page-tables.patch arm64-add-support-for-folded-p4d-page-tables.patch hexagon-remove-__arch_use_5level_hack.patch ia64-add-support-for-folded-p4d-page-tables.patch nios2-add-support-for-folded-p4d-page-tables.patch openrisc-add-support-for-folded-p4d-page-tables.patch powerpc-add-support-for-folded-p4d-page-tables.patch sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch sh-add-support-for-folded-p4d-page-tables.patch unicore32-remove-__arch_use_5level_hack.patch asm-generic-remove-pgtable-nop4d-hackh.patch mm-remove-__arch_has_5level_hack-and-include-asm-generic-5level-fixuph.patch mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ nios2-add-support-for-folded-p4d-page-tables.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: nios2: add support for folded p4d page tables has been added to the -mm tree. Its filename is nios2-add-support-for-folded-p4d-page-tables.patch
The patch titled
Subject: nios2: add support for folded p4d page tables
has been added to the -mm tree. Its filename is
nios2-add-support-for-folded-p4d-page-tables.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/nios2-add-support-for-folded-p4d-page-tables.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/nios2-add-support-for-folded-p4d-page-tables.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: nios2: add support for folded p4d page tables
Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and remove usage of __ARCH_USE_5LEVEL_HACK.
---
arch/nios2/include/asm/pgtable.h | 3 +-- arch/nios2/mm/fault.c | 9 +++++++-- arch/nios2/mm/ioremap.c | 6 +++++- 3 files changed, 13 insertions(+), 5 deletions(-)
arch/nios2/include/asm/pgtable.h renamed from arch/nios2/include/asm/pgtable.h~nios2-add-support-for-folded-p4d-page-tables +1 -2
@@ -22,7 +22,6 @@#include <asm/tlbflush.h> #include <asm/pgtable-bits.h> -#define __ARCH_USE_5LEVEL_HACK#include <asm-generic/pgtable-nopmd.h> #define FIRST_USER_ADDRESS 0UL
@@ -100,7 +99,7 @@ extern pte_t invalid_pte_table[PAGE_SIZE*/ static inline void set_pmd (pmd_t *pmdptr,pmd_t pmdval) { - pmdptr->pud.pgd.pgd = pmdval.pud.pgd.pgd; + *pmdptr = pmdval; }/* to find an entry in a page-table-directory */
arch/nios2/mm/fault.c renamed from arch/nios2/mm/fault.c~nios2-add-support-for-folded-p4d-page-tables +7 -2
@@ -242,6 +242,7 @@ vmalloc_fault:*/ int offset =pgd_index (address);pgd_t *pgd, *pgd_k; +p4d_t *p4d, *p4d_k;pud_t *pud, *pud_k;pmd_t *pmd, *pmd_k;pte_t *pte_k;
@@ -253,8 +254,12 @@ vmalloc_fault: goto no_context;set_pgd (pgd, *pgd_k); - pud =pud_offset (pgd, address); - pud_k =pud_offset (pgd_k, address); + p4d =p4d_offset (pgd, address); + p4d_k =p4d_offset (pgd_k, address); +if (!p4d_present (*p4d_k)) + goto no_context; + pud =pud_offset (p4d, address); + pud_k =pud_offset (p4d_k, address);if (!pud_present (*pud_k)) goto no_context; pmd =pmd_offset (pud, address);
arch/nios2/mm/ioremap.c renamed from arch/nios2/mm/ioremap.c~nios2-add-support-for-folded-p4d-page-tables +5 -1
@@ -86,11 +86,15 @@ static int remap_area_pages(unsigned lonif (address >= end)BUG (); do { + p4d_t *p4d; pud_t *pud; pmd_t *pmd; error = -ENOMEM; - pud = pud_alloc(&init_mm, dir, address); + p4d = p4d_alloc(&init_mm, dir, address); + if (!p4d) + break; + pud = pud_alloc(&init_mm, p4d, address); if (!pud) break; pmd = pmd_alloc(&init_mm, pud, address);
_
Patches currently in -mm which might be from [email protected] are
h8300-remove-usage-of-__arch_use_5level_hack.patch arm-add-support-for-folded-p4d-page-tables.patch arm64-add-support-for-folded-p4d-page-tables.patch hexagon-remove-__arch_use_5level_hack.patch ia64-add-support-for-folded-p4d-page-tables.patch nios2-add-support-for-folded-p4d-page-tables.patch openrisc-add-support-for-folded-p4d-page-tables.patch powerpc-add-support-for-folded-p4d-page-tables.patch sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch sh-add-support-for-folded-p4d-page-tables.patch unicore32-remove-__arch_use_5level_hack.patch asm-generic-remove-pgtable-nop4d-hackh.patch mm-remove-__arch_has_5level_hack-and-include-asm-generic-5level-fixuph.patch mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ openrisc-add-support-for-folded-p4d-page-tables.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: openrisc: add support for folded p4d page tables has been added to the -mm tree. Its filename is openrisc-add-support-for-folded-p4d-page-tables.patch
The patch titled
Subject: openrisc: add support for folded p4d page tables
has been added to the -mm tree. Its filename is
openrisc-add-support-for-folded-p4d-page-tables.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/openrisc-add-support-for-folded-p4d-page-tables.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/openrisc-add-support-for-folded-p4d-page-tables.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: openrisc: add support for folded p4d page tables
Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and remove usage of __ARCH_USE_5LEVEL_HACK.
---
arch/openrisc/include/asm/pgtable.h | 1 - arch/openrisc/mm/fault.c | 10 ++++++++-- arch/openrisc/mm/init.c | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-)
arch/openrisc/include/asm/pgtable.h renamed from arch/openrisc/include/asm/pgtable.h~openrisc-add-support-for-folded-p4d-page-tables +0 -1
@@ -21,7 +21,6 @@#ifndef __ASM_OPENRISC_PGTABLE_H#define __ASM_OPENRISC_PGTABLE_H -#define __ARCH_USE_5LEVEL_HACK#include <asm-generic/pgtable-nopmd.h> #ifndef __ASSEMBLY__
arch/openrisc/mm/fault.c renamed from arch/openrisc/mm/fault.c~openrisc-add-support-for-folded-p4d-page-tables +8 -2
@@ -295,6 +295,7 @@ vmalloc_fault:int offset =pgd_index (address);pgd_t *pgd, *pgd_k; +p4d_t *p4d, *p4d_k;pud_t *pud, *pud_k;pmd_t *pmd, *pmd_k;pte_t *pte_k;
@@ -321,8 +322,13 @@ vmalloc_fault:* it exists. */ - pud =pud_offset (pgd, address); - pud_k =pud_offset (pgd_k, address); + p4d =p4d_offset (pgd, address); + p4d_k =p4d_offset (pgd_k, address); +if (!p4d_present (*p4d_k)) + goto no_context; + + pud =pud_offset (p4d, address); + pud_k =pud_offset (p4d_k, address);if (!pud_present (*pud_k)) goto no_context;
arch/openrisc/mm/init.c renamed from arch/openrisc/mm/init.c~openrisc-add-support-for-folded-p4d-page-tables +3 -1
@@ -71,6 +71,7 @@ static void __init map_ram(void)unsigned long v, p, e;pgprot_t prot;pgd_t *pge; +p4d_t *p4e;pud_t *pue;pmd_t *pme;pte_t *pte;
@@ -90,7 +91,8 @@ static void __init map_ram(void)while (p < e) {int j; - pue =pud_offset (pge, v); + p4e =p4d_offset (pge, v); + pue =pud_offset (p4e, v); pme =pmd_offset (pue, v);if ((u32 ) pue != (u32 ) pge || (u32 ) pme != (u32 ) pge) {
_
Patches currently in -mm which might be from [email protected] are
h8300-remove-usage-of-__arch_use_5level_hack.patch arm-add-support-for-folded-p4d-page-tables.patch arm64-add-support-for-folded-p4d-page-tables.patch hexagon-remove-__arch_use_5level_hack.patch ia64-add-support-for-folded-p4d-page-tables.patch nios2-add-support-for-folded-p4d-page-tables.patch openrisc-add-support-for-folded-p4d-page-tables.patch powerpc-add-support-for-folded-p4d-page-tables.patch sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch sh-add-support-for-folded-p4d-page-tables.patch unicore32-remove-__arch_use_5level_hack.patch asm-generic-remove-pgtable-nop4d-hackh.patch mm-remove-__arch_has_5level_hack-and-include-asm-generic-5level-fixuph.patch mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ powerpc-add-support-for-folded-p4d-page-tables.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: powerpc: add support for folded p4d page tables has been added to the -mm tree. Its filename is powerpc-add-support-for-folded-p4d-page-tables.patch
The patch titled
Subject: powerpc: add support for folded p4d page tables
has been added to the -mm tree. Its filename is
powerpc-add-support-for-folded-p4d-page-tables.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/powerpc-add-support-for-folded-p4d-page-tables.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/powerpc-add-support-for-folded-p4d-page-tables.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: powerpc: add support for folded p4d page tables
Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h.
---
arch/powerpc/include/asm/book3s/32/pgtable.h | 1 arch/powerpc/include/asm/book3s/64/hash.h | 4 arch/powerpc/include/asm/book3s/64/pgalloc.h | 4 arch/powerpc/include/asm/book3s/64/pgtable.h | 60 +++++++------- arch/powerpc/include/asm/book3s/64/radix.h | 6 - arch/powerpc/include/asm/nohash/32/pgtable.h | 1 arch/powerpc/include/asm/nohash/64/pgalloc.h | 2 arch/powerpc/include/asm/nohash/64/pgtable-4k.h | 32 +++---- arch/powerpc/include/asm/nohash/64/pgtable.h | 6 - arch/powerpc/include/asm/pgtable.h | 10 +- arch/powerpc/kvm/book3s_64_mmu_radix.c | 32 ++++--- arch/powerpc/lib/code-patching.c | 7 + arch/powerpc/mm/book3s64/hash_pgtable.c | 4 arch/powerpc/mm/book3s64/radix_pgtable.c | 26 +++--- arch/powerpc/mm/book3s64/subpage_prot.c | 6 - arch/powerpc/mm/hugetlbpage.c | 28 +++--- arch/powerpc/mm/nohash/book3e_pgtable.c | 15 +-- arch/powerpc/mm/pgtable.c | 30 ++++--- arch/powerpc/mm/pgtable_64.c | 10 +- arch/powerpc/mm/ptdump/hashpagetable.c | 20 +++- arch/powerpc/mm/ptdump/ptdump.c | 14 +-- arch/powerpc/xmon/xmon.c | 18 ++-- 22 files changed, 197 insertions(+), 139 deletions(-)
arch/powerpc/include/asm/book3s/32/pgtable.h renamed from arch/powerpc/include/asm/book3s/32/pgtable.h~powerpc-add-support-for-folded-p4d-page-tables +0 -1
@@ -2,7 +2,6 @@#ifndef _ASM_POWERPC_BOOK3S_32_PGTABLE_H#define _ASM_POWERPC_BOOK3S_32_PGTABLE_H -#define __ARCH_USE_5LEVEL_HACK#include <asm-generic/pgtable-nopmd.h> #include <asm/book3s/32/hash.h>
arch/powerpc/include/asm/book3s/64/hash.h renamed from arch/powerpc/include/asm/book3s/64/hash.h~powerpc-add-support-for-folded-p4d-page-tables +2 -2
@@ -134,9 +134,9 @@ static inline int get_region_id(unsigned#define hash__pmd_bad (pmd) (pmd_val(pmd) & H_PMD_BAD_BITS)#define hash__pud_bad (pud) (pud_val(pud) & H_PUD_BAD_BITS) -static inline int hash__pgd_bad (pgd_t pgd) +static inline int hash__p4d_bad (p4d_t p4d) { -return (pgd_val (pgd) ==0 ); +return (p4d_val (p4d) ==0 ); }#ifdef CONFIG_STRICT_KERNEL_RWX extern void hash__mark_rodata_ro (void );
arch/powerpc/include/asm/book3s/64/pgalloc.h renamed from arch/powerpc/include/asm/book3s/64/pgalloc.h~powerpc-add-support-for-folded-p4d-page-tables +2 -2
@@ -85,9 +85,9 @@ static inline void pgd_free(struct mm_stkmem_cache_free (PGT_CACHE (PGD_INDEX_SIZE ), pgd); } -static inline void pgd_populate (struct mm_struct *mm,pgd_t *pgd,pud_t *pud) +static inline void p4d_populate (struct mm_struct *mm,p4d_t *pgd,pud_t *pud) { - *pgd =__pgd (__pgtable_ptr_val (pud) |PGD_VAL_BITS ); + *pgd =__p4d (__pgtable_ptr_val (pud) |PGD_VAL_BITS ); }static inline pud_t *pud_alloc_one (struct mm_struct *mm,unsigned long addr)
arch/powerpc/include/asm/book3s/64/pgtable.h renamed from arch/powerpc/include/asm/book3s/64/pgtable.h~powerpc-add-support-for-folded-p4d-page-tables +33 -27
120 lines not on this page · raw message
arch/powerpc/include/asm/book3s/64/radix.h renamed from arch/powerpc/include/asm/book3s/64/radix.h~powerpc-add-support-for-folded-p4d-page-tables +3 -3
@@ -30,7 +30,7 @@/* Don't have anything in the reserved bits and leaf bits */ #define RADIX_PMD_BAD_BITS 0x60000000000000e0UL#define RADIX_PUD_BAD_BITS 0x60000000000000e0UL -#define RADIX_PGD_BAD_BITS 0x60000000000000e0UL +#define RADIX_P4D_BAD_BITS 0x60000000000000e0UL#define RADIX_PMD_SHIFT (PAGE_SHIFT + RADIX_PTE_INDEX_SIZE)#define RADIX_PUD_SHIFT (RADIX_PMD_SHIFT + RADIX_PMD_INDEX_SIZE)
@@ -227,9 +227,9 @@ static inline int radix__pud_bad(pud_t p } -static inline int radix__pgd_bad (pgd_t pgd) +static inline int radix__p4d_bad (p4d_t p4d) { -return !!(pgd_val (pgd) &RADIX_PGD_BAD_BITS ); +return !!(p4d_val (p4d) &RADIX_P4D_BAD_BITS ); }#ifdef CONFIG_TRANSPARENT_HUGEPAGE
arch/powerpc/include/asm/nohash/32/pgtable.h renamed from arch/powerpc/include/asm/nohash/32/pgtable.h~powerpc-add-support-for-folded-p4d-page-tables +0 -1
@@ -2,7 +2,6 @@#ifndef _ASM_POWERPC_NOHASH_32_PGTABLE_H#define _ASM_POWERPC_NOHASH_32_PGTABLE_H -#define __ARCH_USE_5LEVEL_HACK#include <asm-generic/pgtable-nopmd.h> #ifndef __ASSEMBLY__
arch/powerpc/include/asm/nohash/64/pgalloc.h renamed from arch/powerpc/include/asm/nohash/64/pgalloc.h~powerpc-add-support-for-folded-p4d-page-tables +1 -1
@@ -15,7 +15,7 @@ struct vmemmap_backing { };extern struct vmemmap_backing *vmemmap_list; -#define pgd_populate (MM ,PGD ,PUD ) pgd_set(PGD, (unsigned long)PUD) +#define p4d_populate (MM ,P4D ,PUD ) p4d_set(P4D, (unsigned long)PUD)static inline pud_t *pud_alloc_one (struct mm_struct *mm,unsigned long addr) {
arch/powerpc/include/asm/nohash/64/pgtable-4k.h renamed from arch/powerpc/include/asm/nohash/64/pgtable-4k.h~powerpc-add-support-for-folded-p4d-page-tables +16 -16
@@ -2,7 +2,7 @@#ifndef _ASM_POWERPC_NOHASH_64_PGTABLE_4K_H#define _ASM_POWERPC_NOHASH_64_PGTABLE_4K_H -#include <asm-generic/5level-fixup.h> +#include <asm-generic/pgtable-nop4d.h> /* * Entries per page directory level. The PTE level must use a 64b record
@@ -45,41 +45,41 @@#define PMD_MASKED_BITS 0/* Bits to mask out from a PUD to get to the PMD page */ #define PUD_MASKED_BITS 0 -/* Bits to mask out from a PGD to get to the PUD page */ -#define PGD_MASKED_BITS 0 +/* Bits to mask out from a P4D to get to the PUD page */ +#define P4D_MASKED_BITS 0/* * 4-level page tables related bits */ -#define pgd_none (pgd) (!pgd_val(pgd)) -#define pgd_bad (pgd) (pgd_val(pgd) == 0) -#define pgd_present (pgd) (pgd_val(pgd) != 0) -#define pgd_page_vaddr (pgd) (pgd_val(pgd) & ~PGD_MASKED_BITS) +#define p4d_none (p4d) (!p4d_val(p4d)) +#define p4d_bad (p4d) (p4d_val(p4d) == 0) +#define p4d_present (p4d) (p4d_val(p4d) != 0) +#define p4d_page_vaddr (p4d) (p4d_val(p4d) & ~P4D_MASKED_BITS)#ifndef __ASSEMBLY__ -static inline void pgd_clear (pgd_t *pgdp) +static inline void p4d_clear (p4d_t *p4dp) { - *pgdp =__pgd (0 ); + *p4dp =__p4d (0 ); } -static inline pte_t pgd_pte (pgd_t pgd) +static inline pte_t p4d_pte (p4d_t p4d) { -return __pte (pgd_val (pgd)); +return __pte (p4d_val (p4d)); } -static inline pgd_t pte_pgd (pte_t pte) +static inline p4d_t pte_p4d (pte_t pte) { -return __pgd (pte_val (pte)); +return __p4d (pte_val (pte)); } -extern struct page *pgd_page (pgd_t pgd); +extern struct page *p4d_page (p4d_t p4d);#endif /* !__ASSEMBLY__ */ -#define pud_offset (pgdp, addr) \ - (((pud_t *) pgd_page_vaddr(*(pgdp))) + \ +#define pud_offset (p4dp, addr) \ + (((pud_t *) p4d_page_vaddr(*(p4dp))) + \ (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1)))#define pud_ERROR (e) \
arch/powerpc/include/asm/nohash/64/pgtable.h renamed from arch/powerpc/include/asm/nohash/64/pgtable.h~powerpc-add-support-for-folded-p4d-page-tables +3 -3
@@ -175,11 +175,11 @@ static inline pud_t pte_pud(pte_t pte)return __pud (pte_val (pte)); }#define pud_write (pud) pte_write(pud_pte(pud)) -#define pgd_write (pgd) pte_write(pgd_pte(pgd)) +#define p4d_write (pgd) pte_write(p4d_pte(p4d)) -static inline void pgd_set (pgd_t *pgdp,unsigned long val) +static inline void p4d_set (p4d_t *p4dp,unsigned long val) { - *pgdp =__pgd (val); + *p4dp =__p4d (val); }/*
arch/powerpc/include/asm/pgtable.h renamed from arch/powerpc/include/asm/pgtable.h~powerpc-add-support-for-folded-p4d-page-tables +5 -5
@@ -44,12 +44,12 @@ struct mm_struct;#ifdef CONFIG_PPC32 static inline pmd_t *pmd_ptr (struct mm_struct *mm,unsigned long va) { -return pmd_offset (pud_offset (pgd_offset (mm, va), va), va); +return pmd_offset (pud_offset (p4d_offset (pgd_offset (mm, va), va), va), va); }static inline pmd_t *pmd_ptr_k (unsigned long va) { -return pmd_offset (pud_offset (pgd_offset_k (va), va), va); +return pmd_offset (pud_offset (p4d_offset (pgd_offset_k (va), va), va), va); }static inline pte_t *virt_to_kpte (unsigned long vaddr)
@@ -158,9 +158,9 @@ static inline bool pud_is_leaf(pud_t pud }#endif -#ifndef pgd_is_leaf -#define pgd_is_leaf pgd_is_leaf -static inline bool pgd_is_leaf (pgd_t pgd) +#ifndef p4d_is_leaf +#define p4d_is_leaf p4d_is_leaf +static inline bool p4d_is_leaf (p4d_t p4d) {return false; }
arch/powerpc/kvm/book3s_64_mmu_radix.c renamed from arch/powerpc/kvm/book3s_64_mmu_radix.c~powerpc-add-support-for-folded-p4d-page-tables +19 -13
@@ -499,13 +499,14 @@ void kvmppc_free_pgtable_radix(struct kvunsigned long ig;for (ig =0 ; ig <PTRS_PER_PGD ; ++ig, ++pgd) { +p4d_t *p4d =p4d_offset (pgd,0 );pud_t *pud; -if (!pgd_present (*pgd)) +if (!p4d_present (*p4d))continue ; - pud =pud_offset (pgd,0 ); + pud =pud_offset (p4d,0 );kvmppc_unmap_free_pud (kvm, pud, lpid); -pgd_clear (pgd); +p4d_clear (p4d); } }
@@ -566,6 +567,7 @@ int kvmppc_create_pte(struct kvm *kvm, p unsigned long *rmapp, struct rmap_nested **n_rmap) { pgd_t *pgd; +p4d_t *p4d;pud_t *pud, *new_pud =NULL ;pmd_t *pmd, *new_pmd =NULL ;pte_t *ptep, *new_ptep =NULL ;
@@ -573,9 +575,11 @@ int kvmppc_create_pte(struct kvm *kvm, p/* Traverse the guest's 2nd-level tree, allocate new levels needed */ pgd = pgtable +pgd_index (gpa); + p4d =p4d_offset (pgd, gpa); + pud =NULL ; -if (pgd_present (*pgd)) - pud =pud_offset (pgd, gpa); +if (p4d_present (*p4d)) + pud =pud_offset (p4d, gpa);else new_pud =pud_alloc_one (kvm->mm, gpa);
@@ -596,13 +600,13 @@ int kvmppc_create_pte(struct kvm *kvm, p/* Now traverse again under the lock and change the tree */ ret = -ENOMEM ; -if (pgd_none (*pgd)) { +if (p4d_none (*p4d)) {if (!new_pud) goto out_unlock; -pgd_populate (kvm->mm, pgd, new_pud); +p4d_populate (kvm->mm, p4d, new_pud); new_pud =NULL ; } - pud =pud_offset (pgd, gpa); + pud =pud_offset (p4d, gpa);if (pud_is_leaf (*pud)) {unsigned long hgpa = gpa &PUD_MASK ;
@@ -1219,7 +1223,8 @@ static ssize_t debugfs_radix_read(structunsigned long gpa;pgd_t *pgt;struct kvm_nested_guest *nested; -pgd_t pgd, *pgdp; +pgd_t *pgdp; +p4d_t p4d, *p4dp;pud_t pud, *pudp;pmd_t pmd, *pmdp;pte_t *ptep;
@@ -1292,13 +1297,14 @@ static ssize_t debugfs_radix_read(struct } pgdp = pgt +pgd_index (gpa); - pgd =READ_ONCE (*pgdp); -if (!(pgd_val (pgd) & _PAGE_PRESENT)) { - gpa = (gpa &PGDIR_MASK ) +PGDIR_SIZE ; + p4dp =p4d_offset (pgdp, gpa); + p4d =READ_ONCE (*p4dp); +if (!(p4d_val (p4d) & _PAGE_PRESENT)) { + gpa = (gpa &P4D_MASK ) +P4D_SIZE ;continue ; } - pudp =pud_offset (&pgd, gpa); + pudp =pud_offset (&p4d, gpa); pud =READ_ONCE (*pudp);if (!(pud_val (pud) & _PAGE_PRESENT)) { gpa = (gpa &PUD_MASK ) +PUD_SIZE ;
arch/powerpc/lib/code-patching.c renamed from arch/powerpc/lib/code-patching.c~powerpc-add-support-for-folded-p4d-page-tables +6 -1
@@ -107,13 +107,18 @@ static inline int unmap_patch_area(unsigpte_t *ptep;pmd_t *pmdp;pud_t *pudp; +p4d_t *p4dp;pgd_t *pgdp; pgdp =pgd_offset_k (addr);if (unlikely (!pgdp))return -EINVAL ; - pudp =pud_offset (pgdp, addr); + p4dp =p4d_offset (pgdp, addr); +if (unlikely (!p4dp)) +return -EINVAL ; + + pudp =pud_offset (p4dp, addr);if (unlikely (!pudp))return -EINVAL ;
arch/powerpc/mm/book3s64/hash_pgtable.c renamed from arch/powerpc/mm/book3s64/hash_pgtable.c~powerpc-add-support-for-folded-p4d-page-tables +3 -1
@@ -148,6 +148,7 @@ void hash__vmemmap_remove_mapping(unsignint hash__map_kernel_page (unsigned long ea,unsigned long pa,pgprot_t prot) {pgd_t *pgdp; +p4d_t *p4dp;pud_t *pudp;pmd_t *pmdp;pte_t *ptep;
@@ -155,7 +156,8 @@ int hash__map_kernel_page(unsigned longBUILD_BUG_ON (TASK_SIZE_USER64 >H_PGTABLE_RANGE );if (slab_is_available ()) { pgdp =pgd_offset_k (ea); - pudp =pud_alloc (&init_mm, pgdp, ea); + p4dp =p4d_offset (pgdp, ea); + pudp =pud_alloc (&init_mm, p4dp, ea);if (!pudp)return -ENOMEM ; pmdp =pmd_alloc (&init_mm, pudp, ea);
arch/powerpc/mm/book3s64/radix_pgtable.c renamed from arch/powerpc/mm/book3s64/radix_pgtable.c~powerpc-add-support-for-folded-p4d-page-tables +17 -9
@@ -65,17 +65,19 @@ static int early_map_kernel_page(unsigne {unsigned long pfn = pa >>PAGE_SHIFT ;pgd_t *pgdp; +p4d_t *p4dp;pud_t *pudp;pmd_t *pmdp;pte_t *ptep; pgdp =pgd_offset_k (ea); -if (pgd_none (*pgdp)) { + p4dp =p4d_offset (pgdp, ea); +if (p4d_none (*p4dp)) { pudp =early_alloc_pgtable (PUD_TABLE_SIZE , nid, region_start, region_end); -pgd_populate (&init_mm, pgdp, pudp); +p4d_populate (&init_mm, p4dp, pudp); } - pudp =pud_offset (pgdp, ea); + pudp =pud_offset (p4dp, ea);if (map_page_size ==PUD_SIZE ) { ptep = (pte_t *)pudp; goto set_the_pte;
@@ -115,6 +117,7 @@ static int __map_kernel_page(unsigned lo {unsigned long pfn = pa >>PAGE_SHIFT ;pgd_t *pgdp; +p4d_t *p4dp;pud_t *pudp;pmd_t *pmdp;pte_t *ptep;
@@ -137,7 +140,8 @@ static int __map_kernel_page(unsigned lo* boot. */ pgdp =pgd_offset_k (ea); - pudp =pud_alloc (&init_mm, pgdp, ea); + p4dp =p4d_offset (pgdp, ea); + pudp =pud_alloc (&init_mm, p4dp, ea);if (!pudp)return -ENOMEM ;if (map_page_size ==PUD_SIZE ) {
@@ -174,6 +178,7 @@ void radix__change_memory_range(unsigned {unsigned long idx;pgd_t *pgdp; +p4d_t *p4dp;pud_t *pudp;pmd_t *pmdp;pte_t *ptep;
@@ -186,7 +191,8 @@ void radix__change_memory_range(unsignedfor (idx = start; idx < end; idx +=PAGE_SIZE ) { pgdp =pgd_offset_k (idx); - pudp =pud_alloc (&init_mm, pgdp, idx); + p4dp =p4d_offset (pgdp, idx); + pudp =pud_alloc (&init_mm, p4dp, idx);if (!pudp)continue ;if (pud_is_leaf (*pudp)) {
@@ -850,6 +856,7 @@ static void __meminit remove_pagetable(uunsigned long addr, next;pud_t *pud_base;pgd_t *pgd; +p4d_t *p4d;spin_lock (&init_mm.page_table_lock);
@@ -857,15 +864,16 @@ static void __meminit remove_pagetable(u next =pgd_addr_end (addr, end); pgd =pgd_offset_k (addr); -if (!pgd_present (*pgd)) + p4d =p4d_offset (pgd, addr); +if (!p4d_present (*p4d))continue ; -if (pgd_is_leaf (*pgd)) { -split_kernel_mapping (addr, end,PGDIR_SIZE , (pte_t *)pgd); +if (p4d_is_leaf (*p4d)) { +split_kernel_mapping (addr, end,P4D_SIZE , (pte_t *)p4d);continue ; } - pud_base = (pud_t *)pgd_page_vaddr (*pgd); + pud_base = (pud_t *)p4d_page_vaddr (*p4d);remove_pud_table (pud_base, addr, next); }
arch/powerpc/mm/book3s64/subpage_prot.c renamed from arch/powerpc/mm/book3s64/subpage_prot.c~powerpc-add-support-for-folded-p4d-page-tables +4 -2
@@ -54,15 +54,17 @@ static void hpte_flush_range(struct mm_s int npages) {pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;pte_t *pte;spinlock_t *ptl; pgd =pgd_offset (mm, addr); -if (pgd_none (*pgd)) + p4d =p4d_offset (pgd, addr); +if (p4d_none (*p4d))return ; - pud =pud_offset (pgd, addr); + pud =pud_offset (p4d, addr);if (pud_none (*pud))return ; pmd =pmd_offset (pud, addr);
arch/powerpc/mm/hugetlbpage.c renamed from arch/powerpc/mm/hugetlbpage.c~powerpc-add-support-for-folded-p4d-page-tables +16 -12
@@ -119,6 +119,7 @@ static int __hugepte_alloc(struct mm_strpte_t *huge_pte_alloc (struct mm_struct *mm,unsigned long addr,unsigned long sz) {pgd_t *pg; +p4d_t *p4;pud_t *pu;pmd_t *pm;hugepd_t *hpdp =NULL ;
@@ -128,20 +129,21 @@ pte_t *huge_pte_alloc(struct mm_struct * addr &= ~(sz-1 ); pg =pgd_offset (mm, addr); + p4 =p4d_offset (pg, addr);#ifdef CONFIG_PPC_BOOK3S_64 if (pshift ==PGDIR_SHIFT )/* 16GB huge page */ -return (pte_t *) pg; +return (pte_t *) p4;else if (pshift >PUD_SHIFT ) {/* * We need to use hugepd table */ ptl = &mm->page_table_lock; - hpdp = (hugepd_t *)pg; + hpdp = (hugepd_t *)p4; }else { pdshift =PUD_SHIFT ; - pu =pud_alloc (mm, pg, addr); + pu =pud_alloc (mm, p4, addr);if (!pu)return NULL ;if (pshift ==PUD_SHIFT )
@@ -166,10 +168,10 @@ pte_t *huge_pte_alloc(struct mm_struct *#else if (pshift >=PGDIR_SHIFT ) { ptl = &mm->page_table_lock; - hpdp = (hugepd_t *)pg; + hpdp = (hugepd_t *)p4; }else { pdshift =PUD_SHIFT ; - pu =pud_alloc (mm, pg, addr); + pu =pud_alloc (mm, p4, addr);if (!pu)return NULL ;if (pshift >=PUD_SHIFT ) {
@@ -390,7 +392,7 @@ static void hugetlb_free_pmd_range(strucmm_dec_nr_pmds (tlb->mm); } -static void hugetlb_free_pud_range (struct mmu_gather *tlb,pgd_t *pgd, +static void hugetlb_free_pud_range (struct mmu_gather *tlb,p4d_t *p4d,unsigned long addr,unsigned long end,unsigned long floor,unsigned long ceiling) {
@@ -400,7 +402,7 @@ static void hugetlb_free_pud_range(struc start = addr; do { - pud = pud_offset(pgd, addr); + pud = pud_offset(p4d, addr); next = pud_addr_end(addr, end); if (!is_hugepd(__hugepd(pud_val(*pud)))) { if (pud_none_or_clear_bad(pud))
@@ -435,8 +437,8 @@ static void hugetlb_free_pud_range(strucif (end -1 > ceiling -1 )return ; - pud =pud_offset (pgd, start); -pgd_clear (pgd); + pud =pud_offset (p4d, start); +p4d_clear (p4d);pud_free_tlb (tlb, pud, start);mm_dec_nr_puds (tlb->mm); }
@@ -449,6 +451,7 @@ void hugetlb_free_pgd_range(struct mmu_g unsigned long floor, unsigned long ceiling) {pgd_t *pgd; +p4d_t *p4d;unsigned long next;/*
@@ -471,10 +474,11 @@ void hugetlb_free_pgd_range(struct mmu_g do { next = pgd_addr_end(addr, end); pgd = pgd_offset(tlb->mm, addr); + p4d = p4d_offset(pgd, addr); if (!is_hugepd(__hugepd(pgd_val(*pgd)))) { - if (pgd_none_or_clear_bad(pgd)) + if (p4d_none_or_clear_bad(p4d)) continue; - hugetlb_free_pud_range(tlb, pgd, addr, next, floor, ceiling); + hugetlb_free_pud_range(tlb, p4d, addr, next, floor, ceiling); } else { unsigned long more; /*
@@ -487,7 +491,7 @@ void hugetlb_free_pgd_range(struct mmu_gif (more > next) next = more; -free_hugepd_range (tlb, (hugepd_t *)pgd,PGDIR_SHIFT , +free_hugepd_range (tlb, (hugepd_t *)p4d,PGDIR_SHIFT , addr, next, floor, ceiling); } }while (addr = next, addr != end);
arch/powerpc/mm/nohash/book3e_pgtable.c renamed from arch/powerpc/mm/nohash/book3e_pgtable.c~powerpc-add-support-for-folded-p4d-page-tables +8 -7
@@ -73,6 +73,7 @@ static void __init *early_alloc_pgtable(int __ref map_kernel_page (unsigned long ea,unsigned long pa,pgprot_t prot) {pgd_t *pgdp; +p4d_t *p4dp;pud_t *pudp;pmd_t *pmdp;pte_t *ptep;
@@ -80,7 +81,8 @@ int __ref map_kernel_page(unsigned longBUILD_BUG_ON (TASK_SIZE_USER64 >PGTABLE_RANGE );if (slab_is_available ()) { pgdp =pgd_offset_k (ea); - pudp =pud_alloc (&init_mm, pgdp, ea); + p4dp =p4d_offset (pgdp, ea); + pudp =pud_alloc (&init_mm, p4dp, ea);if (!pudp)return -ENOMEM ; pmdp =pmd_alloc (&init_mm, pudp, ea);
@@ -91,13 +93,12 @@ int __ref map_kernel_page(unsigned longreturn -ENOMEM ; }else { pgdp =pgd_offset_k (ea); -#ifndef __PAGETABLE_PUD_FOLDED -if (pgd_none (*pgdp)) { - pudp =early_alloc_pgtable (PUD_TABLE_SIZE ); -pgd_populate (&init_mm, pgdp, pudp); + p4dp =p4d_offset (pgdp, ea); +if (p4d_none (*p4dp)) { + pmdp =early_alloc_pgtable (PMD_TABLE_SIZE ); +p4d_populate (&init_mm, p4dp, pmdp); } -#endif /* !__PAGETABLE_PUD_FOLDED */ - pudp =pud_offset (pgdp, ea); + pudp =pud_offset (p4dp, ea);if (pud_none (*pudp)) { pmdp =early_alloc_pgtable (PMD_TABLE_SIZE );pud_populate (&init_mm, pudp, pmdp);
arch/powerpc/mm/pgtable_64.c renamed from arch/powerpc/mm/pgtable_64.c~powerpc-add-support-for-folded-p4d-page-tables +5 -5
@@ -101,13 +101,13 @@ EXPORT_SYMBOL(__pte_frag_size_shift);#ifndef __PAGETABLE_PUD_FOLDED/* 4 level page table */ -struct page *pgd_page (pgd_t pgd) +struct page *p4d_page (p4d_t p4d) { -if (pgd_is_leaf (pgd)) { -VM_WARN_ON (!pgd_huge (pgd)); -return pte_page (pgd_pte (pgd)); +if (p4d_is_leaf (p4d)) { +VM_WARN_ON (!p4d_huge (p4d)); +return pte_page (p4d_pte (p4d)); } -return virt_to_page (pgd_page_vaddr (pgd)); +return virt_to_page (p4d_page_vaddr (p4d)); }#endif
arch/powerpc/mm/pgtable.c renamed from arch/powerpc/mm/pgtable.c~powerpc-add-support-for-folded-p4d-page-tables +19 -11
@@ -265,6 +265,7 @@ int huge_ptep_set_access_flags(struct vmvoid assert_pte_locked (struct mm_struct *mm,unsigned long addr) {pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;
@@ -272,7 +273,9 @@ void assert_pte_locked(struct mm_structreturn ; pgd = mm->pgd +pgd_index (addr);BUG_ON (pgd_none (*pgd)); - pud =pud_offset (pgd, addr); + p4d =p4d_offset (pgd, addr); +BUG_ON (p4d_none (*p4d)); + pud =pud_offset (p4d, addr);BUG_ON (pud_none (*pud)); pmd =pmd_offset (pud, addr);/*
@@ -312,12 +315,13 @@ EXPORT_SYMBOL_GPL(vmalloc_to_phys);pte_t *__find_linux_pte (pgd_t *pgdir,unsigned long ea,bool *is_thp,unsigned *hpage_shift) { -pgd_t pgd, *pgdp; +pgd_t *pgdp; +p4d_t p4d, *p4dp;pud_t pud, *pudp;pmd_t pmd, *pmdp;pte_t *ret_pte;hugepd_t *hpdp =NULL ; -unsigned pdshift =PGDIR_SHIFT ; +unsigned pdshift;if (hpage_shift) *hpage_shift =0 ;
@@ -325,24 +329,28 @@ pte_t *__find_linux_pte(pgd_t *pgdir, unif (is_thp) *is_thp = false; - pgdp = pgdir +pgd_index (ea); - pgd =READ_ONCE (*pgdp);/* * Always operate on the local stack value. This make sure the * value don't get updated by a parallel THP split/collapse, * page fault or a page unmap. The return pte_t * is still not * stable. So should be checked there for above conditions. +* Top level is an exception because it is folded into p4d. */ -if (pgd_none (pgd)) + pgdp = pgdir +pgd_index (ea); + p4dp =p4d_offset (pgdp, ea); + p4d =READ_ONCE (*p4dp); + pdshift =P4D_SHIFT ; + +if (p4d_none (p4d))return NULL ; -if (pgd_is_leaf (pgd)) { - ret_pte = (pte_t *)pgdp; +if (p4d_is_leaf (p4d)) { + ret_pte = (pte_t *)p4dp; goto out; } -if (is_hugepd (__hugepd (pgd_val (pgd)))) { - hpdp = (hugepd_t *)&pgd; +if (is_hugepd (__hugepd (p4d_val (p4d)))) { + hpdp = (hugepd_t *)&p4d; goto out_huge; }
@@ -352,7 +360,7 @@ pte_t *__find_linux_pte(pgd_t *pgdir, un* irq disabled */ pdshift =PUD_SHIFT ; - pudp =pud_offset (&pgd, ea); + pudp =pud_offset (&p4d, ea); pud =READ_ONCE (*pudp);if (pud_none (pud))
arch/powerpc/mm/ptdump/hashpagetable.c renamed from arch/powerpc/mm/ptdump/hashpagetable.c~powerpc-add-support-for-folded-p4d-page-tables +17 -3
@@ -417,9 +417,9 @@ static void walk_pmd(struct pg_state *st } } -static void walk_pud (struct pg_state *st,pgd_t *pgd,unsigned long start) +static void walk_pud (struct pg_state *st,p4d_t *p4d,unsigned long start) { -pud_t *pud =pud_offset (pgd,0 ); +pud_t *pud =pud_offset (p4d,0 );unsigned long addr;unsigned int i;
@@ -431,6 +431,20 @@ static void walk_pud(struct pg_state *st } } +static void walk_p4d (struct pg_state *st,pgd_t *pgd,unsigned long start) +{ +p4d_t *p4d =p4d_offset (pgd,0 ); +unsigned long addr; +unsigned int i; + +for (i =0 ; i <PTRS_PER_P4D ; i++, p4d++) { + addr = start + i *P4D_SIZE ; +if (!p4d_none (*p4d)) +/* p4d exists */ +walk_pud (st, p4d, addr); + } +} +static void walk_pagetables (struct pg_state *st) {pgd_t *pgd =pgd_offset_k (0UL );
@@ -445,7 +459,7 @@ static void walk_pagetables(struct pg_st addr =KERN_VIRT_START + i *PGDIR_SIZE ;if (!pgd_none (*pgd))/* pgd exists */ -walk_pud (st, pgd, addr); +walk_p4d (st, pgd, addr); } }
arch/powerpc/mm/ptdump/ptdump.c renamed from arch/powerpc/mm/ptdump/ptdump.c~powerpc-add-support-for-folded-p4d-page-tables +8 -6
@@ -277,9 +277,9 @@ static void walk_pmd(struct pg_state *st } } -static void walk_pud (struct pg_state *st,pgd_t *pgd,unsigned long start) +static void walk_pud (struct pg_state *st,p4d_t *p4d,unsigned long start) { -pud_t *pud =pud_offset (pgd,0 ); +pud_t *pud =pud_offset (p4d,0 );unsigned long addr;unsigned int i;
@@ -304,11 +304,13 @@ static void walk_pagetables(struct pg_st* the hash pagetable. */ for (i =pgd_index (addr); i <PTRS_PER_PGD ; i++, pgd++, addr +=PGDIR_SIZE ) { -if (!pgd_none (*pgd) && !pgd_is_leaf (*pgd)) -/* pgd exists */ -walk_pud (st, pgd, addr); +p4d_t *p4d =p4d_offset (pgd,0 ); + +if (!p4d_none (*p4d) && !p4d_is_leaf (*p4d)) +/* p4d exists */ +walk_pud (st, p4d, addr);else -note_page (st, addr,1 ,pgd_val (*pgd)); +note_page (st, addr,1 ,p4d_val (*p4d)); } }
arch/powerpc/xmon/xmon.c renamed from arch/powerpc/xmon/xmon.c~powerpc-add-support-for-folded-p4d-page-tables +10 -8
@@ -3136,6 +3136,7 @@ static void show_pte(unsigned long addr)struct task_struct *tsk =NULL ;struct mm_struct *mm;pgd_t *pgdp, *pgdir; +p4d_t *p4dp;pud_t *pudp;pmd_t *pmdp;pte_t *ptep;
@@ -3167,20 +3168,21 @@ static void show_pte(unsigned long addr) pgdir =pgd_offset (mm,0 ); } -if (pgd_none (*pgdp)) { -printf ("no linux page table for address\n" ); + p4dp =p4d_offset (pgdp, addr); + +if (p4d_none (*p4dp)) { +printf ("No valid P4D\n" );return ; } -printf ("pgd @ 0x%px\n" , pgdir); - -if (pgd_is_leaf (*pgdp)) { -format_pte (pgdp,pgd_val (*pgdp)); +if (p4d_is_leaf (*p4dp)) { +format_pte (p4dp,p4d_val (*p4dp));return ; } -printf ("pgdp @ 0x%px = 0x%016lx\n" , pgdp,pgd_val (*pgdp)); - pudp =pud_offset (pgdp, addr); +printf ("p4dp @ 0x%px = 0x%016lx\n" , p4dp,p4d_val (*p4dp)); + + pudp =pud_offset (p4dp, addr);if (pud_none (*pudp)) {printf ("No valid PUD\n" );
_
Patches currently in -mm which might be from [email protected] are
h8300-remove-usage-of-__arch_use_5level_hack.patch arm-add-support-for-folded-p4d-page-tables.patch arm64-add-support-for-folded-p4d-page-tables.patch hexagon-remove-__arch_use_5level_hack.patch ia64-add-support-for-folded-p4d-page-tables.patch nios2-add-support-for-folded-p4d-page-tables.patch openrisc-add-support-for-folded-p4d-page-tables.patch powerpc-add-support-for-folded-p4d-page-tables.patch sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch sh-add-support-for-folded-p4d-page-tables.patch unicore32-remove-__arch_use_5level_hack.patch asm-generic-remove-pgtable-nop4d-hackh.patch mm-remove-__arch_has_5level_hack-and-include-asm-generic-5level-fixuph.patch mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ sh-fault-modernize-printing-of-kernel-messages.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: sh: fault: Modernize printing of kernel messages has been added to the -mm tree. Its filename is sh-fault-modernize-printing-of-kernel-messages.patch
The patch titled
Subject: sh: fault: Modernize printing of kernel messages
has been added to the -mm tree. Its filename is
sh-fault-modernize-printing-of-kernel-messages.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/sh-fault-modernize-printing-of-kernel-messages.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/sh-fault-modernize-printing-of-kernel-messages.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Geert Uytterhoeven <[email protected]>
Subject: sh: fault: Modernize printing of kernel messages
- Convert from printk() to pr_*(),
- Add missing continuations,
- Use "%llx" to format u64,
- Join multiple prints in show_fault_oops() into a single print.
---
arch/sh/mm/fault.c | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-)
arch/sh/mm/fault.c renamed from arch/sh/mm/fault.c~sh-fault-modernize-printing-of-kernel-messages +13 -18
@@ -47,10 +47,10 @@ static void show_pte(struct mm_struct *m pgd = swapper_pg_dir; } -printk (KERN_ALERT "pgd = %p\n" , pgd); +pr_alert ("pgd = %p\n" , pgd); pgd +=pgd_index (addr); -printk (KERN_ALERT "[%08lx] *pgd=%0*Lx" , addr, - (u32)(sizeof (*pgd) *2 ), (u64 )pgd_val (*pgd)); +pr_alert ("[%08lx] *pgd=%0*llx" , addr, (u32)(sizeof (*pgd) *2 ), + (u64 )pgd_val (*pgd)); do { pud_t *pud;
@@ -61,33 +61,33 @@ static void show_pte(struct mm_struct *mbreak ;if (pgd_bad (*pgd)) { -printk ("(bad)" ); +pr_cont ("(bad)" );break ; } pud =pud_offset (pgd, addr);if (PTRS_PER_PUD !=1 ) -printk (", *pud=%0*Lx" , (u32)(sizeof (*pud) *2 ), - (u64 )pud_val (*pud)); +pr_cont (", *pud=%0*llx" , (u32)(sizeof (*pud) *2 ), + (u64 )pud_val (*pud));if (pud_none (*pud))break ;if (pud_bad (*pud)) { -printk ("(bad)" ); +pr_cont ("(bad)" );break ; } pmd =pmd_offset (pud, addr);if (PTRS_PER_PMD !=1 ) -printk (", *pmd=%0*Lx" , (u32)(sizeof (*pmd) *2 ), - (u64 )pmd_val (*pmd)); +pr_cont (", *pmd=%0*llx" , (u32)(sizeof (*pmd) *2 ), + (u64 )pmd_val (*pmd));if (pmd_none (*pmd))break ;if (pmd_bad (*pmd)) { -printk ("(bad)" ); +pr_cont ("(bad)" );break ; }
@@ -96,11 +96,11 @@ static void show_pte(struct mm_struct *mbreak ; pte =pte_offset_kernel (pmd, addr); -printk (", *pte=%0*Lx" , (u32)(sizeof (*pte) *2 ), - (u64 )pte_val (*pte)); +pr_cont (", *pte=%0*llx" , (u32)(sizeof (*pte) *2 ), + (u64 )pte_val (*pte)); }while (0 ); -printk ("\n" ); +pr_cont ("\n" ); }static inline pmd_t *vmalloc_sync_one (pgd_t *pgd,unsigned long address)
@@ -188,14 +188,11 @@ show_fault_oops(struct pt_regs *regs, unif (!oops_may_print ())return ; -printk (KERN_ALERT "BUG: unable to handle kernel " ); -if (address <PAGE_SIZE ) -printk (KERN_CONT "NULL pointer dereference" ); -else -printk (KERN_CONT "paging request" );
+ sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: sh: drop __pXd_offset() macros that duplicate pXd_index() ones has been added to the -mm tree. Its filename is sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch
The patch titled
Subject: sh: drop __pXd_offset() macros that duplicate pXd_index() ones
has been added to the -mm tree. Its filename is
sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: sh: drop __pXd_offset() macros that duplicate pXd_index() ones
The __pXd_offset() macros are identical to the pXd_index() macros and there is no point to keep both of them. All architectures define and use pXd_index() so let's keep only those to make mips consistent with the rest of the kernel.
---
arch/sh/include/asm/pgtable_32.h | 5 ++--- arch/sh/include/asm/pgtable_64.h | 5 ++--- arch/sh/mm/init.c | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-)
arch/sh/include/asm/pgtable_32.h renamed from arch/sh/include/asm/pgtable_32.h~sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones +2 -3
@@ -407,13 +407,12 @@ static inline pte_t pte_modify(pte_t pte/* to find an entry in a page-table-directory. */ #define pgd_index (address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))#define pgd_offset (mm, address) ((mm)->pgd + pgd_index(address)) -#define __pgd_offset (address) pgd_index(address)/* to find an entry in a kernel page-table-directory */ #define pgd_offset_k (address) pgd_offset(&init_mm, address) -#define __pud_offset (address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) -#define __pmd_offset (address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) +#define pud_index (address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) +#define pmd_index (address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))/* Find an entry in the third-level page table.. */ #define pte_index (address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
arch/sh/include/asm/pgtable_64.h renamed from arch/sh/include/asm/pgtable_64.h~sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones +2 -3
@@ -46,14 +46,13 @@ static __inline__ void set_pte(pte_t *pt/* To find an entry in a generic PGD. */ #define pgd_index (address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) -#define __pgd_offset (address) pgd_index(address)#define pgd_offset (mm, address) ((mm)->pgd+pgd_index(address))/* To find an entry in a kernel PGD. */ #define pgd_offset_k (address) pgd_offset(&init_mm, address) -#define __pud_offset (address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) -#define __pmd_offset (address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) +#define pud_index (address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) +/* #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) */ /* * PMD level access routines. Same notes as above.
arch/sh/mm/init.c renamed from arch/sh/mm/init.c~sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones +3 -3
@@ -172,9 +172,9 @@ void __init page_table_range_init(unsignunsigned long vaddr; vaddr = start; - i =__pgd_offset (vaddr); - j =__pud_offset (vaddr); - k =__pmd_offset (vaddr); + i =pgd_index (vaddr); + j =pud_index (vaddr); + k =pmd_index (vaddr); pgd = pgd_base + i;for ( ; (i <PTRS_PER_PGD ) && (vaddr != end); pgd++, i++) {
_
Patches currently in -mm which might be from [email protected] are
h8300-remove-usage-of-__arch_use_5level_hack.patch arm-add-support-for-folded-p4d-page-tables.patch arm64-add-support-for-folded-p4d-page-tables.patch hexagon-remove-__arch_use_5level_hack.patch ia64-add-support-for-folded-p4d-page-tables.patch nios2-add-support-for-folded-p4d-page-tables.patch openrisc-add-support-for-folded-p4d-page-tables.patch powerpc-add-support-for-folded-p4d-page-tables.patch sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch sh-add-support-for-folded-p4d-page-tables.patch unicore32-remove-__arch_use_5level_hack.patch asm-generic-remove-pgtable-nop4d-hackh.patch mm-remove-__arch_has_5level_hack-and-include-asm-generic-5level-fixuph.patch mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ sh-add-support-for-folded-p4d-page-tables.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: sh: add support for folded p4d page tables has been added to the -mm tree. Its filename is sh-add-support-for-folded-p4d-page-tables.patch
The patch titled
Subject: sh: add support for folded p4d page tables
has been added to the -mm tree. Its filename is
sh-add-support-for-folded-p4d-page-tables.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/sh-add-support-for-folded-p4d-page-tables.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/sh-add-support-for-folded-p4d-page-tables.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: sh: add support for folded p4d page tables
Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and remove usage of __ARCH_USE_5LEVEL_HACK.
---
arch/sh/include/asm/pgtable-2level.h | 1 arch/sh/include/asm/pgtable-3level.h | 1 arch/sh/kernel/io_trapped.c | 7 +++++- arch/sh/mm/cache-sh4.c | 4 ++- arch/sh/mm/cache-sh5.c | 7 +++++- arch/sh/mm/fault.c | 26 ++++++++++++++++++++--- arch/sh/mm/hugetlbpage.c | 28 ++++++++++++++++--------- arch/sh/mm/init.c | 9 +++++++- arch/sh/mm/kmap.c | 2 - arch/sh/mm/tlbex_32.c | 6 ++++- arch/sh/mm/tlbex_64.c | 7 +++++- 11 files changed, 76 insertions(+), 22 deletions(-)
arch/sh/include/asm/pgtable-2level.h renamed from arch/sh/include/asm/pgtable-2level.h~sh-add-support-for-folded-p4d-page-tables +0 -1
@@ -2,7 +2,6 @@#ifndef __ASM_SH_PGTABLE_2LEVEL_H#define __ASM_SH_PGTABLE_2LEVEL_H -#define __ARCH_USE_5LEVEL_HACK#include <asm-generic/pgtable-nopmd.h> /*
arch/sh/include/asm/pgtable-3level.h renamed from arch/sh/include/asm/pgtable-3level.h~sh-add-support-for-folded-p4d-page-tables +0 -1
@@ -2,7 +2,6 @@#ifndef __ASM_SH_PGTABLE_3LEVEL_H#define __ASM_SH_PGTABLE_3LEVEL_H -#define __ARCH_USE_5LEVEL_HACK#include <asm-generic/pgtable-nopud.h> /*
arch/sh/kernel/io_trapped.c renamed from arch/sh/kernel/io_trapped.c~sh-add-support-for-folded-p4d-page-tables +6 -1
@@ -136,6 +136,7 @@ EXPORT_SYMBOL_GPL(match_trapped_io_handlstatic struct trapped_io *lookup_tiop (unsigned long address) {pgd_t *pgd_k; +p4d_t *p4d_k;pud_t *pud_k;pmd_t *pmd_k;pte_t *pte_k;
@@ -145,7 +146,11 @@ static struct trapped_io *lookup_tiop(unif (!pgd_present (*pgd_k))return NULL ; - pud_k =pud_offset (pgd_k, address); + p4d_k =p4d_offset (pgd_k, address); +if (!p4d_present (*p4d_k)) +return NULL ; + + pud_k =pud_offset (p4d_k, address);if (!pud_present (*pud_k))return NULL ;
arch/sh/mm/cache-sh4.c renamed from arch/sh/mm/cache-sh4.c~sh-add-support-for-folded-p4d-page-tables +3 -1
@@ -209,6 +209,7 @@ static void sh4_flush_cache_page(void *aunsigned long address, pfn, phys;int map_coherent =0 ;pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;pte_t *pte;
@@ -224,7 +225,8 @@ static void sh4_flush_cache_page(void *areturn ; pgd =pgd_offset (vma->vm_mm, address); - pud =pud_offset (pgd, address); + p4d =p4d_offset (pgd, address); + pud =pud_offset (p4d, address); pmd =pmd_offset (pud, address); pte =pte_offset_kernel (pmd, address);
arch/sh/mm/cache-sh5.c renamed from arch/sh/mm/cache-sh5.c~sh-add-support-for-folded-p4d-page-tables +6 -1
@@ -383,6 +383,7 @@ static void sh64_dcache_purge_user_pages unsigned long addr, unsigned long end) {pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;pte_t *pte;
@@ -397,7 +398,11 @@ static void sh64_dcache_purge_user_pagesif (pgd_bad (*pgd))return ; - pud =pud_offset (pgd, addr); + p4d =p4d_offset (pgd, addr); +if (p4d_none (*p4d) ||p4d_bad (*p4d)) +return ; + + pud =pud_offset (p4d, addr);if (pud_none (*pud) ||pud_bad (*pud))return ;
arch/sh/mm/fault.c renamed from arch/sh/mm/fault.c~sh-add-support-for-folded-p4d-page-tables +23 -3
@@ -53,6 +53,7 @@ static void show_pte(struct mm_struct *m (u64)pgd_val(*pgd)); do { + p4d_t *p4d; pud_t *pud; pmd_t *pmd; pte_t *pte;
@@ -65,7 +66,20 @@ static void show_pte(struct mm_struct *mbreak ; } - pud =pud_offset (pgd, addr); + p4d =p4d_offset (pgd, addr); +if (PTRS_PER_P4D !=1 ) +pr_cont (", *p4d=%0*Lx" , (u32)(sizeof (*p4d) *2 ), + (u64 )p4d_val (*p4d)); + +if (p4d_none (*p4d)) +break ; + +if (p4d_bad (*p4d)) { +pr_cont ("(bad)" ); +break ; + } + + pud =pud_offset (p4d, addr);if (PTRS_PER_PUD !=1 )pr_cont (", *pud=%0*llx" , (u32)(sizeof (*pud) *2 ), (u64 )pud_val (*pud));
@@ -107,6 +121,7 @@ static inline pmd_t *vmalloc_sync_one(pg {unsigned index =pgd_index (address);pgd_t *pgd_k; +p4d_t *p4d, *p4d_k;pud_t *pud, *pud_k;pmd_t *pmd, *pmd_k;
@@ -116,8 +131,13 @@ static inline pmd_t *vmalloc_sync_one(pgif (!pgd_present (*pgd_k))return NULL ; - pud =pud_offset (pgd, address); - pud_k =pud_offset (pgd_k, address); + p4d =p4d_offset (pgd, address); + p4d_k =p4d_offset (pgd_k, address); +if (!p4d_present (*p4d_k)) +return NULL ; + + pud =pud_offset (p4d, address); + pud_k =pud_offset (p4d_k, address);if (!pud_present (*pud_k))return NULL ;
arch/sh/mm/hugetlbpage.c renamed from arch/sh/mm/hugetlbpage.c~sh-add-support-for-folded-p4d-page-tables +18 -10
@@ -26,17 +26,21 @@ pte_t *huge_pte_alloc(struct mm_struct * unsigned long addr, unsigned long sz) {pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;pte_t *pte =NULL ; pgd =pgd_offset (mm, addr);if (pgd) { - pud =pud_alloc (mm, pgd, addr); -if (pud) { - pmd =pmd_alloc (mm, pud, addr); -if (pmd) - pte =pte_alloc_map (mm, pmd, addr); + p4d =p4d_alloc (mm, pgd, addr); +if (p4d) { + pud =pud_alloc (mm, p4d, addr); +if (pud) { + pmd =pmd_alloc (mm, pud, addr); +if (pmd) + pte =pte_alloc_map (mm, pmd, addr); + } } }
@@ -47,17 +51,21 @@ pte_t *huge_pte_offset(struct mm_struct unsigned long addr, unsigned long sz) {pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;pte_t *pte =NULL ; pgd =pgd_offset (mm, addr);if (pgd) { - pud =pud_offset (pgd, addr); -if (pud) { - pmd =pmd_offset (pud, addr); -if (pmd) - pte =pte_offset_map (pmd, addr); + p4d =p4d_offset (pgd, addr); +if (p4d) { + pud =pud_offset (p4d, addr); +if (pud) { + pmd =pmd_offset (pud, addr); +if (pmd) + pte =pte_offset_map (pmd, addr); + } } }
arch/sh/mm/init.c renamed from arch/sh/mm/init.c~sh-add-support-for-folded-p4d-page-tables +8 -1
@@ -45,6 +45,7 @@ void __init __weak plat_mem_setup(void)static pte_t *__get_pte_phys (unsigned long addr) {pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;
@@ -54,7 +55,13 @@ static pte_t *__get_pte_phys(unsigned loreturn NULL ; } - pud =pud_alloc (NULL , pgd, addr); + p4d =p4d_alloc (NULL , pgd, addr); +if (unlikely (!p4d)) { +p4d_ERROR (*p4d); +return NULL ; + } + + pud =pud_alloc (NULL , p4d, addr);if (unlikely (!pud)) {pud_ERROR (*pud);return NULL ;
arch/sh/mm/kmap.c renamed from arch/sh/mm/kmap.c~sh-add-support-for-folded-p4d-page-tables +1 -1
@@ -15,7 +15,7 @@#include <asm/cacheflush.h> #define kmap_get_fixmap_pte (vaddr) \ - pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), (vaddr)) + pte_offset_kernel(pmd_offset(pud_offset(p4d_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), (vaddr)), vaddr)static pte_t *kmap_coherent_pte;
arch/sh/mm/tlbex_32.c renamed from arch/sh/mm/tlbex_32.c~sh-add-support-for-folded-p4d-page-tables +5 -1
@@ -23,6 +23,7 @@ handle_tlbmiss(struct pt_regs *regs, uns unsigned long address) {pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;pte_t *pte;
@@ -42,7 +43,10 @@ handle_tlbmiss(struct pt_regs *regs, uns pgd =pgd_offset (current->mm, address); } - pud =pud_offset (pgd, address); + p4d =p4d_offset (pgd, address); +if (p4d_none_or_clear_bad (p4d)) +return 1 ; + pud =pud_offset (p4d, address);if (pud_none_or_clear_bad (pud))return 1 ; pmd =pmd_offset (pud, address);
arch/sh/mm/tlbex_64.c renamed from arch/sh/mm/tlbex_64.c~sh-add-support-for-folded-p4d-page-tables +6 -1
@@ -44,6 +44,7 @@ static int handle_tlbmiss(unsigned long unsigned long address) {pgd_t *pgd; +p4d_t *p4d;pud_t *pud;pmd_t *pmd;pte_t *pte;
@@ -58,7 +59,11 @@ static int handle_tlbmiss(unsigned long pgd =pgd_offset (current->mm, address); } - pud =pud_offset (pgd, address); + p4d =p4d_offset (pgd, address); +if (p4d_none (*p4d) || !p4d_present (*p4d)) +return 1 ; + + pud =pud_offset (p4d, address);if (pud_none (*pud) || !pud_present (*pud))return 1 ;
_
Patches currently in -mm which might be from [email protected] are
h8300-remove-usage-of-__arch_use_5level_hack.patch arm-add-support-for-folded-p4d-page-tables.patch arm64-add-support-for-folded-p4d-page-tables.patch hexagon-remove-__arch_use_5level_hack.patch ia64-add-support-for-folded-p4d-page-tables.patch nios2-add-support-for-folded-p4d-page-tables.patch openrisc-add-support-for-folded-p4d-page-tables.patch powerpc-add-support-for-folded-p4d-page-tables.patch sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch sh-add-support-for-folded-p4d-page-tables.patch unicore32-remove-__arch_use_5level_hack.patch asm-generic-remove-pgtable-nop4d-hackh.patch mm-remove-__arch_has_5level_hack-and-include-asm-generic-5level-fixuph.patch mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ unicore32-remove-__arch_use_5level_hack.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: unicore32: remove __ARCH_USE_5LEVEL_HACK has been added to the -mm tree. Its filename is unicore32-remove-__arch_use_5level_hack.patch
The patch titled
Subject: unicore32: remove __ARCH_USE_5LEVEL_HACK
has been added to the -mm tree. Its filename is
unicore32-remove-__arch_use_5level_hack.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/unicore32-remove-__arch_use_5level_hack.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/unicore32-remove-__arch_use_5level_hack.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: unicore32: remove __ARCH_USE_5LEVEL_HACK
The unicore32 architecture has 2 level page tables and asm-generic/pgtable-nopmd.h and explicit casts from pud_t to pgd_t for page table folding.
Add p4d walk in the only place that actually unfolds the pud level and remove __ARCH_USE_5LEVEL_HACK.
---
arch/unicore32/include/asm/pgtable.h | 1 - arch/unicore32/kernel/hibernate.c | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-)
arch/unicore32/include/asm/pgtable.h renamed from arch/unicore32/include/asm/pgtable.h~unicore32-remove-__arch_use_5level_hack +0 -1
@@ -9,7 +9,6 @@#ifndef __UNICORE_PGTABLE_H__#define __UNICORE_PGTABLE_H__ -#define __ARCH_USE_5LEVEL_HACK#include <asm-generic/pgtable-nopmd.h> #include <asm/cpu-single.h>
arch/unicore32/kernel/hibernate.c renamed from arch/unicore32/kernel/hibernate.c~unicore32-remove-__arch_use_5level_hack +3 -1
@@ -33,9 +33,11 @@ struct swsusp_arch_regs swsusp_arch_regsstatic pmd_t *resume_one_md_table_init (pgd_t *pgd) {pud_t *pud; +p4d_t *p4d;pmd_t *pmd_table; - pud =pud_offset (pgd,0 ); + p4d =p4d_offset (pgd,0 ); + pud =pud_offset (p4d,0 ); pmd_table =pmd_offset (pud,0 );return pmd_table;
_
Patches currently in -mm which might be from [email protected] are
h8300-remove-usage-of-__arch_use_5level_hack.patch arm-add-support-for-folded-p4d-page-tables.patch arm64-add-support-for-folded-p4d-page-tables.patch hexagon-remove-__arch_use_5level_hack.patch ia64-add-support-for-folded-p4d-page-tables.patch nios2-add-support-for-folded-p4d-page-tables.patch openrisc-add-support-for-folded-p4d-page-tables.patch powerpc-add-support-for-folded-p4d-page-tables.patch sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch sh-add-support-for-folded-p4d-page-tables.patch unicore32-remove-__arch_use_5level_hack.patch asm-generic-remove-pgtable-nop4d-hackh.patch mm-remove-__arch_has_5level_hack-and-include-asm-generic-5level-fixuph.patch mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch
+ asm-generic-remove-pgtable-nop4d-hackh.patch added to -mm tree
In reply to Andrew MortonThe patch titled Subject: asm-generic: remove pgtable-nop4d-hack.h has been added to the -mm tree. Its filename is asm-generic-remove-pgtable-nop4d-hackh.patch
The patch titled
Subject: asm-generic: remove pgtable-nop4d-hack.h
has been added to the -mm tree. Its filename is
asm-generic-remove-pgtable-nop4d-hackh.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/asm-generic-remove-pgtable-nop4d-hackh.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/asm-generic-remove-pgtable-nop4d-hackh.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: asm-generic: remove pgtable-nop4d-hack.h
No architecture defines __ARCH_USE_5LEVEL_HACK and therefore pgtable-nop4d-hack.h will be never actually included.
Remove it.
---
include/asm-generic/pgtable-nop4d-hack.h | 64 --------------------- include/asm-generic/pgtable-nopud.h | 4 - 2 files changed, 68 deletions(-)
include/asm-generic/pgtable-nop4d-hack.h deleted +0 -64
@@ -1,64 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _PGTABLE_NOP4D_HACK_H -#define _PGTABLE_NOP4D_HACK_H - -#ifndef __ASSEMBLY__ -#include <asm-generic/5level-fixup.h> - -#define __PAGETABLE_PUD_FOLDED 1 - -/* -* Having the pud type consist of a pgd gets the size right, and allows -* us to conceptually access the pgd entry that this pud is folded into -* without casting. -*/ -typedef struct {pgd_t pgd; }pud_t ; - -#define PUD_SHIFT PGDIR_SHIFT -#define PTRS_PER_PUD 1 -#define PUD_SIZE (1UL << PUD_SHIFT) -#define PUD_MASK (~(PUD_SIZE-1)) - -/* -* The "pgd_xxx()" functions here are trivial for a folded two-level -* setup: the pud is never bad, and a pud always exists (as it's folded -* into the pgd entry) -*/ -static inline int pgd_none (pgd_t pgd) {return 0 ; } -static inline int pgd_bad (pgd_t pgd) {return 0 ; } -static inline int pgd_present (pgd_t pgd) {return 1 ; } -static inline void pgd_clear (pgd_t *pgd) { } -#define pud_ERROR (pud) (pgd_ERROR((pud).pgd)) - -#define pgd_populate (mm, pgd, pud) do { } while (0) -#define pgd_populate_safe (mm, pgd, pud) do { } while (0) -/* -* (puds are folded into pgds so this doesn't get actually called, -* but the define is needed for a generic inline function.) -*/ -#define set_pgd (pgdptr, pgdval) set_pud((pud_t *)(pgdptr), (pud_t) { pgdval }) - -static inline pud_t *pud_offset (pgd_t *pgd,unsigned long address) -{ -return (pud_t *)pgd; -} - -#define pud_val (x) (pgd_val((x).pgd)) -#define __pud (x) ((pud_t) { __pgd(x) }) - -#define pgd_page (pgd) (pud_page((pud_t){ pgd })) -#define pgd_page_vaddr (pgd) (pud_page_vaddr((pud_t){ pgd })) - -/* -* allocating and freeing a pud is trivial: the 1-entry pud is -* inside the pgd, so has no extra memory associated with it. -*/ -#define pud_alloc_one (mm, address) NULL -#define pud_free (mm, x) do { } while (0) -#define __pud_free_tlb (tlb, x, a) do { } while (0) - -#undef pud_addr_end -#define pud_addr_end (addr, end) (end) - -#endif /* __ASSEMBLY__ */ -#endif /* _PGTABLE_NOP4D_HACK_H */
include/asm-generic/pgtable-nopud.h renamed from include/asm-generic/pgtable-nopud.h~asm-generic-remove-pgtable-nop4d-hackh +0 -4
@@ -4,9 +4,6 @@#ifndef __ASSEMBLY__ -#ifdef __ARCH_USE_5LEVEL_HACK -#include <asm-generic/pgtable-nop4d-hack.h> -#else #include <asm-generic/pgtable-nop4d.h> #define __PAGETABLE_PUD_FOLDED 1
@@ -65,5 +62,4 @@ static inline pud_t *pud_offset(p4d_t *p#define pud_addr_end (addr, end) (end)#endif /* __ASSEMBLY__ */ -#endif /* !__ARCH_USE_5LEVEL_HACK */ #endif /* _PGTABLE_NOPUD_H */
_
Patches currently in -mm which might be from [email protected] are
h8300-remove-usage-of-__arch_use_5level_hack.patch arm-add-support-for-folded-p4d-page-tables.patch arm64-add-support-for-folded-p4d-page-tables.patch hexagon-remove-__arch_use_5level_hack.patch ia64-add-support-for-folded-p4d-page-tables.patch nios2-add-support-for-folded-p4d-page-tables.patch openrisc-add-support-for-folded-p4d-page-tables.patch powerpc-add-support-for-folded-p4d-page-tables.patch sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch sh-add-support-for-folded-p4d-page-tables.patch unicore32-remove-__arch_use_5level_hack.patch asm-generic-remove-pgtable-nop4d-hackh.patch mm-remove-__arch_has_5level_hack-and-include-asm-generic-5level-fixuph.patch mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch mm-remove-config_have_memblock_node_map-option.patch mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch mm-use-free_area_init-instead-of-free_area_init_nodes.patch alpha-simplify-detection-of-memory-zone-boundaries.patch arm-simplify-detection-of-memory-zone-boundaries.patch arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch csky-simplify-detection-of-memory-zone-boundaries.patch m68k-mm-simplify-detection-of-memory-zone-boundaries.patch parisc-simplify-detection-of-memory-zone-boundaries.patch sparc32-simplify-detection-of-memory-zone-boundaries.patch unicore32-simplify-detection-of-memory-zone-boundaries.patch xtensa-simplify-detection-of-memory-zone-boundaries.patch mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch mm-clean-up-free_area_init_node-and-its-helpers.patch mm-simplify-find_min_pfn_with_active_regions.patch docs-vm-update-memory-models-documentation.patch