2023-03-25 06:10:08

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v3 00/14] arch,mm: cleanup Kconfig entries for ARCH_FORCE_MAX_ORDER

From: "Mike Rapoport (IBM)" <[email protected]>

Hi,

Several architectures have ARCH_FORCE_MAX_ORDER in their Kconfig and
they all have wrong and misleading prompt and help text for this option.

Besides, some define insane limits for possible values of
ARCH_FORCE_MAX_ORDER, some carefully define ranges only for a subset of
possible configurations, some make this option configurable by users for no
good reason.

This set updates the prompt and help text everywhere and does its best to
update actual definitions of ranges where applicable.

kbuild generated a bunch of false positives because it assigns -1 to
ARCH_FORCE_MAX_ORDER, hopefully this will be fixed soon.

v3:
* fix rebase fallouts (Zi Yan)

v2: https://lore.kernel.org/all/[email protected]
* arm64: show prompt for ARCH_FORCE_MAX_ORDER only if EXPERT (Catalin)
* Add Acked- and Reviewed-by tags (thanks Geert, Kirill and Max)

v1: https://lore.kernel.org/all/[email protected]

Mike Rapoport (IBM) (14):
arm: reword ARCH_FORCE_MAX_ORDER prompt and help text
arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER
arm64: reword ARCH_FORCE_MAX_ORDER prompt and help text
csky: drop ARCH_FORCE_MAX_ORDER
ia64: don't allow users to override ARCH_FORCE_MAX_ORDER
m68k: reword ARCH_FORCE_MAX_ORDER prompt and help text
nios2: reword ARCH_FORCE_MAX_ORDER prompt and help text
nios2: drop ranges for definition of ARCH_FORCE_MAX_ORDER
powerpc: reword ARCH_FORCE_MAX_ORDER prompt and help text
powerpc: drop ranges for definition of ARCH_FORCE_MAX_ORDER
sh: reword ARCH_FORCE_MAX_ORDER prompt and help text
sh: drop ranges for definition of ARCH_FORCE_MAX_ORDER
sparc: reword ARCH_FORCE_MAX_ORDER prompt and help text
xtensa: reword ARCH_FORCE_MAX_ORDER prompt and help text

arch/arm/Kconfig | 16 +++++++++-------
arch/arm64/Kconfig | 26 ++++++++++++--------------
arch/csky/Kconfig | 4 ----
arch/ia64/Kconfig | 3 +--
arch/m68k/Kconfig.cpu | 16 +++++++++-------
arch/nios2/Kconfig | 17 +++++++++--------
arch/powerpc/Kconfig | 22 +++++++++-------------
arch/sh/mm/Kconfig | 19 +++++++++----------
arch/sparc/Kconfig | 16 +++++++++-------
arch/xtensa/Kconfig | 16 +++++++++-------
10 files changed, 76 insertions(+), 79 deletions(-)


base-commit: 51551d71edbc998fd8c8afa7312db3d270f5998e
--
2.35.1

*** BLURB HERE ***

Mike Rapoport (IBM) (14):
arm: reword ARCH_FORCE_MAX_ORDER prompt and help text
arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER
arm64: reword ARCH_FORCE_MAX_ORDER prompt and help text
csky: drop ARCH_FORCE_MAX_ORDER
ia64: don't allow users to override ARCH_FORCE_MAX_ORDER
m68k: reword ARCH_FORCE_MAX_ORDER prompt and help text
nios2: reword ARCH_FORCE_MAX_ORDER prompt and help text
nios2: drop ranges for definition of ARCH_FORCE_MAX_ORDER
powerpc: reword ARCH_FORCE_MAX_ORDER prompt and help text
powerpc: drop ranges for definition of ARCH_FORCE_MAX_ORDER
sh: reword ARCH_FORCE_MAX_ORDER prompt and help text
sh: drop ranges for definition of ARCH_FORCE_MAX_ORDER
sparc: reword ARCH_FORCE_MAX_ORDER prompt and help text
xtensa: reword ARCH_FORCE_MAX_ORDER prompt and help text

arch/arm/Kconfig | 16 +++++++++-------
arch/arm64/Kconfig | 26 ++++++++++++--------------
arch/csky/Kconfig | 4 ----
arch/ia64/Kconfig | 3 +--
arch/m68k/Kconfig.cpu | 16 +++++++++-------
arch/nios2/Kconfig | 17 +++++++++--------
arch/powerpc/Kconfig | 22 +++++++++-------------
arch/sh/mm/Kconfig | 19 +++++++++----------
arch/sparc/Kconfig | 16 +++++++++-------
arch/xtensa/Kconfig | 16 +++++++++-------
10 files changed, 76 insertions(+), 79 deletions(-)


base-commit: 51551d71edbc998fd8c8afa7312db3d270f5998e
--
2.35.1


2023-03-25 06:10:17

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v3 02/14] arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER

From: "Mike Rapoport (IBM)" <[email protected]>

It is not a good idea to change fundamental parameters of core memory
management. Having predefined ranges suggests that the values within
those ranges are sensible, but one has to *really* understand
implications of changing MAX_ORDER before actually amending it and
ranges don't help here.

Drop ranges in definition of ARCH_FORCE_MAX_ORDER and make its prompt
visible only if EXPERT=y

Acked-by: Kirill A. Shutemov <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
---
arch/arm64/Kconfig | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index e60baf7859d1..7324032af859 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1487,11 +1487,9 @@ config XEN
# 16K | 27 | 14 | 13 | 11 |
# 64K | 29 | 16 | 13 | 13 |
config ARCH_FORCE_MAX_ORDER
- int "Maximum zone order" if ARM64_4K_PAGES || ARM64_16K_PAGES
+ int "Maximum zone order" if EXPERT && (ARM64_4K_PAGES || ARM64_16K_PAGES)
default "13" if ARM64_64K_PAGES
- range 11 13 if ARM64_16K_PAGES
default "11" if ARM64_16K_PAGES
- range 10 15 if ARM64_4K_PAGES
default "10"
help
The kernel memory allocator divides physically contiguous memory
--
2.35.1

2023-03-25 06:10:46

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v3 05/14] ia64: don't allow users to override ARCH_FORCE_MAX_ORDER

From: "Mike Rapoport (IBM)" <[email protected]>

It is enough to keep default values for base and huge pages without
letting users to override ARCH_FORCE_MAX_ORDER.

Drop the prompt to make the option unvisible in *config.

