Debian: gmp: add support for arc

2021-06-03 Thread Vineet Gupta
Source: gmp
Severity: normal
Tags: patch

Hi,

To bootstrap arc port we need symbols file update in gmp.
Patch attached.

Thx,
-Vineet
From 5894e168f3a19e2f113f672697cf8bb078a65a9f Mon Sep 17 00:00:00 2001
From: Vineet Gupta 
Date: Thu, 3 Jun 2021 11:33:05 -0700
Subject: [PATCH] Update symbols file for arc

Signed-off-by: Vineet Gupta 
---
 debian/libgmp10.symbols | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/debian/libgmp10.symbols b/debian/libgmp10.symbols
index 966cdc558c49..568049034d51 100644
--- a/debian/libgmp10.symbols
+++ b/debian/libgmp10.symbols
@@ -218,7 +218,7 @@ libgmp.so.10 libgmp10 #MINVER#
  (arch=any-i386)__gmpn_add_n_pentium@Base 2:5.1.1
  __gmpn_add_n_sub_n@Base 2:5.1.1
  (arch=any-i386)__gmpn_add_n_x86@Base 2:5.1.1
- (arch=!hppa !mips !mipsel !m68k !nios2 !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx !any-i386)__gmpn_add_nc@Base 0
+ (arch=!arc !hppa !mips !mipsel !m68k !nios2 !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx !any-i386)__gmpn_add_nc@Base 0
  (arch=any-i386)__gmpn_add_nc_atom@Base 2:5.1.1
  (arch=any-i386)__gmpn_add_nc_k6@Base 2:5.1.1
  (arch=any-i386)__gmpn_add_nc_k7@Base 2:5.1.1
@@ -227,9 +227,9 @@ libgmp.so.10 libgmp10 #MINVER#
  (arch=any-i386)__gmpn_add_nc_pentium@Base 2:5.1.1
  (arch=any-i386)__gmpn_add_nc_x86@Base 2:5.1.1
  (arch=any-amd64)__gmpn_addaddmul_1msb0@Base 0