Acked-by: Kirill A. Shutemov <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
---
arch/ia64/Kconfig | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 0d2f41fa56ee..b61437cae162 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -202,8 +202,7 @@ config IA64_CYCLONE
If you're unsure, answer N.

config ARCH_FORCE_MAX_ORDER
- int "MAX_ORDER (10 - 16)" if !HUGETLB_PAGE
- range 10 16 if !HUGETLB_PAGE
+ int
default "16" if HUGETLB_PAGE
default "10"

--
2.35.1

2023-03-25 06:10:46

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v3 03/14] arm64: reword ARCH_FORCE_MAX_ORDER prompt and help text

From: "Mike Rapoport (IBM)" <[email protected]>

The prompt and help text of ARCH_FORCE_MAX_ORDER are not even close to
describe this configuration option.

Update both to actually describe what this option does.

Acked-by: Kirill A. Shutemov <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
---
arch/arm64/Kconfig | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 7324032af859..cc11cdcf5a00 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1487,24 +1487,24 @@ config XEN
# 16K | 27 | 14 | 13 | 11 |
# 64K | 29 | 16 | 13 | 13 |
config ARCH_FORCE_MAX_ORDER
- int "Maximum zone order" if EXPERT && (ARM64_4K_PAGES || ARM64_16K_PAGES)
+ int "Order of maximal physically contiguous allocations" if EXPERT && (ARM64_4K_PAGES || ARM64_16K_PAGES)
default "13" if ARM64_64K_PAGES
default "11" if ARM64_16K_PAGES
default "10"
help
- The kernel memory allocator divides physically contiguous memory
- blocks into "zones", where each zone is a power of two number of
- pages. This option selects the largest power of two that the kernel
- keeps in the memory allocator. If you need to allocate very large
- blocks of physically contiguous memory, then you may need to
- increase this value.
+ The kernel page allocator limits the size of maximal physically
+ contiguous allocations. The limit is called MAX_ORDER and it
+ defines the maximal power of two of number of pages that can be
+ allocated as a single contiguous block. This option allows
+ overriding the default setting when ability to allocate very
+ large blocks of physically contiguous memory is required.

- We make sure that we can allocate up to a HugePage size for each configuration.
- Hence we have :
- MAX_ORDER = PMD_SHIFT - PAGE_SHIFT => PAGE_SHIFT - 3
+ The maximal size of allocation cannot exceed the size of the
+ section, so the value of MAX_ORDER should satisfy

- However for 4K, we choose a higher default value, 10 as opposed to 9, giving us
- 4M allocations matching the default size used by generic code.
+ MAX_ORDER + PAGE_SHIFT <= SECTION_SIZE_BITS
+
+ Don't change if unsure.

config UNMAP_KERNEL_AT_EL0
bool "Unmap kernel when running in userspace (aka \"KAISER\")" if EXPERT
--
2.35.1

2023-03-25 06:10:57

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v3 06/14] m68k: reword ARCH_FORCE_MAX_ORDER prompt and help text

From: "Mike Rapoport (IBM)" <[email protected]>

The prompt and help text of ARCH_FORCE_MAX_ORDER are not even close to
describe this configuration option.

Update both to actually describe what this option does.

Acked-by: Kirill A. Shutemov <[email protected]>
Acked-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
---
arch/m68k/Kconfig.cpu | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
index c9df6572133f..e530bc8f240f 100644
--- a/arch/m68k/Kconfig.cpu
+++ b/arch/m68k/Kconfig.cpu
@@ -398,21 +398,23 @@ config SINGLE_MEMORY_CHUNK
Say N if not sure.

config ARCH_FORCE_MAX_ORDER
- int "Maximum zone order" if ADVANCED
+ int "Order of maximal physically contiguous allocations" if ADVANCED
depends on !SINGLE_MEMORY_CHUNK
default "10"
help
- The kernel memory allocator divides physically contiguous memory
- blocks into "zones", where each zone is a power of two number of
- pages. This option selects the largest power of two that the kernel
- keeps in the memory allocator. If you need to allocate very large
- blocks of physically contiguous memory, then you may need to
- increase this value.
+ The kernel page allocator limits the size of maximal physically
+ contiguous allocations. The limit is called MAX_ORDER and it
+ defines the maximal power of two of number of pages that can be
+ allocated as a single contiguous block. This option allows
+ overriding the default setting when ability to allocate very
+ large blocks of physically contiguous memory is required.

For systems that have holes in their physical address space this
value also defines the minimal size of the hole that allows
freeing unused memory map.

+ Don't change if unsure.
+
config 060_WRITETHROUGH
bool "Use write-through caching for 68060 supervisor accesses"
depends on ADVANCED && M68060
--
2.35.1

2023-03-25 06:11:04

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v3 04/14] csky: drop ARCH_FORCE_MAX_ORDER

From: "Mike Rapoport (IBM)" <[email protected]>

The default value of ARCH_FORCE_MAX_ORDER matches the generic default
defined in the MM code, the architecture does not support huge pages, so
there is no need to keep ARCH_FORCE_MAX_ORDER option available.

Drop it.

Acked-by: Kirill A. Shutemov <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
---
arch/csky/Kconfig | 4 ----
1 file changed, 4 deletions(-)

diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig
index c694fac43bed..00379a843c37 100644
--- a/arch/csky/Kconfig
+++ b/arch/csky/Kconfig
@@ -332,10 +332,6 @@ config HIGHMEM
select KMAP_LOCAL
default y

-config ARCH_FORCE_MAX_ORDER
- int "Maximum zone order"
- default "10"
-
config DRAM_BASE
hex "DRAM start addr (the same with memory-section in dts)"
default 0x0
--
2.35.1

2023-03-25 06:11:13

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v3 07/14] nios2: reword ARCH_FORCE_MAX_ORDER prompt and help text

From: "Mike Rapoport (IBM)" <[email protected]>

The prompt and help text of ARCH_FORCE_MAX_ORDER are not even close to
describe this configuration option.

Update both to actually describe what this option does.

Acked-by: Kirill A. Shutemov <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
---
arch/nios2/Kconfig | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig
index 89708b95978c..fcaa6bbda3fc 100644
--- a/arch/nios2/Kconfig
+++ b/arch/nios2/Kconfig
@@ -45,16 +45,18 @@ menu "Kernel features"
source "kernel/Kconfig.hz"

config ARCH_FORCE_MAX_ORDER
- int "Maximum zone order"
+ int "Order of maximal physically contiguous allocations"
range 8 19
default "10"
help
- The kernel memory allocator divides physically contiguous memory
- blocks into "zones", where each zone is a power of two number of
- pages. This option selects the largest power of two that the kernel
- keeps in the memory allocator. If you need to allocate very large
- blocks of physically contiguous memory, then you may need to
- increase this value.
+ The kernel page allocator limits the size of maximal physically
+ contiguous allocations. The limit is called MAX_ORDER and it
+ defines the maximal power of two of number of pages that can be
+ allocated as a single contiguous block. This option allows
+ overriding the default setting when ability to allocate very
+ large blocks of physically contiguous memory is required.
+
+ Don't change if unsure.

endmenu

--
2.35.1

2023-03-25 06:11:26

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v3 08/14] nios2: drop ranges for definition of ARCH_FORCE_MAX_ORDER

From: "Mike Rapoport (IBM)" <[email protected]>

nios2 defines range for ARCH_FORCE_MAX_ORDER allowing MAX_ORDER
up to 19, which implies maximal contiguous allocation size of 2^19
pages or 2GiB.

Drop bogus definition of ranges for ARCH_FORCE_MAX_ORDER and leave it a
simple integer with sensible default.

Users that *really* need to change the value of ARCH_FORCE_MAX_ORDER
will be able to do so but they won't be mislead by the bogus ranges.

Acked-by: Kirill A. Shutemov <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
---
arch/nios2/Kconfig | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig
index fcaa6bbda3fc..e5936417d3cd 100644
--- a/arch/nios2/Kconfig
+++ b/arch/nios2/Kconfig
@@ -46,7 +46,6 @@ source "kernel/Kconfig.hz"

config ARCH_FORCE_MAX_ORDER
int "Order of maximal physically contiguous allocations"
- range 8 19
default "10"
help
The kernel page allocator limits the size of maximal physically
--
2.35.1

2023-03-25 06:11:36

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v3 09/14] powerpc: reword ARCH_FORCE_MAX_ORDER prompt and help text

From: "Mike Rapoport (IBM)" <[email protected]>

The prompt and help text of ARCH_FORCE_MAX_ORDER are not even close to
describe this configuration option.

Update both to actually describe what this option does.

Acked-by: Kirill A. Shutemov <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
---
arch/powerpc/Kconfig | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 24d56536b269..c0095bf795ca 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -896,7 +896,7 @@ config DATA_SHIFT
8M pages will be pinned.

config ARCH_FORCE_MAX_ORDER
- int "Maximum zone order"
+ int "Order of maximal physically contiguous allocations"
range 7 8 if PPC64 && PPC_64K_PAGES
default "8" if PPC64 && PPC_64K_PAGES
range 12 12 if PPC64 && !PPC_64K_PAGES
@@ -910,17 +910,19 @@ config ARCH_FORCE_MAX_ORDER
range 10 63
default "10"
help
- The kernel memory allocator divides physically contiguous memory
- blocks into "zones", where each zone is a power of two number of
- pages. This option selects the largest power of two that the kernel
- keeps in the memory allocator. If you need to allocate very large
- blocks of physically contiguous memory, then you may need to
- increase this value.
+ The kernel page allocator limits the size of maximal physically
+ contiguous allocations. The limit is called MAX_ORDER and it
+ defines the maximal power of two of number of pages that can be
+ allocated as a single contiguous block. This option allows
+ overriding the default setting when ability to allocate very
+ large blocks of physically contiguous memory is required.

The page size is not necessarily 4KB. For example, on 64-bit
systems, 64KB pages can be enabled via CONFIG_PPC_64K_PAGES. Keep
this in mind when choosing a value for this option.

+ Don't change if unsure.
+
config PPC_SUBPAGE_PROT
bool "Support setting protections for 4k subpages (subpage_prot syscall)"
default n
--
2.35.1

2023-03-25 06:12:01

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v3 11/14] sh: reword ARCH_FORCE_MAX_ORDER prompt and help text

From: "Mike Rapoport (IBM)" <[email protected]>

The prompt and help text of ARCH_FORCE_MAX_ORDER are not even close to
describe this configuration option.

Update both to actually describe what this option does.

Acked-by: Kirill A. Shutemov <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
---
arch/sh/mm/Kconfig | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
index 40271090bd7d..238b2772751e 100644
--- a/arch/sh/mm/Kconfig
+++ b/arch/sh/mm/Kconfig
@@ -19,7 +19,7 @@ config PAGE_OFFSET
default "0x00000000"

config ARCH_FORCE_MAX_ORDER
- int "Maximum zone order"
+ int "Order of maximal physically contiguous allocations"
range 8 63 if PAGE_SIZE_16KB
default "8" if PAGE_SIZE_16KB
range 6 63 if PAGE_SIZE_64KB
@@ -28,16 +28,18 @@ config ARCH_FORCE_MAX_ORDER
default "13" if !MMU
default "10"
help
- The kernel memory allocator divides physically contiguous memory
- blocks into "zones", where each zone is a power of two number of
- pages. This option selects the largest power of two that the kernel
- keeps in the memory allocator. If you need to allocate very large
- blocks of physically contiguous memory, then you may need to
- increase this value.
+ The kernel page allocator limits the size of maximal physically
+ contiguous allocations. The limit is called MAX_ORDER and it
+ defines the maximal power of two of number of pages that can be
+ allocated as a single contiguous block. This option allows
+ overriding the default setting when ability to allocate very
+ large blocks of physically contiguous memory is required.

The page size is not necessarily 4KB. Keep this in mind when
choosing a value for this option.

+ Don't change if unsure.
+
config MEMORY_START
hex "Physical memory start address"
default "0x08000000"
--
2.35.1

2023-03-25 06:12:15

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v3 10/14] powerpc: drop ranges for definition of ARCH_FORCE_MAX_ORDER

From: "Mike Rapoport (IBM)" <[email protected]>

PowerPC defines ranges for ARCH_FORCE_MAX_ORDER some of which are
insanely allowing MAX_ORDER up to 63, which implies maximal contiguous
allocation size of 2^63 pages.

Drop bogus definitions of ranges for ARCH_FORCE_MAX_ORDER and leave it a
simple integer with sensible defaults.

Users that *really* need to change the value of ARCH_FORCE_MAX_ORDER
will be able to do so but they won't be mislead by the bogus ranges.

Acked-by: Kirill A. Shutemov <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
---
arch/powerpc/Kconfig | 6 ------
1 file changed, 6 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index c0095bf795ca..419be4a71004 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -897,17 +897,11 @@ config DATA_SHIFT

config ARCH_FORCE_MAX_ORDER
int "Order of maximal physically contiguous allocations"
- range 7 8 if PPC64 && PPC_64K_PAGES
default "8" if PPC64 && PPC_64K_PAGES
- range 12 12 if PPC64 && !PPC_64K_PAGES
default "12" if PPC64 && !PPC_64K_PAGES
- range 8 63 if PPC32 && PPC_16K_PAGES
default "8" if PPC32 && PPC_16K_PAGES
- range 6 63 if PPC32 && PPC_64K_PAGES
default "6" if PPC32 && PPC_64K_PAGES
- range 4 63 if PPC32 && PPC_256K_PAGES
default "4" if PPC32 && PPC_256K_PAGES
- range 10 63
default "10"
help
The kernel page allocator limits the size of maximal physically
--
2.35.1

2023-03-25 06:12:39

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v3 12/14] sh: drop ranges for definition of ARCH_FORCE_MAX_ORDER

From: "Mike Rapoport (IBM)" <[email protected]>

sh defines insane ranges for ARCH_FORCE_MAX_ORDER allowing MAX_ORDER
up to 63, which implies maximal contiguous allocation size of 2^63
pages.

Drop bogus definitions of ranges for ARCH_FORCE_MAX_ORDER and leave it a
simple integer with sensible defaults.

Users that *really* need to change the value of ARCH_FORCE_MAX_ORDER
will be able to do so but they won't be mislead by the bogus ranges.

Acked-by: Kirill A. Shutemov <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
---
arch/sh/mm/Kconfig | 3 ---
1 file changed, 3 deletions(-)

diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
index 238b2772751e..511c17aede4a 100644
--- a/arch/sh/mm/Kconfig
+++ b/arch/sh/mm/Kconfig
@@ -20,11 +20,8 @@ config PAGE_OFFSET

config ARCH_FORCE_MAX_ORDER
int "Order of maximal physically contiguous allocations"
- range 8 63 if PAGE_SIZE_16KB
default "8" if PAGE_SIZE_16KB
- range 6 63 if PAGE_SIZE_64KB
default "6" if PAGE_SIZE_64KB
- range 10 63
default "13" if !MMU
default "10"
help
--
2.35.1

2023-03-25 06:12:49

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v3 13/14] sparc: reword ARCH_FORCE_MAX_ORDER prompt and help text

From: "Mike Rapoport (IBM)" <[email protected]>

The prompt and help text of ARCH_FORCE_MAX_ORDER are not even close to
describe this configuration option.

Update both to actually describe what this option does.

Acked-by: Kirill A. Shutemov <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
---
arch/sparc/Kconfig | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index e3242bf5a8df..959e43a1aaca 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -270,15 +270,17 @@ config ARCH_SPARSEMEM_DEFAULT
def_bool y if SPARC64

config ARCH_FORCE_MAX_ORDER
- int "Maximum zone order"
+ int "Order of maximal physically contiguous allocations"
default "12"
help
- The kernel memory allocator divides physically contiguous memory
- blocks into "zones", where each zone is a power of two number of
- pages. This option selects the largest power of two that the kernel
- keeps in the memory allocator. If you need to allocate very large
- blocks of physically contiguous memory, then you may need to
- increase this value.
+ The kernel page allocator limits the size of maximal physically
+ contiguous allocations. The limit is called MAX_ORDER and it
+ defines the maximal power of two of number of pages that can be
+ allocated as a single contiguous block. This option allows
+ overriding the default setting when ability to allocate very
+ large blocks of physically contiguous memory is required.
+
+ Don't change if unsure.

if SPARC64 || COMPILE_TEST
source "kernel/power/Kconfig"
--
2.35.1

2023-03-25 06:26:03

by Mike Rapoport

[permalink] [raw]
Subject: [PATCH v3 14/14] xtensa: reword ARCH_FORCE_MAX_ORDER prompt and help text

From: "Mike Rapoport (IBM)" <[email protected]>

The prompt and help text of ARCH_FORCE_MAX_ORDER are not even close to
describe this configuration option.

Update both to actually describe what this option does.

Reviewed-by: Max Filippov <[email protected]>
Acked-by: Kirill A. Shutemov <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
---
arch/xtensa/Kconfig | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 3eee334ba873..3c6e5471f025 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -772,15 +772,17 @@ config HIGHMEM
If unsure, say Y.

config ARCH_FORCE_MAX_ORDER
- int "Maximum zone order"
+ int "Order of maximal physically contiguous allocations"
default "10"
help
- The kernel memory allocator divides physically contiguous memory
- blocks into "zones", where each zone is a power of two number of
- pages. This option selects the largest power of two that the kernel
- keeps in the memory allocator. If you need to allocate very large
- blocks of physically contiguous memory, then you may need to
- increase this value.
+ The kernel page allocator limits the size of maximal physically
+ contiguous allocations. The limit is called MAX_ORDER and it
+ defines the maximal power of two of number of pages that can be
+ allocated as a single contiguous block. This option allows
+ overriding the default setting when ability to allocate very
+ large blocks of physically contiguous memory is required.
+
+ Don't change if unsure.

endmenu

--
2.35.1

2023-03-29 16:05:46

by Justin Forbes

[permalink] [raw]
Subject: Re: [PATCH v3 02/14] arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER

On Sat, Mar 25, 2023 at 1:09 AM Mike Rapoport <[email protected]> wrote:
>
> From: "Mike Rapoport (IBM)" <[email protected]>
>
> It is not a good idea to change fundamental parameters of core memory
> management. Having predefined ranges suggests that the values within
> those ranges are sensible, but one has to *really* understand
> implications of changing MAX_ORDER before actually amending it and
> ranges don't help here.
>
> Drop ranges in definition of ARCH_FORCE_MAX_ORDER and make its prompt
> visible only if EXPERT=y

I do not like suddenly hiding this behind EXPERT for a couple of
reasons. Most importantly, it will silently change the config for
users building with an old kernel config. If a user has for instance
"13" set and building with 4K pages, as is the current configuration
for Fedora and RHEL aarch64 builds, an oldconfig build will now set it
to 10 with no indication that it is doing so. And while I think that
10 is a fine default for many aarch64 users, there are valid reasons
for choosing other values. Putting this behind expert makes it much
less obvious that this is an option.

Justin

> Acked-by: Kirill A. Shutemov <[email protected]>
> Reviewed-by: Zi Yan <[email protected]>
> Signed-off-by: Mike Rapoport (IBM) <[email protected]>
> ---
> arch/arm64/Kconfig | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index e60baf7859d1..7324032af859 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1487,11 +1487,9 @@ config XEN
> # 16K | 27 | 14 | 13 | 11 |
> # 64K | 29 | 16 | 13 | 13 |
> config ARCH_FORCE_MAX_ORDER
> - int "Maximum zone order" if ARM64_4K_PAGES || ARM64_16K_PAGES
> + int "Maximum zone order" if EXPERT && (ARM64_4K_PAGES || ARM64_16K_PAGES)
> default "13" if ARM64_64K_PAGES
> - range 11 13 if ARM64_16K_PAGES
> default "11" if ARM64_16K_PAGES
> - range 10 15 if ARM64_4K_PAGES
> default "10"
> help
> The kernel memory allocator divides physically contiguous memory
> --
> 2.35.1
>
>

2023-04-04 07:24:43

by Mike Rapoport

[permalink] [raw]
Subject: Re: [PATCH v3 02/14] arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER

On Wed, Mar 29, 2023 at 10:55:37AM -0500, Justin Forbes wrote:
> On Sat, Mar 25, 2023 at 1:09 AM Mike Rapoport <[email protected]> wrote:
> >
> > From: "Mike Rapoport (IBM)" <[email protected]>
> >
> > It is not a good idea to change fundamental parameters of core memory
> > management. Having predefined ranges suggests that the values within
> > those ranges are sensible, but one has to *really* understand
> > implications of changing MAX_ORDER before actually amending it and
> > ranges don't help here.
> >
> > Drop ranges in definition of ARCH_FORCE_MAX_ORDER and make its prompt
> > visible only if EXPERT=y
>
> I do not like suddenly hiding this behind EXPERT for a couple of
> reasons. Most importantly, it will silently change the config for
> users building with an old kernel config. If a user has for instance
> "13" set and building with 4K pages, as is the current configuration
> for Fedora and RHEL aarch64 builds, an oldconfig build will now set it
> to 10 with no indication that it is doing so. And while I think that
> 10 is a fine default for many aarch64 users, there are valid reasons
> for choosing other values. Putting this behind expert makes it much
> less obvious that this is an option.

That's the idea of EXPERT, no?

This option was intended to allow allocation of huge pages for
architectures that had PMD_ORDER > MAX_ORDER and not to allow user to
select size of maximal physically contiguous allocation.

Changes to MAX_ORDER fundamentally change the behaviour of core mm and
unless users *really* know what they are doing there is no reason to choose
non-default values so hiding this option behind EXPERT seems totally
appropriate to me.

> Justin
>
> > Acked-by: Kirill A. Shutemov <[email protected]>
> > Reviewed-by: Zi Yan <[email protected]>
> > Signed-off-by: Mike Rapoport (IBM) <[email protected]>
> > ---
> > arch/arm64/Kconfig | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > index e60baf7859d1..7324032af859 100644
> > --- a/arch/arm64/Kconfig
> > +++ b/arch/arm64/Kconfig
> > @@ -1487,11 +1487,9 @@ config XEN
> > # 16K | 27 | 14 | 13 | 11 |
> > # 64K | 29 | 16 | 13 | 13 |
> > config ARCH_FORCE_MAX_ORDER
> > - int "Maximum zone order" if ARM64_4K_PAGES || ARM64_16K_PAGES
> > + int "Maximum zone order" if EXPERT && (ARM64_4K_PAGES || ARM64_16K_PAGES)
> > default "13" if ARM64_64K_PAGES
> > - range 11 13 if ARM64_16K_PAGES
> > default "11" if ARM64_16K_PAGES
> > - range 10 15 if ARM64_4K_PAGES
> > default "10"
> > help
> > The kernel memory allocator divides physically contiguous memory
> > --
> > 2.35.1
> >
> >

--
Sincerely yours,
Mike.

2023-04-04 11:55:12

by Justin Forbes

[permalink] [raw]
Subject: Re: [PATCH v3 02/14] arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER

On Tue, Apr 4, 2023 at 2:22 AM Mike Rapoport <[email protected]> wrote:
>
> On Wed, Mar 29, 2023 at 10:55:37AM -0500, Justin Forbes wrote:
> > On Sat, Mar 25, 2023 at 1:09 AM Mike Rapoport <[email protected]> wrote:
> > >
> > > From: "Mike Rapoport (IBM)" <[email protected]>
> > >
> > > It is not a good idea to change fundamental parameters of core memory
> > > management. Having predefined ranges suggests that the values within
> > > those ranges are sensible, but one has to *really* understand
> > > implications of changing MAX_ORDER before actually amending it and
> > > ranges don't help here.
> > >
> > > Drop ranges in definition of ARCH_FORCE_MAX_ORDER and make its prompt
> > > visible only if EXPERT=y
> >
> > I do not like suddenly hiding this behind EXPERT for a couple of
> > reasons. Most importantly, it will silently change the config for
> > users building with an old kernel config. If a user has for instance
> > "13" set and building with 4K pages, as is the current configuration
> > for Fedora and RHEL aarch64 builds, an oldconfig build will now set it
> > to 10 with no indication that it is doing so. And while I think that
> > 10 is a fine default for many aarch64 users, there are valid reasons
> > for choosing other values. Putting this behind expert makes it much
> > less obvious that this is an option.
>
> That's the idea of EXPERT, no?
>
> This option was intended to allow allocation of huge pages for
> architectures that had PMD_ORDER > MAX_ORDER and not to allow user to
> select size of maximal physically contiguous allocation.
>
> Changes to MAX_ORDER fundamentally change the behaviour of core mm and
> unless users *really* know what they are doing there is no reason to choose
> non-default values so hiding this option behind EXPERT seems totally
> appropriate to me.

It sounds nice in theory. In practice. EXPERT hides too much. When you
flip expert, you expose over a 175ish new config options which are
hidden behind EXPERT. You don't have to know what you are doing just
with the MAX_ORDER, but a whole bunch more as well. If everyone were
already running 10, this might be less of a problem. At least Fedora
and RHEL are running 13 for 4K pages on aarch64. This was not some
accidental choice, we had to carry a patch to even allow it for a
while. If this does go in as is, we will likely just carry a patch to
remove the "if EXPERT", but that is a bit of a disservice to users who
might be trying to debug something else upstream, bisecting upstream
kernels or testing a patch. In those cases, people tend to use
pristine upstream sources without distro patches to verify, and they
tend to use their existing configs. With this change, their MAX_ORDER
will drop to 10 from 13 silently. That can look like a different
issue enough to ruin a bisect or have them give bad feedback on a
patch because it introduces a "regression" which is not a regression
at all, but a config change they couldn't see.

>
> > Justin
> >
> > > Acked-by: Kirill A. Shutemov <[email protected]>
> > > Reviewed-by: Zi Yan <[email protected]>
> > > Signed-off-by: Mike Rapoport (IBM) <[email protected]>
> > > ---
> > > arch/arm64/Kconfig | 4 +---
> > > 1 file changed, 1 insertion(+), 3 deletions(-)
> > >
> > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > > index e60baf7859d1..7324032af859 100644
> > > --- a/arch/arm64/Kconfig
> > > +++ b/arch/arm64/Kconfig
> > > @@ -1487,11 +1487,9 @@ config XEN
> > > # 16K | 27 | 14 | 13 | 11 |
> > > # 64K | 29 | 16 | 13 | 13 |
> > > config ARCH_FORCE_MAX_ORDER
> > > - int "Maximum zone order" if ARM64_4K_PAGES || ARM64_16K_PAGES
> > > + int "Maximum zone order" if EXPERT && (ARM64_4K_PAGES || ARM64_16K_PAGES)
> > > default "13" if ARM64_64K_PAGES
> > > - range 11 13 if ARM64_16K_PAGES
> > > default "11" if ARM64_16K_PAGES
> > > - range 10 15 if ARM64_4K_PAGES
> > > default "10"
> > > help
> > > The kernel memory allocator divides physically contiguous memory
> > > --
> > > 2.35.1
> > >
> > >
>
> --
> Sincerely yours,
> Mike.
>

2023-04-12 17:38:52

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH v3 02/14] arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER

On Tue, Apr 04, 2023 at 06:50:01AM -0500, Justin Forbes wrote:
> On Tue, Apr 4, 2023 at 2:22 AM Mike Rapoport <[email protected]> wrote:
> > On Wed, Mar 29, 2023 at 10:55:37AM -0500, Justin Forbes wrote:
> > > On Sat, Mar 25, 2023 at 1:09 AM Mike Rapoport <[email protected]> wrote:
> > > >
> > > > From: "Mike Rapoport (IBM)" <[email protected]>
> > > >
> > > > It is not a good idea to change fundamental parameters of core memory
> > > > management. Having predefined ranges suggests that the values within
> > > > those ranges are sensible, but one has to *really* understand
> > > > implications of changing MAX_ORDER before actually amending it and
> > > > ranges don't help here.
> > > >
> > > > Drop ranges in definition of ARCH_FORCE_MAX_ORDER and make its prompt
> > > > visible only if EXPERT=y
> > >
> > > I do not like suddenly hiding this behind EXPERT for a couple of
> > > reasons. Most importantly, it will silently change the config for
> > > users building with an old kernel config. If a user has for instance
> > > "13" set and building with 4K pages, as is the current configuration
> > > for Fedora and RHEL aarch64 builds, an oldconfig build will now set it
> > > to 10 with no indication that it is doing so. And while I think that
> > > 10 is a fine default for many aarch64 users, there are valid reasons
> > > for choosing other values. Putting this behind expert makes it much
> > > less obvious that this is an option.
> >
> > That's the idea of EXPERT, no?
> >
> > This option was intended to allow allocation of huge pages for
> > architectures that had PMD_ORDER > MAX_ORDER and not to allow user to
> > select size of maximal physically contiguous allocation.
> >
> > Changes to MAX_ORDER fundamentally change the behaviour of core mm and
> > unless users *really* know what they are doing there is no reason to choose
> > non-default values so hiding this option behind EXPERT seems totally
> > appropriate to me.
>
> It sounds nice in theory. In practice. EXPERT hides too much. When you
> flip expert, you expose over a 175ish new config options which are
> hidden behind EXPERT. You don't have to know what you are doing just
> with the MAX_ORDER, but a whole bunch more as well. If everyone were
> already running 10, this might be less of a problem. At least Fedora
> and RHEL are running 13 for 4K pages on aarch64. This was not some
> accidental choice, we had to carry a patch to even allow it for a
> while. If this does go in as is, we will likely just carry a patch to
> remove the "if EXPERT", but that is a bit of a disservice to users who
> might be trying to debug something else upstream, bisecting upstream
> kernels or testing a patch. In those cases, people tend to use
> pristine upstream sources without distro patches to verify, and they
> tend to use their existing configs. With this change, their MAX_ORDER
> will drop to 10 from 13 silently. That can look like a different
> issue enough to ruin a bisect or have them give bad feedback on a
> patch because it introduces a "regression" which is not a regression
> at all, but a config change they couldn't see.

If we remove EXPERT (as prior to this patch), I'd rather keep the ranges
and avoid having to explain to people why some random MAX_ORDER doesn't
build (keeping the range would also make sense for randconfig, not sure
we got to any conclusion there).

--
Catalin

2023-04-18 22:16:51

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH v3 02/14] arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER

On Wed, 12 Apr 2023 18:27:08 +0100 Catalin Marinas <[email protected]> wrote:

> > It sounds nice in theory. In practice. EXPERT hides too much. When you
> > flip expert, you expose over a 175ish new config options which are
> > hidden behind EXPERT. You don't have to know what you are doing just
> > with the MAX_ORDER, but a whole bunch more as well. If everyone were
> > already running 10, this might be less of a problem. At least Fedora
> > and RHEL are running 13 for 4K pages on aarch64. This was not some
> > accidental choice, we had to carry a patch to even allow it for a
> > while. If this does go in as is, we will likely just carry a patch to
> > remove the "if EXPERT", but that is a bit of a disservice to users who
> > might be trying to debug something else upstream, bisecting upstream
> > kernels or testing a patch. In those cases, people tend to use
> > pristine upstream sources without distro patches to verify, and they
> > tend to use their existing configs. With this change, their MAX_ORDER
> > will drop to 10 from 13 silently. That can look like a different
> > issue enough to ruin a bisect or have them give bad feedback on a
> > patch because it introduces a "regression" which is not a regression
> > at all, but a config change they couldn't see.
>
> If we remove EXPERT (as prior to this patch), I'd rather keep the ranges
> and avoid having to explain to people why some random MAX_ORDER doesn't
> build (keeping the range would also make sense for randconfig, not sure
> we got to any conclusion there).

Well this doesn't seem to have got anywhere. I think I'll send the
patchset into Linus for the next merge window as-is. Please let's take
a look at this Kconfig presentation issue during the following -rc
cycle.

2023-04-19 08:57:38

by Mike Rapoport

[permalink] [raw]
Subject: Re: [PATCH v3 05/14] ia64: don't allow users to override ARCH_FORCE_MAX_ORDER

On Sat, Mar 25, 2023 at 02:38:15PM +0800, Kefeng Wang wrote:
>
>
> On 2023/3/25 14:08, Mike Rapoport wrote:
> > From: "Mike Rapoport (IBM)" <[email protected]>
> >
> > It is enough to keep default values for base and huge pages without
> > letting users to override ARCH_FORCE_MAX_ORDER.
> >
> > Drop the prompt to make the option unvisible in *config.
> >
> > Acked-by: Kirill A. Shutemov <[email protected]>
> > Reviewed-by: Zi Yan <[email protected]>
> > Signed-off-by: Mike Rapoport (IBM) <[email protected]>
> > ---
> > arch/ia64/Kconfig | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
> > index 0d2f41fa56ee..b61437cae162 100644
> > --- a/arch/ia64/Kconfig
> > +++ b/arch/ia64/Kconfig
> > @@ -202,8 +202,7 @@ config IA64_CYCLONE
> > If you're unsure, answer N.
> > config ARCH_FORCE_MAX_ORDER
> > - int "MAX_ORDER (10 - 16)" if !HUGETLB_PAGE
> > - range 10 16 if !HUGETLB_PAGE
> > + int
> > default "16" if HUGETLB_PAGE
> > default "10"
>
> It seems that we could drop the following part?

ia64 can have 64k pages, so with MAX_ORDER==16 we'd need at least 32 bits
for section size

> diff --git a/arch/ia64/include/asm/sparsemem.h
> b/arch/ia64/include/asm/sparsemem.h
> index a58f8b466d96..18187551b183 100644
> --- a/arch/ia64/include/asm/sparsemem.h
> +++ b/arch/ia64/include/asm/sparsemem.h
> @@ -11,11 +11,6 @@
>
> #define SECTION_SIZE_BITS (30)
> #define MAX_PHYSMEM_BITS (50)
> -#ifdef CONFIG_ARCH_FORCE_MAX_ORDER
> -#if (CONFIG_ARCH_FORCE_MAX_ORDER + PAGE_SHIFT > SECTION_SIZE_BITS)
> -#undef SECTION_SIZE_BITS
> -#define SECTION_SIZE_BITS (CONFIG_ARCH_FORCE_MAX_ORDER + PAGE_SHIFT)
> -#endif
> #endif
>

--
Sincerely yours,
Mike.

2023-04-19 11:08:24

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH v3 02/14] arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER

On Tue, Apr 18, 2023 at 03:05:57PM -0700, Andrew Morton wrote:
> On Wed, 12 Apr 2023 18:27:08 +0100 Catalin Marinas <[email protected]> wrote:
> > > It sounds nice in theory. In practice. EXPERT hides too much. When you
> > > flip expert, you expose over a 175ish new config options which are
> > > hidden behind EXPERT. You don't have to know what you are doing just
> > > with the MAX_ORDER, but a whole bunch more as well. If everyone were
> > > already running 10, this might be less of a problem. At least Fedora
> > > and RHEL are running 13 for 4K pages on aarch64. This was not some
> > > accidental choice, we had to carry a patch to even allow it for a
> > > while. If this does go in as is, we will likely just carry a patch to
> > > remove the "if EXPERT", but that is a bit of a disservice to users who
> > > might be trying to debug something else upstream, bisecting upstream
> > > kernels or testing a patch. In those cases, people tend to use
> > > pristine upstream sources without distro patches to verify, and they
> > > tend to use their existing configs. With this change, their MAX_ORDER
> > > will drop to 10 from 13 silently. That can look like a different
> > > issue enough to ruin a bisect or have them give bad feedback on a
> > > patch because it introduces a "regression" which is not a regression
> > > at all, but a config change they couldn't see.
> >
> > If we remove EXPERT (as prior to this patch), I'd rather keep the ranges
> > and avoid having to explain to people why some random MAX_ORDER doesn't
> > build (keeping the range would also make sense for randconfig, not sure
> > we got to any conclusion there).
>
> Well this doesn't seem to have got anywhere. I think I'll send the
> patchset into Linus for the next merge window as-is. Please let's take
> a look at this Kconfig presentation issue during the following -rc
> cycle.

That's fine by me. I have a slight preference to drop EXPERT and keep
the ranges in, especially if it affects current distro kernels. Debian
seems to enable EXPERT already in their arm64 kernel config but I'm not
sure about the Fedora or other distro kernels. If they don't, we can
fix/revert this Kconfig entry once the merging window is closed.

--
Catalin

2023-04-19 11:39:17

by Justin Forbes

[permalink] [raw]
Subject: Re: [PATCH v3 02/14] arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER

On Wed, Apr 19, 2023 at 6:12 AM Catalin Marinas <[email protected]> wrote:
>
> On Tue, Apr 18, 2023 at 03:05:57PM -0700, Andrew Morton wrote:
> > On Wed, 12 Apr 2023 18:27:08 +0100 Catalin Marinas <[email protected]> wrote:
> > > > It sounds nice in theory. In practice. EXPERT hides too much. When you
> > > > flip expert, you expose over a 175ish new config options which are
> > > > hidden behind EXPERT. You don't have to know what you are doing just
> > > > with the MAX_ORDER, but a whole bunch more as well. If everyone were
> > > > already running 10, this might be less of a problem. At least Fedora
> > > > and RHEL are running 13 for 4K pages on aarch64. This was not some
> > > > accidental choice, we had to carry a patch to even allow it for a
> > > > while. If this does go in as is, we will likely just carry a patch to
> > > > remove the "if EXPERT", but that is a bit of a disservice to users who
> > > > might be trying to debug something else upstream, bisecting upstream
> > > > kernels or testing a patch. In those cases, people tend to use
> > > > pristine upstream sources without distro patches to verify, and they
> > > > tend to use their existing configs. With this change, their MAX_ORDER
> > > > will drop to 10 from 13 silently. That can look like a different
> > > > issue enough to ruin a bisect or have them give bad feedback on a
> > > > patch because it introduces a "regression" which is not a regression
> > > > at all, but a config change they couldn't see.
> > >
> > > If we remove EXPERT (as prior to this patch), I'd rather keep the ranges
> > > and avoid having to explain to people why some random MAX_ORDER doesn't
> > > build (keeping the range would also make sense for randconfig, not sure
> > > we got to any conclusion there).
> >
> > Well this doesn't seem to have got anywhere. I think I'll send the
> > patchset into Linus for the next merge window as-is. Please let's take
> > a look at this Kconfig presentation issue during the following -rc
> > cycle.
>
> That's fine by me. I have a slight preference to drop EXPERT and keep
> the ranges in, especially if it affects current distro kernels. Debian
> seems to enable EXPERT already in their arm64 kernel config but I'm not
> sure about the Fedora or other distro kernels. If they don't, we can
> fix/revert this Kconfig entry once the merging window is closed.

Fedora and RHEL do not enable EXPERT already.

Justin

2023-04-25 16:19:46

by Justin Forbes

[permalink] [raw]
Subject: Re: [PATCH v3 02/14] arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER

On Tue, Apr 18, 2023 at 5:22 PM Andrew Morton <[email protected]> wrote:
>
> On Wed, 12 Apr 2023 18:27:08 +0100 Catalin Marinas <[email protected]> wrote:
>
> > > It sounds nice in theory. In practice. EXPERT hides too much. When you
> > > flip expert, you expose over a 175ish new config options which are
> > > hidden behind EXPERT. You don't have to know what you are doing just
> > > with the MAX_ORDER, but a whole bunch more as well. If everyone were
> > > already running 10, this might be less of a problem. At least Fedora
> > > and RHEL are running 13 for 4K pages on aarch64. This was not some
> > > accidental choice, we had to carry a patch to even allow it for a
> > > while. If this does go in as is, we will likely just carry a patch to
> > > remove the "if EXPERT", but that is a bit of a disservice to users who
> > > might be trying to debug something else upstream, bisecting upstream
> > > kernels or testing a patch. In those cases, people tend to use
> > > pristine upstream sources without distro patches to verify, and they
> > > tend to use their existing configs. With this change, their MAX_ORDER
> > > will drop to 10 from 13 silently. That can look like a different
> > > issue enough to ruin a bisect or have them give bad feedback on a
> > > patch because it introduces a "regression" which is not a regression
> > > at all, but a config change they couldn't see.
> >
> > If we remove EXPERT (as prior to this patch), I'd rather keep the ranges
> > and avoid having to explain to people why some random MAX_ORDER doesn't
> > build (keeping the range would also make sense for randconfig, not sure
> > we got to any conclusion there).
>
> Well this doesn't seem to have got anywhere. I think I'll send the
> patchset into Linus for the next merge window as-is. Please let's take
> a look at this Kconfig presentation issue during the following -rc
> cycle.

Well, I am very sorry to see this going in as is. It will silently
change people building with oldconfig, and anyone not paying attention
will not notice until an issue is hit where "it worked before, and my
config hasn't changed". If EXPERT is unset, there is no notification,
just a changed behavior. While it would be easy for me to carry a
patch dropping the if EXPERT, it will not help any users building on
upstream with our configs, whether for their own regular use, or while
trying to debug other issues, I expect it will result in a reasonable
amount of frustration from users trying to do the right thing and
bisect or test patches upstream.

Justin

2023-04-27 13:44:04

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH v3 02/14] arm64: drop ranges in definition of ARCH_FORCE_MAX_ORDER

On Tue, Apr 25, 2023 at 11:09:58AM -0500, Justin Forbes wrote:
> On Tue, Apr 18, 2023 at 5:22 PM Andrew Morton <[email protected]> wrote:
> > On Wed, 12 Apr 2023 18:27:08 +0100 Catalin Marinas <[email protected]> wrote:
> > > > It sounds nice in theory. In practice. EXPERT hides too much. When you
> > > > flip expert, you expose over a 175ish new config options which are
> > > > hidden behind EXPERT. You don't have to know what you are doing just
> > > > with the MAX_ORDER, but a whole bunch more as well. If everyone were
> > > > already running 10, this might be less of a problem. At least Fedora
> > > > and RHEL are running 13 for 4K pages on aarch64. This was not some
> > > > accidental choice, we had to carry a patch to even allow it for a
> > > > while. If this does go in as is, we will likely just carry a patch to
> > > > remove the "if EXPERT", but that is a bit of a disservice to users who
> > > > might be trying to debug something else upstream, bisecting upstream
> > > > kernels or testing a patch. In those cases, people tend to use
> > > > pristine upstream sources without distro patches to verify, and they
> > > > tend to use their existing configs. With this change, their MAX_ORDER
> > > > will drop to 10 from 13 silently. That can look like a different
> > > > issue enough to ruin a bisect or have them give bad feedback on a
> > > > patch because it introduces a "regression" which is not a regression
> > > > at all, but a config change they couldn't see.
> > >
> > > If we remove EXPERT (as prior to this patch), I'd rather keep the ranges
> > > and avoid having to explain to people why some random MAX_ORDER doesn't
> > > build (keeping the range would also make sense for randconfig, not sure
> > > we got to any conclusion there).
> >
> > Well this doesn't seem to have got anywhere. I think I'll send the
> > patchset into Linus for the next merge window as-is. Please let's take
> > a look at this Kconfig presentation issue during the following -rc
> > cycle.
>
> Well, I am very sorry to see this going in as is. It will silently
> change people building with oldconfig, and anyone not paying attention
> will not notice until an issue is hit where "it worked before, and my
> config hasn't changed". If EXPERT is unset, there is no notification,
> just a changed behavior. While it would be easy for me to carry a
> patch dropping the if EXPERT, it will not help any users building on
> upstream with our configs, whether for their own regular use, or while
> trying to debug other issues, I expect it will result in a reasonable
> amount of frustration from users trying to do the right thing and
> bisect or test patches upstream.

As I said in a previous reply, I'm fine with reverting this commit if it
breaks existing configs. It's only that Andrew had already queued it in
his tree but we have time until the final 6.4 kernel is released.

That said, would you mind sending a patch reverting it (if removing
EXPERT, I'd like to keep the ranges)? ;)

Thanks.

--
Catalin