- (arch=!hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !riscv64 !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_addlsh1_n@Base 2:6.2.0
+ (arch=!arc !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !riscv64 !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_addlsh1_n@Base 2:6.2.0
  (arch=any-i386)__gmpn_addlsh1_n_init@Base 2:5.1.1
- (arch=!armel !armhf !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_addlsh2_n@Base 2:6.2.0
+ (arch=!arc !armel !armhf !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_addlsh2_n@Base 2:6.2.0
  (arch=any-i386)__gmpn_addlsh2_n_init@Base 2:5.1.1
  (arch=any-amd64)__gmpn_addlsh_n@Base 0
  __gmpn_addmul_1@Base 0
@@ -273,7 +273,7 @@ libgmp.so.10 libgmp10 #MINVER#
  __gmpn_brootinv@Base 2:5.1.1
  __gmpn_bsqrt@Base 2:5.1.1
  __gmpn_bsqrtinv@Base 2:5.1.1
- (arch=hurd-i386 i386 kfreebsd-i386 riscv64 s390x sh4 sparc64)__gmpn_clz_tab@Base 2:6.2.0
+ __gmpn_clz_tab@Base 2:6.2.0
  __gmpn_cmp@Base 0
  __gmpn_cnd_add_n@Base 2:6.0.0
  (arch=any-i386)__gmpn_cnd_add_n_atom@Base 2:5.1.1
@@ -398,7 +398,7 @@ libgmp.so.10 libgmp10 #MINVER#
  __gmpn_hgcd_reduce_itch@Base 2:5.1.1
  __gmpn_hgcd_step@Base 2:5.1.1
  __gmpn_invert@Base 0
- (arch=!hppa !mips !mipsel !mips64 !mips64el !m68k !nios2 !riscv64 !sparc !sparc64 !sh3 !sh4 !tilegx !any-i386)__gmpn_invert_limb@Base 0
+ (arch=!arc !hppa !mips !mipsel !mips64 !mips64el !m68k !nios2 !riscv64 !sparc !sparc64 !sh3 !sh4 !tilegx !any-i386)__gmpn_invert_limb@Base 0
  __gmpn_invertappr@Base 0
  __gmpn_ior_n@Base 0
  __gmpn_iorn_n@Base 0
@@ -508,7 +508,7 @@ libgmp.so.10 libgmp10 #MINVER#
  (arch=any-i386)__gmpn_mul_1_pentium@Base 2:5.1.1
  (arch=any-i386)__gmpn_mul_1_pentium_mmx@Base 2:5.1.1
  (arch=any-i386)__gmpn_mul_1_x86@Base 2:5.1.1
- (arch=!any-i386 !armel !armhf !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_mul_1c@Base 2:6.2.0
+ (arch=!any-i386 !arc !armel !armhf !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_mul_1c@Base 2:6.2.0
  (arch=any-i386)__gmpn_mul_1c_atom_sse2@Base 2:5.1.1
  (arch=any-i386)__gmpn_mul_1c_k6@Base 2:5.1.1
  (arch=any-i386)__gmpn_mul_1c_k7@Base 2:5.1.1
@@ -571,13 +571,13 @@ libgmp.so.10 libgmp10 #MINVER#
  __gmpn_redc_n@Base 0
  __gmpn_remove@Base 0
  __gmpn_rootrem@Base 0
- (arch=!alpha !any-i386 !armel !armhf !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_rsblsh1_n@Base 2:6.2.0
- (arch=!alpha !any-i386 !armel !armhf !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_rsblsh2_n@Base 2:6.2.0
- (arch=!alpha !arm64 !armel !armhf !hppa !ia64 !mips !mipsel !mips64 !mips64el !m68k !nios2 !powerpc !powerpcspe !ppc64 !ppc64el !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx !any-i386)__gmpn_rsblsh_n@Base 0
- (arch=!alpha !any-i386 !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_rsh1add_n@Base 2:6.2.0
- (arch=!alpha !arm64 !armel !armhf !hppa !ia64 !mips !mipsel !mips64 !mips64el !m68k !nios2 !powerpc !powerpcspe !ppc64 !ppc64el !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx !any-i386)__gmpn_rsh1add_nc@Base 0
- (arch=!alpha !any-i386 !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !s390x !sh3 !sh4 !spa

Debian: openssl: Add ARC target

2021-06-03 Thread Vineet Gupta
Source: openssl
Severity: normal
Tags: patch

Hi,

This is needed to bootstrap arc port.
Patch attached.

Thx,
-Vineet
From 3268f18d797fb807a91a71266243e37749711b81 Mon Sep 17 00:00:00 2001
From: Vineet Gupta 
Date: Thu, 3 Jun 2021 12:12:46 -0700
Subject: [PATCH] ARC arc target

Signed-off-by: Vineet Gupta 
---
 debian/patches/debian-targets-arc.patch | 12 
 debian/patches/series   |  1 +
 2 files changed, 13 insertions(+)
 create mode 100644 debian/patches/debian-targets-arc.patch

diff --git a/debian/patches/debian-targets-arc.patch b/debian/patches/debian-targets-arc.patch
new file mode 100644
index ..66be6afece80
--- /dev/null
+++ b/debian/patches/debian-targets-arc.patch
@@ -0,0 +1,12 @@
+--- a/Configurations/20-debian.conf
 b/Configurations/20-debian.conf
+@@ -13,6 +13,9 @@ my %targets = (
+ 		inherit_from => [ "debian-alpha" ],
+ 		cflags => add("-mcpu=ev5"),
+ 	},
++	"debian-arc" => {
++		inherit_from => [ "linux-generic32", "debian" ],
++	},
+ 	"debian-arm64" => {
+ 		inherit_from => [ "linux-aarch64", "debian" ],
+ 	},
diff --git a/debian/patches/series b/debian/patches/series
index 54001c0d7f22..ebc70bc7101a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ no-symbolic.patch
 pic.patch
 c_rehash-compat.patch
 Set-systemwide-default-settings-for-libssl-users.patch
+debian-targets-arc.patch
-- 
2.25.1

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


guile: Add ARC support

2021-06-03 Thread Vineet Gupta
Hi,

I'm trying to bootstrap Debian on ARC and need to add arc support in 
guile 2.x and 3.x. Patch attached.

Thx,
-Vineet
From d7229d384e503d7a3893e13e71fe0ad16c2e8003 Mon Sep 17 00:00:00 2001
From: Vineet Gupta 
Date: Tue, 6 Apr 2021 15:03:07 -0700
Subject: [PATCH] add support for arc

Signed-off-by: Vineet Gupta 
---
 module/system/base/target.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/module/system/base/target.scm b/module/system/base/target.scm
index 2088cd86697a..8bdcd66039e4 100644
--- a/module/system/base/target.scm
+++ b/module/system/base/target.scm
@@ -77,7 +77,7 @@
   (cond ((string-match "^i[0-9]86$" cpu)
  (endianness little))
 ((member cpu '("x86_64" "ia64"
-   "powerpcle" "powerpc64le" "mipsel" "mips64el" "nios2" "sh3" "sh4" "alpha"))
+   "powerpcle" "powerpc64le" "mipsel" "mips64el" "nios2" "sh3" "sh4" "alpha" "arc"))
  (endianness little))
 ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
"mips" "mips64" "m68k" "s390x"))
@@ -118,7 +118,7 @@
 
   ((string-match "64$" cpu) 8)
   ((string-match "64_?[lbe][lbe]$" cpu) 8)
-  ((member cpu '("sparc" "powerpc" "mips" "mipsel" "nios2" "m68k" "sh3" "sh4")) 4)
+  ((member cpu '("sparc" "powerpc" "mips" "mipsel" "nios2" "m68k" "sh3" "sh4" "arc")) 4)
   ((member cpu '("s390x" "alpha")) 8)
   ((string-match "^arm.*" cpu) 4)
   (else (error "unknown CPU word size" cpu)
-- 
2.25.1

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Debian: libffi: update symbols for ARC

2021-06-03 Thread Vineet Gupta
Source: libffi
Severity: normal
Tags: patch

Hi,

This is needed to bootstrap arc port.
Patch attached.

Thx,
-Vineet
--- a/debian/libffi7.symbols.orig	2021-04-02 04:04:04.290554369 +
+++ b/debian/libffi7.symbols	2021-04-02 04:05:46.914554369 +
@@ -1,6 +1,6 @@
 libffi.so.7 libffi7 #MINVER#
  (symver)LIBFFI_BASE_7.0 3.3~20180313
  (symver)LIBFFI_CLOSURE_7.0 3.3~20180313
- (symver|arch=!hppa !ia64 !m68k !nios2 !riscv64 !sh4)LIBFFI_GO_CLOSURE_7.0 3.3~20180313
- (symver|arch=!hppa !ia64 !m68k !mips !mipsel !mips64 !mips64el !nios2 !powerpc !powerpcspe !ppc64 !ppc64el !riscv64 !sh4)LIBFFI_COMPLEX_7.0 3.3~20180313
+ (symver|arch=!arc !hppa !ia64 !m68k !nios2 !riscv64 !sh4)LIBFFI_GO_CLOSURE_7.0 3.3~20180313
+ (symver|arch=!arc !hppa !ia64 !m68k !mips !mipsel !mips64 !mips64el !nios2 !powerpc !powerpcspe !ppc64 !ppc64el !riscv64 !sh4)LIBFFI_COMPLEX_7.0 3.3~20180313
  (symver)LIBFFI_BASE_7.1 3.3~20180313
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


guile: add arc support

2021-06-03 Thread Vineet Gupta
Hi,

I'm trying to bootstrap Debian on ARC and need arc support in
guile 2.x and 3.x. Patch attached.

Thx,
-Vineet
From d7229d384e503d7a3893e13e71fe0ad16c2e8003 Mon Sep 17 00:00:00 2001
From: Vineet Gupta 
Date: Tue, 6 Apr 2021 15:03:07 -0700
Subject: [PATCH] add support for arc

Signed-off-by: Vineet Gupta 
---
 module/system/base/target.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/module/system/base/target.scm b/module/system/base/target.scm
index 2088cd86697a..8bdcd66039e4 100644
--- a/module/system/base/target.scm
+++ b/module/system/base/target.scm
@@ -77,7 +77,7 @@
   (cond ((string-match "^i[0-9]86$" cpu)
  (endianness little))
 ((member cpu '("x86_64" "ia64"
-   "powerpcle" "powerpc64le" "mipsel" "mips64el" "nios2" "sh3" "sh4" "alpha"))
+   "powerpcle" "powerpc64le" "mipsel" "mips64el" "nios2" "sh3" "sh4" "alpha" "arc"))
  (endianness little))
 ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
"mips" "mips64" "m68k" "s390x"))
@@ -118,7 +118,7 @@
 
   ((string-match "64$" cpu) 8)
   ((string-match "64_?[lbe][lbe]$" cpu) 8)
-  ((member cpu '("sparc" "powerpc" "mips" "mipsel" "nios2" "m68k" "sh3" "sh4")) 4)
+  ((member cpu '("sparc" "powerpc" "mips" "mipsel" "nios2" "m68k" "sh3" "sh4" "arc")) 4)
   ((member cpu '("s390x" "alpha")) 8)
   ((string-match "^arm.*" cpu) 4)
   (else (error "unknown CPU word size" cpu)
-- 
2.25.1

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Debian: jemalloc: add arc support

2021-06-03 Thread Vineet Gupta
Source: jemalloc
Severity: normal
Tags: patch

Hi,

This is needed to bootstrap arc port.

Merge request exist in upstream jemalloc:
https://github.com/jemalloc/jemalloc/pull/2070

And also in debian
https://salsa.debian.org/debian/jemalloc/-/merge_requests/5

Thx,
-Vineet
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Debian: jemalloc: add arc support

2021-06-03 Thread Vineet Gupta
Update: upstream change has just now been merged.

Thx,
-Vineet
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH v2 0/9] Remove DISCINTIGMEM memory model

2021-06-03 Thread Mike Rapoport
From: Mike Rapoport 

Hi,

SPARSEMEM memory model was supposed to entirely replace DISCONTIGMEM a
(long) while ago. The last architectures that used DISCONTIGMEM were
updated to use other memory models in v5.11 and it is about the time to
entirely remove DISCONTIGMEM from the kernel.

This set removes DISCONTIGMEM from alpha, arc and m68k, simplifies memory
model selection in mm/Kconfig and replaces usage of redundant
CONFIG_NEED_MULTIPLE_NODES and CONFIG_FLAT_NODE_MEM_MAP with CONFIG_NUMA
and CONFIG_FLATMEM respectively. 

I've also removed NUMA support on alpha that was BROKEN for more than 15
years.

There were also minor updates all over arch/ to remove mentions of
DISCONTIGMEM in comments and #ifdefs.

v2:
* Fix build errors reported by kbuild bot
* Add additional cleanups in m68k as suggested by Geert

v1: Link: https://lore.kernel.org/lkml/20210602105348.13387-1-r...@kernel.org

Mike Rapoport (9):
  alpha: remove DISCONTIGMEM and NUMA
  arc: update comment about HIGHMEM implementation
  arc: remove support for DISCONTIGMEM
  m68k: remove support for DISCONTIGMEM
  mm: remove CONFIG_DISCONTIGMEM
  arch, mm: remove stale mentions of DISCONIGMEM
  docs: remove description of DISCONTIGMEM
  mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA
  mm: replace CONFIG_FLAT_NODE_MEM_MAP with CONFIG_FLATMEM

 Documentation/admin-guide/sysctl/vm.rst |  12 +-
 Documentation/vm/memory-model.rst   |  45 +
 arch/alpha/Kconfig  |  22 ---
 arch/alpha/include/asm/machvec.h|   6 -
 arch/alpha/include/asm/mmzone.h | 100 ---
 arch/alpha/include/asm/pgtable.h|   4 -
 arch/alpha/include/asm/topology.h   |  39 -
 arch/alpha/kernel/core_marvel.c |  53 +-
 arch/alpha/kernel/core_wildfire.c   |  29 +--
 arch/alpha/kernel/pci_iommu.c   |  29 ---
 arch/alpha/kernel/proto.h   |   8 -
 arch/alpha/kernel/setup.c   |  16 --
 arch/alpha/kernel/sys_marvel.c  |   5 -
 arch/alpha/kernel/sys_wildfire.c|   5 -
 arch/alpha/mm/Makefile  |   2 -
 arch/alpha/mm/init.c|   3 -
 arch/alpha/mm/numa.c| 223 
 arch/arc/Kconfig|  13 --
 arch/arc/include/asm/mmzone.h   |  40 -
 arch/arc/mm/init.c  |  21 +--
 arch/arm64/Kconfig  |   2 +-
 arch/ia64/Kconfig   |   2 +-
 arch/ia64/kernel/topology.c |   5 +-
 arch/ia64/mm/numa.c |   5 +-
 arch/m68k/Kconfig.cpu   |  10 --
 arch/m68k/include/asm/mmzone.h  |  10 --
 arch/m68k/include/asm/page.h|   2 +-
 arch/m68k/include/asm/page_mm.h |  35 
 arch/m68k/mm/init.c |  20 ---
 arch/mips/Kconfig   |   2 +-
 arch/mips/include/asm/mmzone.h  |   8 +-
 arch/mips/include/asm/page.h|   2 +-
 arch/mips/mm/init.c |   7 +-
 arch/nds32/include/asm/memory.h |   6 -
 arch/powerpc/Kconfig|   2 +-
 arch/powerpc/include/asm/mmzone.h   |   4 +-
 arch/powerpc/kernel/setup_64.c  |   2 +-
 arch/powerpc/kernel/smp.c   |   2 +-
 arch/powerpc/kexec/core.c   |   4 +-
 arch/powerpc/mm/Makefile|   2 +-
 arch/powerpc/mm/mem.c   |   4 +-
 arch/riscv/Kconfig  |   2 +-
 arch/s390/Kconfig   |   2 +-
 arch/sh/include/asm/mmzone.h|   4 +-
 arch/sh/kernel/topology.c   |   2 +-
 arch/sh/mm/Kconfig  |   2 +-
 arch/sh/mm/init.c   |   2 +-
 arch/sparc/Kconfig  |   2 +-
 arch/sparc/include/asm/mmzone.h |   4 +-
 arch/sparc/kernel/smp_64.c  |   2 +-
 arch/sparc/mm/init_64.c |  12 +-
 arch/x86/Kconfig|   2 +-
 arch/x86/kernel/setup_percpu.c  |   6 +-
 arch/x86/mm/init_32.c   |   4 +-
 arch/xtensa/include/asm/page.h  |   4 -
 include/asm-generic/memory_model.h  |  37 +---
 include/asm-generic/topology.h  |   2 +-
 include/linux/gfp.h |   4 +-
 include/linux/memblock.h|   6 +-
 include/linux/mm.h  |   4 +-
 include/linux/mmzone.h  |  20 ++-
 kernel/crash_core.c |   4 +-
 mm/Kconfig  |  36 +---
 mm/memblock.c   |   8 +-
 mm/page_alloc.c |  25 +--
 mm/page_ext.c   |   2 +-
 66 files changed, 100 insertions(+), 909 deletions(-)
 delete mode 100644 arch/alpha/include/asm/mmzone.h
 delete mode 100644 arch/alpha/mm/numa.c
 delete mode 100644 arch/arc/include/asm/mmzone.h
 delete mode 100644 arch/m68k/include/asm/mmzone.h


base-commit: c4681547bcce777daf576925a966ffa824edd09d
-- 
2.28.0



[PATCH v2 1/9] alpha: remove DISCONTIGMEM and NUMA

2021-06-03 Thread Mike Rapoport
From: Mike Rapoport 

NUMA is marked broken on alpha for more than 15 years and DISCONTIGMEM was
replaced with SPARSEMEM in v5.11.

Remove both NUMA and DISCONTIGMEM support from alpha.

Signed-off-by: Mike Rapoport 
---
 arch/alpha/Kconfig|  22 ---
 arch/alpha/include/asm/machvec.h  |   6 -
 arch/alpha/include/asm/mmzone.h   | 100 --
 arch/alpha/include/asm/pgtable.h  |   4 -
 arch/alpha/include/asm/topology.h |  39 --
 arch/alpha/kernel/core_marvel.c   |  53 +--
 arch/alpha/kernel/core_wildfire.c |  29 +---
 arch/alpha/kernel/pci_iommu.c |  29 
 arch/alpha/kernel/proto.h |   8 --
 arch/alpha/kernel/setup.c |  16 ---
 arch/alpha/kernel/sys_marvel.c|   5 -
 arch/alpha/kernel/sys_wildfire.c  |   5 -
 arch/alpha/mm/Makefile|   2 -
 arch/alpha/mm/init.c  |   3 -
 arch/alpha/mm/numa.c  | 223 --
 15 files changed, 4 insertions(+), 540 deletions(-)
 delete mode 100644 arch/alpha/include/asm/mmzone.h
 delete mode 100644 arch/alpha/mm/numa.c

diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 5998106faa60..8954216b9956 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -549,29 +549,12 @@ config NR_CPUS
  MARVEL support can handle a maximum of 32 CPUs, all the others
  with working support have a maximum of 4 CPUs.
 
-config ARCH_DISCONTIGMEM_ENABLE
-   bool "Discontiguous Memory Support"
-   depends on BROKEN
-   help
- Say Y to support efficient handling of discontiguous physical memory,
- for architectures which are either NUMA (Non-Uniform Memory Access)
- or have huge holes in the physical address space for other reasons.
- See  for more.
-
 config ARCH_SPARSEMEM_ENABLE
bool "Sparse Memory Support"
help
  Say Y to support efficient handling of discontiguous physical memory,
  for systems that have huge holes in the physical address space.
 
-config NUMA
-   bool "NUMA Support (EXPERIMENTAL)"
-   depends on DISCONTIGMEM && BROKEN
-   help
- Say Y to compile the kernel to support NUMA (Non-Uniform Memory
- Access).  This option is for configuring high-end multiprocessor
- server machines.  If in doubt, say N.
-
 config ALPHA_WTINT
bool "Use WTINT" if ALPHA_SRM || ALPHA_GENERIC
default y if ALPHA_QEMU
@@ -596,11 +579,6 @@ config ALPHA_WTINT
 
  If unsure, say N.
 
-config NODES_SHIFT
-   int
-   default "7"
-   depends on NEED_MULTIPLE_NODES
-
 # LARGE_VMALLOC is racy, if you *really* need it then fix it first
 config ALPHA_LARGE_VMALLOC
bool
diff --git a/arch/alpha/include/asm/machvec.h b/arch/alpha/include/asm/machvec.h
index a4e96e2bec74..e49fabce7b33 100644
--- a/arch/alpha/include/asm/machvec.h
+++ b/arch/alpha/include/asm/machvec.h
@@ -99,12 +99,6 @@ struct alpha_machine_vector
 
const char *vector_name;
 
-   /* NUMA information */
-   int (*pa_to_nid)(unsigned long);
-   int (*cpuid_to_nid)(int);
-   unsigned long (*node_mem_start)(int);
-   unsigned long (*node_mem_size)(int);
-
/* System specific parameters.  */
union {
struct {
diff --git a/arch/alpha/include/asm/mmzone.h b/arch/alpha/include/asm/mmzone.h
deleted file mode 100644
index 86644604d977..
--- a/arch/alpha/include/asm/mmzone.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Written by Kanoj Sarcar (ka...@sgi.com) Aug 99
- * Adapted for the alpha wildfire architecture Jan 2001.
- */
-#ifndef _ASM_MMZONE_H_
-#define _ASM_MMZONE_H_
-
-#ifdef CONFIG_DISCONTIGMEM
-
-#include 
-
-/*
- * Following are macros that are specific to this numa platform.
- */
-
-extern pg_data_t node_data[];
-
-#define alpha_pa_to_nid(pa)\
-(alpha_mv.pa_to_nid\
-? alpha_mv.pa_to_nid(pa)   \
-: (0))
-#define node_mem_start(nid)\
-(alpha_mv.node_mem_start   \
-? alpha_mv.node_mem_start(nid) \
-: (0UL))
-#define node_mem_size(nid) \
-(alpha_mv.node_mem_size\
-? alpha_mv.node_mem_size(nid)  \
-: ((nid) ? (0UL) : (~0UL)))
-
-#define pa_to_nid(pa)  alpha_pa_to_nid(pa)
-#define NODE_DATA(nid) (&node_data[(nid)])
-
-#define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn)
-
-#if 1
-#define PLAT_NODE_DATA_LOCALNR(p, n)   \
-   (((p) >> PAGE_SHIFT) - PLAT_NODE_DATA(n)->gendata.node_start_pfn)
-#else
-static inline unsigned long
-PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)
-{
-   unsigned long temp;
-   temp = p >> PAGE_SHIFT;
-   return temp - PLAT_NODE_DATA(n)->gendata.node_start_pfn;
-}
-#endif
-
-/*
- * Following are macros that each numa implementation must define.
- */
-
-/*
- * Given a kernel address, find the home node of the underlying memory.
- */
-#define kvaddr_to_nid(kaddr)   p

[PATCH v2 2/9] arc: update comment about HIGHMEM implementation

2021-06-03 Thread Mike Rapoport
From: Mike Rapoport 

Arc does not use DISCONTIGMEM to implement high memory, update the comment
describing how high memory works to reflect this.

Signed-off-by: Mike Rapoport 
---
 arch/arc/mm/init.c | 13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index e2ed355438c9..397a201adfe3 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -139,16 +139,13 @@ void __init setup_arch_memory(void)
 
 #ifdef CONFIG_HIGHMEM
/*
-* Populate a new node with highmem
-*
 * On ARC (w/o PAE) HIGHMEM addresses are actually smaller (0 based)
-* than addresses in normal ala low memory (0x8000_ based).
+* than addresses in normal aka low memory (0x8000_ based).
 * Even with PAE, the huge peripheral space hole would waste a lot of
-* mem with single mem_map[]. This warrants a mem_map per region design.
-* Thus HIGHMEM on ARC is imlemented with DISCONTIGMEM.
-*
-* DISCONTIGMEM in turns requires multiple nodes. node 0 above is
-* populated with normal memory zone while node 1 only has highmem
+* mem with single contiguous mem_map[].
+* Thus when HIGHMEM on ARC is enabled the memory map corresponding
+* to the hole is freed and ARC specific version of pfn_valid()
+* handles the hole in the memory map.
 */
 #ifdef CONFIG_DISCONTIGMEM
node_set_online(1);
-- 
2.28.0


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH v2 3/9] arc: remove support for DISCONTIGMEM

2021-06-03 Thread Mike Rapoport
From: Mike Rapoport 

DISCONTIGMEM was replaced by FLATMEM with freeing of the unused memory map
in v5.11.

Remove the support for DISCONTIGMEM entirely.

Signed-off-by: Mike Rapoport 
---
 arch/arc/Kconfig  | 13 
 arch/arc/include/asm/mmzone.h | 40 ---
 arch/arc/mm/init.c|  8 ---
 3 files changed, 61 deletions(-)
 delete mode 100644 arch/arc/include/asm/mmzone.h

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 2d98501c0897..d8f51eb8963b 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -62,10 +62,6 @@ config SCHED_OMIT_FRAME_POINTER
 config GENERIC_CSUM
def_bool y
 
-config ARCH_DISCONTIGMEM_ENABLE
-   def_bool n
-   depends on BROKEN
-
 config ARCH_FLATMEM_ENABLE
def_bool y
 
@@ -344,15 +340,6 @@ config ARC_HUGEPAGE_16M
 
 endchoice
 
-config NODES_SHIFT
-   int "Maximum NUMA Nodes (as a power of 2)"
-   default "0" if !DISCONTIGMEM
-   default "1" if DISCONTIGMEM
-   depends on NEED_MULTIPLE_NODES
-   help
- Accessing memory beyond 1GB (with or w/o PAE) requires 2 memory
- zones.
-
 config ARC_COMPACT_IRQ_LEVELS
depends on ISA_ARCOMPACT
bool "Setup Timer IRQ as high Priority"
diff --git a/arch/arc/include/asm/mmzone.h b/arch/arc/include/asm/mmzone.h
deleted file mode 100644
index b86b9d1e54dc..
--- a/arch/arc/include/asm/mmzone.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
- */
-
-#ifndef _ASM_ARC_MMZONE_H
-#define _ASM_ARC_MMZONE_H
-
-#ifdef CONFIG_DISCONTIGMEM
-
-extern struct pglist_data node_data[];
-#define NODE_DATA(nid) (&node_data[nid])
-
-static inline int pfn_to_nid(unsigned long pfn)
-{
-   int is_end_low = 1;
-
-   if (IS_ENABLED(CONFIG_ARC_HAS_PAE40))
-   is_end_low = pfn <= virt_to_pfn(0xUL);
-
-   /*
-* node 0: lowmem: 0x8000_   to 0x_
-* node 1: HIGHMEM w/o  PAE40: 0x0   to 0x7FFF_
-* HIGHMEM with PAE40: 0x1__ to ...
-*/
-   if (pfn >= ARCH_PFN_OFFSET && is_end_low)
-   return 0;
-
-   return 1;
-}
-
-static inline int pfn_valid(unsigned long pfn)
-{
-   int nid = pfn_to_nid(pfn);
-
-   return (pfn <= node_end_pfn(nid));
-}
-#endif /* CONFIG_DISCONTIGMEM  */
-
-#endif
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index 397a201adfe3..abfeef7bf6f8 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -32,11 +32,6 @@ unsigned long arch_pfn_offset;
 EXPORT_SYMBOL(arch_pfn_offset);
 #endif
 
-#ifdef CONFIG_DISCONTIGMEM
-struct pglist_data node_data[MAX_NUMNODES] __read_mostly;
-EXPORT_SYMBOL(node_data);
-#endif
-
 long __init arc_get_mem_sz(void)
 {
return low_mem_sz;
@@ -147,9 +142,6 @@ void __init setup_arch_memory(void)
 * to the hole is freed and ARC specific version of pfn_valid()
 * handles the hole in the memory map.
 */
-#ifdef CONFIG_DISCONTIGMEM
-   node_set_online(1);
-#endif
 
min_high_pfn = PFN_DOWN(high_mem_start);
max_high_pfn = PFN_DOWN(high_mem_start + high_mem_sz);
-- 
2.28.0


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH v2 4/9] m68k: remove support for DISCONTIGMEM

2021-06-03 Thread Mike Rapoport
From: Mike Rapoport 

DISCONTIGMEM was replaced by FLATMEM with freeing of the unused memory map
in v5.11.

Remove the support for DISCONTIGMEM entirely.

Signed-off-by: Mike Rapoport 
Reviewed-by: Geert Uytterhoeven 
Acked-by: Geert Uytterhoeven 
---
 arch/m68k/Kconfig.cpu   | 10 --
 arch/m68k/include/asm/mmzone.h  | 10 --
 arch/m68k/include/asm/page.h|  2 +-
 arch/m68k/include/asm/page_mm.h | 35 -
 arch/m68k/mm/init.c | 20 ---
 5 files changed, 1 insertion(+), 76 deletions(-)
 delete mode 100644 arch/m68k/include/asm/mmzone.h

diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
index f4d23977d2a5..29e946394fdb 100644
--- a/arch/m68k/Kconfig.cpu
+++ b/arch/m68k/Kconfig.cpu
@@ -408,10 +408,6 @@ config SINGLE_MEMORY_CHUNK
  order" to save memory that could be wasted for unused memory map.
  Say N if not sure.
 
-config ARCH_DISCONTIGMEM_ENABLE
-   depends on BROKEN
-   def_bool MMU && !SINGLE_MEMORY_CHUNK
-
 config FORCE_MAX_ZONEORDER
int "Maximum zone order" if ADVANCED
depends on !SINGLE_MEMORY_CHUNK
@@ -451,11 +447,6 @@ config M68K_L2_CACHE
depends on MAC
default y
 
-config NODES_SHIFT
-   int
-   default "3"
-   depends on DISCONTIGMEM
-
 config CPU_HAS_NO_BITFIELDS
bool
 
@@ -553,4 +544,3 @@ config CACHE_COPYBACK
  The ColdFire CPU cache is set into Copy-back mode.
 endchoice
 endif
-
diff --git a/arch/m68k/include/asm/mmzone.h b/arch/m68k/include/asm/mmzone.h
deleted file mode 100644
index 64573fe8e60d..
--- a/arch/m68k/include/asm/mmzone.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _ASM_M68K_MMZONE_H_
-#define _ASM_M68K_MMZONE_H_
-
-extern pg_data_t pg_data_map[];
-
-#define NODE_DATA(nid) (&pg_data_map[nid])
-#define NODE_MEM_MAP(nid)  (NODE_DATA(nid)->node_mem_map)
-
-#endif /* _ASM_M68K_MMZONE_H_ */
diff --git a/arch/m68k/include/asm/page.h b/arch/m68k/include/asm/page.h
index 97087dd3ca6d..2f1c54e4725d 100644
--- a/arch/m68k/include/asm/page.h
+++ b/arch/m68k/include/asm/page.h
@@ -62,7 +62,7 @@ extern unsigned long _ramend;
 #include 
 #endif
 
-#if !defined(CONFIG_MMU) || defined(CONFIG_DISCONTIGMEM)
+#ifndef CONFIG_MMU
 #define __phys_to_pfn(paddr)   ((unsigned long)((paddr) >> PAGE_SHIFT))
 #define __pfn_to_phys(pfn) PFN_PHYS(pfn)
 #endif
diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h
index 2411ea9ef578..a5b459bcb7d8 100644
--- a/arch/m68k/include/asm/page_mm.h
+++ b/arch/m68k/include/asm/page_mm.h
@@ -126,26 +126,6 @@ static inline void *__va(unsigned long x)
 
 extern int m68k_virt_to_node_shift;
 
-#ifndef CONFIG_DISCONTIGMEM
-#define __virt_to_node(addr)   (&pg_data_map[0])
-#else
-extern struct pglist_data *pg_data_table[];
-
-static inline __attribute_const__ int __virt_to_node_shift(void)
-{
-   int shift;
-
-   asm (
-   "1: moveq   #0,%0\n"
-   m68k_fixup(%c1, 1b)
-   : "=d" (shift)
-   : "i" (m68k_fixup_vnode_shift));
-   return shift;
-}
-
-#define __virt_to_node(addr)   (pg_data_table[(unsigned long)(addr) >> 
__virt_to_node_shift()])
-#endif
-
 #define virt_to_page(addr) ({  \
pfn_to_page(virt_to_pfn(addr)); \
 })
@@ -153,23 +133,8 @@ static inline __attribute_const__ int 
__virt_to_node_shift(void)
pfn_to_virt(page_to_pfn(page)); \
 })
 
-#ifdef CONFIG_DISCONTIGMEM
-#define pfn_to_page(pfn) ({\
-   unsigned long __pfn = (pfn);\
-   struct pglist_data *pgdat;  \
-   pgdat = __virt_to_node((unsigned long)pfn_to_virt(__pfn));  \
-   pgdat->node_mem_map + (__pfn - pgdat->node_start_pfn);  \
-})
-#define page_to_pfn(_page) ({  \
-   const struct page *__p = (_page);   \
-   struct pglist_data *pgdat;  \
-   pgdat = &pg_data_map[page_to_nid(__p)]; \
-   ((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn;  \
-})
-#else
 #define ARCH_PFN_OFFSET (m68k_memory[0].addr >> PAGE_SHIFT)
 #include 
-#endif
 
 #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && 
(unsigned long)(kaddr) < (unsigned long)high_memory)
 #define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn))
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index 1759ab875d47..5d749e188246 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -44,28 +44,8 @@ EXPORT_SYMBOL(empty_zero_page);
 
 int m68k_virt_to_node_shift;
 
-#ifdef CONFIG_DISCONTIGMEM
-pg_data_t pg_data_map[MAX_NUMNODES];
-EXPORT_SYMBOL(pg_data_map);
-
-pg_data_t *pg_data_table[65

[PATCH v2 5/9] mm: remove CONFIG_DISCONTIGMEM

2021-06-03 Thread Mike Rapoport
From: Mike Rapoport 

There are no architectures that support DISCONTIGMEM left.

Remove the configuration option and the dead code it was guarding in the
generic memory management code.

Signed-off-by: Mike Rapoport 
---
 include/asm-generic/memory_model.h | 37 --
 include/linux/mmzone.h |  8 ---
 mm/Kconfig | 25 +++-
 mm/page_alloc.c| 13 ---
 4 files changed, 12 insertions(+), 71 deletions(-)

diff --git a/include/asm-generic/memory_model.h 
b/include/asm-generic/memory_model.h
index 7637fb46ba4f..a2c8ed60233a 100644
--- a/include/asm-generic/memory_model.h
+++ b/include/asm-generic/memory_model.h
@@ -6,47 +6,18 @@
 
 #ifndef __ASSEMBLY__
 
+/*
+ * supports 3 memory models.
+ */
 #if defined(CONFIG_FLATMEM)
 
 #ifndef ARCH_PFN_OFFSET
 #define ARCH_PFN_OFFSET(0UL)
 #endif
 
-#elif defined(CONFIG_DISCONTIGMEM)
-
-#ifndef arch_pfn_to_nid
-#define arch_pfn_to_nid(pfn)   pfn_to_nid(pfn)
-#endif
-
-#ifndef arch_local_page_offset
-#define arch_local_page_offset(pfn, nid)   \
-   ((pfn) - NODE_DATA(nid)->node_start_pfn)
-#endif
-
-#endif /* CONFIG_DISCONTIGMEM */
-
-/*
- * supports 3 memory models.
- */
-#if defined(CONFIG_FLATMEM)
-
 #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))
 #define __page_to_pfn(page)((unsigned long)((page) - mem_map) + \
 ARCH_PFN_OFFSET)
-#elif defined(CONFIG_DISCONTIGMEM)
-
-#define __pfn_to_page(pfn) \
-({ unsigned long __pfn = (pfn);\
-   unsigned long __nid = arch_pfn_to_nid(__pfn);  \
-   NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\
-})
-
-#define __page_to_pfn(pg)  \
-({ const struct page *__pg = (pg); \
-   struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \
-   (unsigned long)(__pg - __pgdat->node_mem_map) + \
-__pgdat->node_start_pfn;   \
-})
 
 #elif defined(CONFIG_SPARSEMEM_VMEMMAP)
 
@@ -70,7 +41,7 @@
struct mem_section *__sec = __pfn_to_section(__pfn);\
__section_mem_map_addr(__sec) + __pfn;  \
 })
-#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */
+#endif /* CONFIG_FLATMEM/SPARSEMEM */
 
 /*
  * Convert a physical address to a Page Frame Number and back
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 0d53eba1c383..700032e99419 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -738,10 +738,12 @@ struct zonelist {
struct zoneref _zonerefs[MAX_ZONES_PER_ZONELIST + 1];
 };
 
-#ifndef CONFIG_DISCONTIGMEM
-/* The array of struct pages - for discontigmem use pgdat->lmem_map */
+/*
+ * The array of struct pages for flatmem.
+ * It must be declared for SPARSEMEM as well because there are configurations
+ * that rely on that.
+ */
 extern struct page *mem_map;
-#endif
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 struct deferred_split {
diff --git a/mm/Kconfig b/mm/Kconfig
index 02d44e3420f5..218b96ccc84a 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -19,7 +19,7 @@ choice
 
 config FLATMEM_MANUAL
bool "Flat Memory"
-   depends on !(ARCH_DISCONTIGMEM_ENABLE || ARCH_SPARSEMEM_ENABLE) || 
ARCH_FLATMEM_ENABLE
+   depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE
help
  This option is best suited for non-NUMA systems with
  flat address space. The FLATMEM is the most efficient
@@ -32,21 +32,6 @@ config FLATMEM_MANUAL
 
  If unsure, choose this option (Flat Memory) over any other.
 
-config DISCONTIGMEM_MANUAL
-   bool "Discontiguous Memory"
-   depends on ARCH_DISCONTIGMEM_ENABLE
-   help
- This option provides enhanced support for discontiguous
- memory systems, over FLATMEM.  These systems have holes
- in their physical address spaces, and this option provides
- more efficient handling of these holes.
-
- Although "Discontiguous Memory" is still used by several
- architectures, it is considered deprecated in favor of
- "Sparse Memory".
-
- If unsure, choose "Sparse Memory" over this option.
-
 config SPARSEMEM_MANUAL
bool "Sparse Memory"
depends on ARCH_SPARSEMEM_ENABLE
@@ -62,17 +47,13 @@ config SPARSEMEM_MANUAL
 
 endchoice
 
-config DISCONTIGMEM
-   def_bool y
-   depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || 
DISCONTIGMEM_MANUAL
-
 config SPARSEMEM
def_bool y
depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || 
SPARSEMEM_MANUAL
 
 config FLATMEM
def_bool y
-   depends on (!DISCONTIGMEM && !SPARSEMEM) || FLATMEM_MANUAL
+   depends on !SPARSEMEM || FLATMEM_MANUAL
 
 config FLAT_NODE_MEM_MAP
def_bool y
@@ -85,7 +66,7 @@ config FLAT_NODE_MEM_MAP
 #
 config NEED_MULTIPLE_NODES
  

[PATCH v2 6/9] arch, mm: remove stale mentions of DISCONIGMEM

2021-06-03 Thread Mike Rapoport
From: Mike Rapoport 

There are several places that mention DISCONIGMEM in comments or have stale
code guarded by CONFIG_DISCONTIGMEM.

Remove the dead code and update the comments.

Signed-off-by: Mike Rapoport 
---
 arch/ia64/kernel/topology.c | 5 ++---
 arch/ia64/mm/numa.c | 5 ++---
 arch/mips/include/asm/mmzone.h  | 6 --
 arch/mips/mm/init.c | 3 ---
 arch/nds32/include/asm/memory.h | 6 --
 arch/xtensa/include/asm/page.h  | 4 
 include/linux/gfp.h | 4 ++--
 7 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index 09fc385c2acd..3639e0a7cb3b 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -3,9 +3,8 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * This file contains NUMA specific variables and functions which can
- * be split away from DISCONTIGMEM and are used on NUMA machines with
- * contiguous memory.
+ * This file contains NUMA specific variables and functions which are used on
+ * NUMA machines with contiguous memory.
  * 2002/08/07 Erich Focht 
  * Populate cpu entries in sysfs for non-numa systems as well
  * Intel Corporation - Ashok Raj
diff --git a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c
index 46b6e5f3a40f..d6579ec3ea32 100644
--- a/arch/ia64/mm/numa.c
+++ b/arch/ia64/mm/numa.c
@@ -3,9 +3,8 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * This file contains NUMA specific variables and functions which can
- * be split away from DISCONTIGMEM and are used on NUMA machines with
- * contiguous memory.
+ * This file contains NUMA specific variables and functions which are used on
+ * NUMA machines with contiguous memory.
  * 
  * 2002/08/07 Erich Focht 
  */
diff --git a/arch/mips/include/asm/mmzone.h b/arch/mips/include/asm/mmzone.h
index b826b8473e95..7649ab45e80c 100644
--- a/arch/mips/include/asm/mmzone.h
+++ b/arch/mips/include/asm/mmzone.h
@@ -20,10 +20,4 @@
 #define nid_to_addrbase(nid) 0
 #endif
 
-#ifdef CONFIG_DISCONTIGMEM
-
-#define pfn_to_nid(pfn)pa_to_nid((pfn) << PAGE_SHIFT)
-
-#endif /* CONFIG_DISCONTIGMEM */
-
 #endif /* _ASM_MMZONE_H_ */
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index c36358758969..97f6ca341448 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -454,9 +454,6 @@ void __init mem_init(void)
BUILD_BUG_ON(IS_ENABLED(CONFIG_32BIT) && (_PFN_SHIFT > PAGE_SHIFT));
 
 #ifdef CONFIG_HIGHMEM
-#ifdef CONFIG_DISCONTIGMEM
-#error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet"
-#endif
max_mapnr = highend_pfn ? highend_pfn : max_low_pfn;
 #else
max_mapnr = max_low_pfn;
diff --git a/arch/nds32/include/asm/memory.h b/arch/nds32/include/asm/memory.h
index 940d32842793..62faafbc28e4 100644
--- a/arch/nds32/include/asm/memory.h
+++ b/arch/nds32/include/asm/memory.h
@@ -76,18 +76,12 @@
  *  virt_to_page(k)convert a _valid_ virtual address to struct page *
  *  virt_addr_valid(k) indicates whether a virtual address is valid
  */
-#ifndef CONFIG_DISCONTIGMEM
-
 #define ARCH_PFN_OFFSETPHYS_PFN_OFFSET
 #define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < 
(PHYS_PFN_OFFSET + max_mapnr))
 
 #define virt_to_page(kaddr)(pfn_to_page(__pa(kaddr) >> PAGE_SHIFT))
 #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && 
(unsigned long)(kaddr) < (unsigned long)high_memory)
 
-#else /* CONFIG_DISCONTIGMEM */
-#error CONFIG_DISCONTIGMEM is not supported yet.
-#endif /* !CONFIG_DISCONTIGMEM */
-
 #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
 
 #endif
diff --git a/arch/xtensa/include/asm/page.h b/arch/xtensa/include/asm/page.h
index 37ce25ef92d6..493eb7083b1a 100644
--- a/arch/xtensa/include/asm/page.h
+++ b/arch/xtensa/include/asm/page.h
@@ -192,10 +192,6 @@ static inline unsigned long ___pa(unsigned long va)
 #define pfn_valid(pfn) \
((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
 
-#ifdef CONFIG_DISCONTIGMEM
-# error CONFIG_DISCONTIGMEM not supported
-#endif
-
 #define virt_to_page(kaddr)pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
 #define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
 #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 11da8af06704..dbe1f5fc901d 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -494,8 +494,8 @@ static inline int gfp_zonelist(gfp_t flags)
  * There are two zonelists per node, one for all zones with memory and
  * one containing just zones from the node the zonelist belongs to.
  *
- * For the normal case of non-DISCONTIGMEM systems the NODE_DATA() gets
- * optimized to &contig_page_data at compile-time.
+ * For the case of non-NUMA systems the NODE_DATA() gets optimized to
+ * &co

[PATCH v2 7/9] docs: remove description of DISCONTIGMEM

2021-06-03 Thread Mike Rapoport
From: Mike Rapoport 

Remove description of DISCONTIGMEM from the "Memory Models" document and
update VM sysctl description so that it won't mention DISCONIGMEM.

Signed-off-by: Mike Rapoport 
---
 Documentation/admin-guide/sysctl/vm.rst | 12 +++
 Documentation/vm/memory-model.rst   | 45 ++---
 2 files changed, 8 insertions(+), 49 deletions(-)

diff --git a/Documentation/admin-guide/sysctl/vm.rst 
b/Documentation/admin-guide/sysctl/vm.rst
index 586cd4b86428..ddbd71d592e0 100644
--- a/Documentation/admin-guide/sysctl/vm.rst
+++ b/Documentation/admin-guide/sysctl/vm.rst
@@ -936,12 +936,12 @@ allocations, THP and hugetlbfs pages.
 
 To make it sensible with respect to the watermark_scale_factor
 parameter, the unit is in fractions of 10,000. The default value of
-15,000 on !DISCONTIGMEM configurations means that up to 150% of the high
-watermark will be reclaimed in the event of a pageblock being mixed due
-to fragmentation. The level of reclaim is determined by the number of
-fragmentation events that occurred in the recent past. If this value is
-smaller than a pageblock then a pageblocks worth of pages will be reclaimed
-(e.g.  2MB on 64-bit x86). A boost factor of 0 will disable the feature.
+15,000 means that up to 150% of the high watermark will be reclaimed in the
+event of a pageblock being mixed due to fragmentation. The level of reclaim
+is determined by the number of fragmentation events that occurred in the
+recent past. If this value is smaller than a pageblock then a pageblocks
+worth of pages will be reclaimed (e.g.  2MB on 64-bit x86). A boost factor
+of 0 will disable the feature.
 
 
 watermark_scale_factor
diff --git a/Documentation/vm/memory-model.rst 
b/Documentation/vm/memory-model.rst
index ce398a7dc6cd..30e8fbed6914 100644
--- a/Documentation/vm/memory-model.rst
+++ b/Documentation/vm/memory-model.rst
@@ -14,15 +14,11 @@ for the CPU. Then there could be several contiguous ranges 
at
 completely distinct addresses. And, don't forget about NUMA, where
 different memory banks are attached to different CPUs.
 
-Linux abstracts this diversity using one of the three memory models:
-FLATMEM, DISCONTIGMEM and SPARSEMEM. Each architecture defines what
+Linux abstracts this diversity using one of the two memory models:
+FLATMEM and SPARSEMEM. Each architecture defines what
 memory models it supports, what the default memory model is and
 whether it is possible to manually override that default.
 
-.. note::
-   At time of this writing, DISCONTIGMEM is considered deprecated,
-   although it is still in use by several architectures.
-
 All the memory models track the status of physical page frames using
 struct page arranged in one or more arrays.
 
@@ -63,43 +59,6 @@ straightforward: `PFN - ARCH_PFN_OFFSET` is an index to the
 The `ARCH_PFN_OFFSET` defines the first page frame number for
 systems with physical memory starting at address different from 0.
 
-DISCONTIGMEM
-
-
-The DISCONTIGMEM model treats the physical memory as a collection of
-`nodes` similarly to how Linux NUMA support does. For each node Linux
-constructs an independent memory management subsystem represented by
-`struct pglist_data` (or `pg_data_t` for short). Among other
-things, `pg_data_t` holds the `node_mem_map` array that maps
-physical pages belonging to that node. The `node_start_pfn` field of
-`pg_data_t` is the number of the first page frame belonging to that
-node.
-
-The architecture setup code should call :c:func:`free_area_init_node` for
-each node in the system to initialize the `pg_data_t` object and its
-`node_mem_map`.
-
-Every `node_mem_map` behaves exactly as FLATMEM's `mem_map` -
-every physical page frame in a node has a `struct page` entry in the
-`node_mem_map` array. When DISCONTIGMEM is enabled, a portion of the
-`flags` field of the `struct page` encodes the node number of the
-node hosting that page.
-
-The conversion between a PFN and the `struct page` in the
-DISCONTIGMEM model became slightly more complex as it has to determine
-which node hosts the physical page and which `pg_data_t` object
-holds the `struct page`.
-
-Architectures that support DISCONTIGMEM provide :c:func:`pfn_to_nid`
-to convert PFN to the node number. The opposite conversion helper
-:c:func:`page_to_nid` is generic as it uses the node number encoded in
-page->flags.
-
-Once the node number is known, the PFN can be used to index
-appropriate `node_mem_map` array to access the `struct page` and
-the offset of the `struct page` from the `node_mem_map` plus
-`node_start_pfn` is the PFN of that page.
-
 SPARSEMEM
 =
 
-- 
2.28.0


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc