* [PATCH 1/8] S390: Remove sentinel elem from ctl_table arrays
2023-09-06 10:03 [PATCH 0/8] sysctl: Remove sentinel elements from arch Joel Granados via B4 Relay
@ 2023-09-06 10:03 ` Joel Granados via B4 Relay
2023-09-07 8:51 ` Heiko Carstens
2023-09-07 9:08 ` Alexander Gordeev
2023-09-06 10:03 ` [PATCH 2/8] arm: " Joel Granados via B4 Relay
` (6 subsequent siblings)
7 siblings, 2 replies; 16+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-06 10:03 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Iurii Zaikin,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Gerald Schaefer,
Russell King, Catalin Marinas, Will Deacon, Mark Rutland,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Andy Lutomirski, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Guo Ren
Cc: linux-fsdevel, linux-s390, linux-kernel, linux-arm-kernel,
linux-riscv, linuxppc-dev, linux-ia64, linux-csky, Joel Granados
From: Joel Granados <j.granados@samsung.com>
This commit comes at the tail end of a greater effort to remove the
empty elements at the end of the ctl_table arrays (sentinels) which
will reduce the overall build time size of the kernel and run time
memory bloat by ~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
Remove the sentinel element from appldata_table, s390dbf_table,
topology_ctl_table, cmm_table and page_table_sysctl. Reduced the
memory allocation in appldata_register_ops by 1 effectively removing the
sentinel from ops->ctl_table.
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
arch/s390/appldata/appldata_base.c | 6 ++----
arch/s390/kernel/debug.c | 3 +--
arch/s390/kernel/topology.c | 3 +--
arch/s390/mm/cmm.c | 3 +--
arch/s390/mm/pgalloc.c | 3 +--
5 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 3b0994625652..872a644b1fd1 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -62,8 +62,7 @@ static struct ctl_table appldata_table[] = {
.procname = "interval",
.mode = S_IRUGO | S_IWUSR,
.proc_handler = appldata_interval_handler,
- },
- { },
+ }
};
/*
@@ -351,8 +350,7 @@ int appldata_register_ops(struct appldata_ops *ops)
if (ops->size > APPLDATA_MAX_REC_SIZE)
return -EINVAL;
- /* The last entry must be an empty one */
- ops->ctl_table = kcalloc(2, sizeof(struct ctl_table), GFP_KERNEL);
+ ops->ctl_table = kcalloc(1, sizeof(struct ctl_table), GFP_KERNEL);
if (!ops->ctl_table)
return -ENOMEM;
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index a85e0c3e7027..150e2bfff0b3 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -977,8 +977,7 @@ static struct ctl_table s390dbf_table[] = {
.maxlen = sizeof(int),
.mode = S_IRUGO | S_IWUSR,
.proc_handler = s390dbf_procactive,
- },
- { }
+ }
};
static struct ctl_table_header *s390dbf_sysctl_header;
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index 68adf1de8888..9dcfac416669 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -635,8 +635,7 @@ static struct ctl_table topology_ctl_table[] = {
.procname = "topology",
.mode = 0644,
.proc_handler = topology_ctl_handler,
- },
- { },
+ }
};
static int __init topology_init(void)
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index f47515313226..8937aa7090b3 100644
--- a/arch/s390/mm/cmm.c
+++ b/arch/s390/mm/cmm.c
@@ -331,8 +331,7 @@ static struct ctl_table cmm_table[] = {
.procname = "cmm_timeout",
.mode = 0644,
.proc_handler = cmm_timeout_handler,
- },
- { }
+ }
};
#ifdef CONFIG_CMM_IUCV
diff --git a/arch/s390/mm/pgalloc.c b/arch/s390/mm/pgalloc.c
index 07fc660a24aa..e8cecd31715f 100644
--- a/arch/s390/mm/pgalloc.c
+++ b/arch/s390/mm/pgalloc.c
@@ -29,8 +29,7 @@ static struct ctl_table page_table_sysctl[] = {
.proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE,
- },
- { }
+ }
};
static int __init page_table_register_sysctl(void)
--
2.30.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 1/8] S390: Remove sentinel elem from ctl_table arrays
2023-09-06 10:03 ` [PATCH 1/8] S390: Remove sentinel elem from ctl_table arrays Joel Granados via B4 Relay
@ 2023-09-07 8:51 ` Heiko Carstens
2023-09-07 9:08 ` Alexander Gordeev
1 sibling, 0 replies; 16+ messages in thread
From: Heiko Carstens @ 2023-09-07 8:51 UTC (permalink / raw)
To: j.granados
Cc: Luis Chamberlain, willy, josh, Kees Cook, Iurii Zaikin,
Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
Sven Schnelle, Gerald Schaefer, Russell King, Catalin Marinas,
Will Deacon, Mark Rutland, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Andy Lutomirski, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Guo Ren,
linux-fsdevel, linux-s390, linux-kernel, linux-arm-kernel,
linux-riscv, linuxppc-dev, linux-ia64, linux-csky
On Wed, Sep 06, 2023 at 12:03:22PM +0200, Joel Granados via B4 Relay wrote:
> From: Joel Granados <j.granados@samsung.com>
>
> This commit comes at the tail end of a greater effort to remove the
> empty elements at the end of the ctl_table arrays (sentinels) which
> will reduce the overall build time size of the kernel and run time
> memory bloat by ~64 bytes per sentinel (further information Link :
> https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
>
> Remove the sentinel element from appldata_table, s390dbf_table,
> topology_ctl_table, cmm_table and page_table_sysctl. Reduced the
> memory allocation in appldata_register_ops by 1 effectively removing the
> sentinel from ops->ctl_table.
>
> Signed-off-by: Joel Granados <j.granados@samsung.com>
> ---
> arch/s390/appldata/appldata_base.c | 6 ++----
> arch/s390/kernel/debug.c | 3 +--
> arch/s390/kernel/topology.c | 3 +--
> arch/s390/mm/cmm.c | 3 +--
> arch/s390/mm/pgalloc.c | 3 +--
> 5 files changed, 6 insertions(+), 12 deletions(-)
Acked-by: Heiko Carstens <hca@linux.ibm.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/8] S390: Remove sentinel elem from ctl_table arrays
2023-09-06 10:03 ` [PATCH 1/8] S390: Remove sentinel elem from ctl_table arrays Joel Granados via B4 Relay
2023-09-07 8:51 ` Heiko Carstens
@ 2023-09-07 9:08 ` Alexander Gordeev
1 sibling, 0 replies; 16+ messages in thread
From: Alexander Gordeev @ 2023-09-07 9:08 UTC (permalink / raw)
To: j.granados
Cc: Luis Chamberlain, willy, josh, Kees Cook, Iurii Zaikin,
Heiko Carstens, Vasily Gorbik, Christian Borntraeger,
Sven Schnelle, Gerald Schaefer, Russell King, Catalin Marinas,
Will Deacon, Mark Rutland, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Andy Lutomirski, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Guo Ren,
linux-fsdevel, linux-s390, linux-kernel, linux-arm-kernel,
linux-riscv, linuxppc-dev, linux-ia64, linux-csky
On Wed, Sep 06, 2023 at 12:03:22PM +0200, Joel Granados via B4 Relay wrote:
> From: Joel Granados <j.granados@samsung.com>
>
> This commit comes at the tail end of a greater effort to remove the
> empty elements at the end of the ctl_table arrays (sentinels) which
> will reduce the overall build time size of the kernel and run time
> memory bloat by ~64 bytes per sentinel (further information Link :
> https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
>
> Remove the sentinel element from appldata_table, s390dbf_table,
> topology_ctl_table, cmm_table and page_table_sysctl. Reduced the
> memory allocation in appldata_register_ops by 1 effectively removing the
> sentinel from ops->ctl_table.
>
> Signed-off-by: Joel Granados <j.granados@samsung.com>
> ---
> arch/s390/appldata/appldata_base.c | 6 ++----
> arch/s390/kernel/debug.c | 3 +--
> arch/s390/kernel/topology.c | 3 +--
> arch/s390/mm/cmm.c | 3 +--
> arch/s390/mm/pgalloc.c | 3 +--
> 5 files changed, 6 insertions(+), 12 deletions(-)
Tested-by: Alexander Gordeev <agordeev@linux.ibm.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/8] arm: Remove sentinel elem from ctl_table arrays
2023-09-06 10:03 [PATCH 0/8] sysctl: Remove sentinel elements from arch Joel Granados via B4 Relay
2023-09-06 10:03 ` [PATCH 1/8] S390: Remove sentinel elem from ctl_table arrays Joel Granados via B4 Relay
@ 2023-09-06 10:03 ` Joel Granados via B4 Relay
2023-09-06 10:03 ` [PATCH 3/8] arch/x86: " Joel Granados via B4 Relay
` (5 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-06 10:03 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Iurii Zaikin,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Gerald Schaefer,
Russell King, Catalin Marinas, Will Deacon, Mark Rutland,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Andy Lutomirski, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Guo Ren
Cc: linux-fsdevel, linux-s390, linux-kernel, linux-arm-kernel,
linux-riscv, linuxppc-dev, linux-ia64, linux-csky, Joel Granados
From: Joel Granados <j.granados@samsung.com>
This commit comes at the tail end of a greater effort to remove the
empty elements at the end of the ctl_table arrays (sentinels) which
will reduce the overall build time size of the kernel and run time
memory bloat by ~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
Removed the sentinel as well as the explicit size from ctl_isa_vars. The
size is redundant as the initialization sets it.
Changed insn_emulation->sysctl from a 2 element array of struct
ctl_table to a simple struct. This has no consequence for the sysctl
registration as it is forwarded as a pointer.
Removed sentinel from sve_defatul_vl_table, sme_default_vl_table,
tagged_addr_sysctl_table and armv8_pmu_sysctl_table.
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
arch/arm/kernel/isa.c | 4 ++--
arch/arm64/kernel/armv8_deprecated.c | 8 +++-----
arch/arm64/kernel/fpsimd.c | 6 ++----
arch/arm64/kernel/process.c | 3 +--
drivers/perf/arm_pmuv3.c | 3 +--
5 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/arch/arm/kernel/isa.c b/arch/arm/kernel/isa.c
index 20218876bef2..0b9c28077092 100644
--- a/arch/arm/kernel/isa.c
+++ b/arch/arm/kernel/isa.c
@@ -16,7 +16,7 @@
static unsigned int isa_membase, isa_portbase, isa_portshift;
-static struct ctl_table ctl_isa_vars[4] = {
+static struct ctl_table ctl_isa_vars[] = {
{
.procname = "membase",
.data = &isa_membase,
@@ -35,7 +35,7 @@ static struct ctl_table ctl_isa_vars[4] = {
.maxlen = sizeof(isa_portshift),
.mode = 0444,
.proc_handler = proc_dointvec,
- }, {}
+ }
};
static struct ctl_table_header *isa_sysctl_header;
diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c
index e459cfd33711..dd6ce86d4332 100644
--- a/arch/arm64/kernel/armv8_deprecated.c
+++ b/arch/arm64/kernel/armv8_deprecated.c
@@ -52,10 +52,8 @@ struct insn_emulation {
int min;
int max;
- /*
- * sysctl for this emulation + a sentinal entry.
- */
- struct ctl_table sysctl[2];
+ /* sysctl for this emulation */
+ struct ctl_table sysctl;
};
#define ARM_OPCODE_CONDTEST_FAIL 0
@@ -558,7 +556,7 @@ static void __init register_insn_emulation(struct insn_emulation *insn)
update_insn_emulation_mode(insn, INSN_UNDEF);
if (insn->status != INSN_UNAVAILABLE) {
- sysctl = &insn->sysctl[0];
+ sysctl = &insn->sysctl;
sysctl->mode = 0644;
sysctl->maxlen = sizeof(int);
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 91e44ac7150f..db3ad1ba8272 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -588,8 +588,7 @@ static struct ctl_table sve_default_vl_table[] = {
.mode = 0644,
.proc_handler = vec_proc_do_default_vl,
.extra1 = &vl_info[ARM64_VEC_SVE],
- },
- { }
+ }
};
static int __init sve_sysctl_init(void)
@@ -612,8 +611,7 @@ static struct ctl_table sme_default_vl_table[] = {
.mode = 0644,
.proc_handler = vec_proc_do_default_vl,
.extra1 = &vl_info[ARM64_VEC_SME],
- },
- { }
+ }
};
static int __init sme_sysctl_init(void)
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 0fcc4eb1a7ab..48861cdc3aae 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -723,8 +723,7 @@ static struct ctl_table tagged_addr_sysctl_table[] = {
.proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE,
- },
- { }
+ }
};
static int __init tagged_addr_init(void)
diff --git a/drivers/perf/arm_pmuv3.c b/drivers/perf/arm_pmuv3.c
index e5a2ac4155f6..c4aa6a8d1b05 100644
--- a/drivers/perf/arm_pmuv3.c
+++ b/drivers/perf/arm_pmuv3.c
@@ -1172,8 +1172,7 @@ static struct ctl_table armv8_pmu_sysctl_table[] = {
.proc_handler = armv8pmu_proc_user_access_handler,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE,
- },
- { }
+ }
};
static void armv8_pmu_register_sysctl_table(void)
--
2.30.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 3/8] arch/x86: Remove sentinel elem from ctl_table arrays
2023-09-06 10:03 [PATCH 0/8] sysctl: Remove sentinel elements from arch Joel Granados via B4 Relay
2023-09-06 10:03 ` [PATCH 1/8] S390: Remove sentinel elem from ctl_table arrays Joel Granados via B4 Relay
2023-09-06 10:03 ` [PATCH 2/8] arm: " Joel Granados via B4 Relay
@ 2023-09-06 10:03 ` Joel Granados via B4 Relay
2023-09-06 14:45 ` Dave Hansen
2023-09-06 10:03 ` [PATCH 4/8] x86 vdso: rm sentinel element from ctl_table array Joel Granados via B4 Relay
` (4 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-06 10:03 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Iurii Zaikin,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Gerald Schaefer,
Russell King, Catalin Marinas, Will Deacon, Mark Rutland,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Andy Lutomirski, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Guo Ren
Cc: linux-fsdevel, linux-s390, linux-kernel, linux-arm-kernel,
linux-riscv, linuxppc-dev, linux-ia64, linux-csky, Joel Granados
From: Joel Granados <j.granados@samsung.com>
This commit comes at the tail end of a greater effort to remove the
empty elements at the end of the ctl_table arrays (sentinels) which
will reduce the overall build time size of the kernel and run time
memory bloat by ~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
Remove sentinel element from sld_sysctl and itmt_kern_table.
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
arch/x86/kernel/cpu/intel.c | 3 +--
arch/x86/kernel/itmt.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index be4045628fd3..e63391b82624 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -1015,8 +1015,7 @@ static struct ctl_table sld_sysctls[] = {
.proc_handler = proc_douintvec_minmax,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE,
- },
- {}
+ }
};
static int __init sld_mitigate_sysctl_init(void)
diff --git a/arch/x86/kernel/itmt.c b/arch/x86/kernel/itmt.c
index ee4fe8cdb857..5f2ccff38297 100644
--- a/arch/x86/kernel/itmt.c
+++ b/arch/x86/kernel/itmt.c
@@ -73,8 +73,7 @@ static struct ctl_table itmt_kern_table[] = {
.proc_handler = sched_itmt_update_handler,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE,
- },
- {}
+ }
};
static struct ctl_table_header *itmt_sysctl_header;
--
2.30.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 3/8] arch/x86: Remove sentinel elem from ctl_table arrays
2023-09-06 10:03 ` [PATCH 3/8] arch/x86: " Joel Granados via B4 Relay
@ 2023-09-06 14:45 ` Dave Hansen
2023-09-06 21:58 ` Ingo Molnar
2023-09-07 7:38 ` Joel Granados
0 siblings, 2 replies; 16+ messages in thread
From: Dave Hansen @ 2023-09-06 14:45 UTC (permalink / raw)
To: j.granados, Luis Chamberlain, willy, josh, Kees Cook,
Iurii Zaikin, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Gerald Schaefer,
Russell King, Catalin Marinas, Will Deacon, Mark Rutland,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Andy Lutomirski, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Guo Ren
Cc: linux-fsdevel, linux-s390, linux-kernel, linux-arm-kernel,
linux-riscv, linuxppc-dev, linux-ia64, linux-csky
On 9/6/23 03:03, Joel Granados via B4 Relay wrote:
> This commit comes at the tail end of a greater effort to remove the
> empty elements at the end of the ctl_table arrays (sentinels) which
> will reduce the overall build time size of the kernel and run time
> memory bloat by ~64 bytes per sentinel (further information Link :
> https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
>
> Remove sentinel element from sld_sysctl and itmt_kern_table.
There's a *LOT* of content to read for a reviewer to figure out what's
going on here between all the links. I would have appreciated one more
sentence here, maybe:
This is now safe because the sysctl registration code
(register_sysctl()) implicitly uses ARRAY_SIZE() in addition
to checking for a sentinel.
That needs to be more prominent _somewhere_. Maybe here, or maybe in
the cover letter, but _somewhere_.
That said, feel free to add this to the two x86 patches:
Acked-by: Dave Hansen <dave.hansen@linux.intel.com> # for x86
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/8] arch/x86: Remove sentinel elem from ctl_table arrays
2023-09-06 14:45 ` Dave Hansen
@ 2023-09-06 21:58 ` Ingo Molnar
2023-09-07 8:24 ` Joel Granados
2023-09-07 7:38 ` Joel Granados
1 sibling, 1 reply; 16+ messages in thread
From: Ingo Molnar @ 2023-09-06 21:58 UTC (permalink / raw)
To: Dave Hansen
Cc: j.granados, Luis Chamberlain, willy, josh, Kees Cook,
Iurii Zaikin, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Gerald Schaefer,
Russell King, Catalin Marinas, Will Deacon, Mark Rutland,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Andy Lutomirski, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Guo Ren, linux-fsdevel, linux-s390, linux-kernel,
linux-arm-kernel, linux-riscv, linuxppc-dev, linux-ia64,
linux-csky
* Dave Hansen <dave.hansen@intel.com> wrote:
> On 9/6/23 03:03, Joel Granados via B4 Relay wrote:
> > This commit comes at the tail end of a greater effort to remove the
> > empty elements at the end of the ctl_table arrays (sentinels) which
> > will reduce the overall build time size of the kernel and run time
> > memory bloat by ~64 bytes per sentinel (further information Link :
> > https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
> >
> > Remove sentinel element from sld_sysctl and itmt_kern_table.
>
> There's a *LOT* of content to read for a reviewer to figure out what's
> going on here between all the links. I would have appreciated one more
> sentence here, maybe:
>
> This is now safe because the sysctl registration code
> (register_sysctl()) implicitly uses ARRAY_SIZE() in addition
> to checking for a sentinel.
>
> That needs to be more prominent _somewhere_. Maybe here, or maybe in
> the cover letter, but _somewhere_.
>
> That said, feel free to add this to the two x86 patches:
>
> Acked-by: Dave Hansen <dave.hansen@linux.intel.com> # for x86
Absolutely needs to be in the title as well, something like:
arch/x86: Remove now superfluous sentinel elem from ctl_table arrays
With that propagated into the whole series:
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Thanks,
Ingo
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/8] arch/x86: Remove sentinel elem from ctl_table arrays
2023-09-06 21:58 ` Ingo Molnar
@ 2023-09-07 8:24 ` Joel Granados
0 siblings, 0 replies; 16+ messages in thread
From: Joel Granados @ 2023-09-07 8:24 UTC (permalink / raw)
To: Ingo Molnar
Cc: Dave Hansen, Luis Chamberlain, willy, josh, Kees Cook,
Iurii Zaikin, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Gerald Schaefer,
Russell King, Catalin Marinas, Will Deacon, Mark Rutland,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Andy Lutomirski, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Guo Ren, linux-fsdevel, linux-s390, linux-kernel,
linux-arm-kernel, linux-riscv, linuxppc-dev, linux-ia64,
linux-csky
[-- Attachment #1: Type: text/plain, Size: 1625 bytes --]
On Wed, Sep 06, 2023 at 11:58:47PM +0200, Ingo Molnar wrote:
>
> * Dave Hansen <dave.hansen@intel.com> wrote:
>
> > On 9/6/23 03:03, Joel Granados via B4 Relay wrote:
> > > This commit comes at the tail end of a greater effort to remove the
> > > empty elements at the end of the ctl_table arrays (sentinels) which
> > > will reduce the overall build time size of the kernel and run time
> > > memory bloat by ~64 bytes per sentinel (further information Link :
> > > https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
> > >
> > > Remove sentinel element from sld_sysctl and itmt_kern_table.
> >
> > There's a *LOT* of content to read for a reviewer to figure out what's
> > going on here between all the links. I would have appreciated one more
> > sentence here, maybe:
> >
> > This is now safe because the sysctl registration code
> > (register_sysctl()) implicitly uses ARRAY_SIZE() in addition
> > to checking for a sentinel.
> >
> > That needs to be more prominent _somewhere_. Maybe here, or maybe in
> > the cover letter, but _somewhere_.
> >
> > That said, feel free to add this to the two x86 patches:
> >
> > Acked-by: Dave Hansen <dave.hansen@linux.intel.com> # for x86
>
> Absolutely needs to be in the title as well, something like:
>
> arch/x86: Remove now superfluous sentinel elem from ctl_table arrays
Done. Will wait to see if other ppl have more comments to send out V2
Thx.
>
> With that propagated into the whole series:
>
> Reviewed-by: Ingo Molnar <mingo@kernel.org>
>
> Thanks,
>
> Ingo
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/8] arch/x86: Remove sentinel elem from ctl_table arrays
2023-09-06 14:45 ` Dave Hansen
2023-09-06 21:58 ` Ingo Molnar
@ 2023-09-07 7:38 ` Joel Granados
1 sibling, 0 replies; 16+ messages in thread
From: Joel Granados @ 2023-09-07 7:38 UTC (permalink / raw)
To: Dave Hansen
Cc: Luis Chamberlain, willy, josh, Kees Cook, Iurii Zaikin,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Gerald Schaefer,
Russell King, Catalin Marinas, Will Deacon, Mark Rutland,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Andy Lutomirski, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Guo Ren, linux-fsdevel, linux-s390, linux-kernel,
linux-arm-kernel, linux-riscv, linuxppc-dev, linux-ia64,
linux-csky
[-- Attachment #1: Type: text/plain, Size: 1822 bytes --]
On Wed, Sep 06, 2023 at 07:45:09AM -0700, Dave Hansen wrote:
> On 9/6/23 03:03, Joel Granados via B4 Relay wrote:
> > This commit comes at the tail end of a greater effort to remove the
> > empty elements at the end of the ctl_table arrays (sentinels) which
> > will reduce the overall build time size of the kernel and run time
> > memory bloat by ~64 bytes per sentinel (further information Link :
> > https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
> >
> > Remove sentinel element from sld_sysctl and itmt_kern_table.
>
> There's a *LOT* of content to read for a reviewer to figure out what's
> going on here between all the links. I would have appreciated one more
> sentence here, maybe:
>
> This is now safe because the sysctl registration code
> (register_sysctl()) implicitly uses ARRAY_SIZE() in addition
> to checking for a sentinel.
Thx for the feedback. This is a great sentence to add at the end of the
first paragraph instead of the link. I'll add it with a few changes as
there are more than just one register function and the use of ARRAY_SIZE
is implicit most of the time.
This is now safe because the sysctl registration code
(register_sysctl() and friends) use the array size in addition to
checking for a sentinel.
I have changed my cover letter in case I send a V2 and for the other
batches that are coming after the architecture one.
>
> That needs to be more prominent _somewhere_. Maybe here, or maybe in
> the cover letter, but _somewhere_.
This is also a good point. I think having it in both the cover letter
and each of the commits is an added value.
>
> That said, feel free to add this to the two x86 patches:
>
> Acked-by: Dave Hansen <dave.hansen@linux.intel.com> # for x86
Best
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 4/8] x86 vdso: rm sentinel element from ctl_table array
2023-09-06 10:03 [PATCH 0/8] sysctl: Remove sentinel elements from arch Joel Granados via B4 Relay
` (2 preceding siblings ...)
2023-09-06 10:03 ` [PATCH 3/8] arch/x86: " Joel Granados via B4 Relay
@ 2023-09-06 10:03 ` Joel Granados via B4 Relay
2023-09-06 10:03 ` [PATCH 5/8] riscv: Remove " Joel Granados via B4 Relay
` (3 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-06 10:03 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Iurii Zaikin,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Gerald Schaefer,
Russell King, Catalin Marinas, Will Deacon, Mark Rutland,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Andy Lutomirski, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Guo Ren
Cc: linux-fsdevel, linux-s390, linux-kernel, linux-arm-kernel,
linux-riscv, linuxppc-dev, linux-ia64, linux-csky, Joel Granados
From: Joel Granados <j.granados@samsung.com>
This commit comes at the tail end of a greater effort to remove the
empty elements at the end of the ctl_table arrays (sentinels) which
will reduce the overall build time size of the kernel and run time
memory bloat by ~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
Remove sentinel element from abi_table2.
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
arch/x86/entry/vdso/vdso32-setup.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/entry/vdso/vdso32-setup.c b/arch/x86/entry/vdso/vdso32-setup.c
index f3b3cacbcbb0..37b761802181 100644
--- a/arch/x86/entry/vdso/vdso32-setup.c
+++ b/arch/x86/entry/vdso/vdso32-setup.c
@@ -66,8 +66,7 @@ static struct ctl_table abi_table2[] = {
.proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE,
- },
- {}
+ }
};
static __init int ia32_binfmt_init(void)
--
2.30.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 5/8] riscv: Remove sentinel element from ctl_table array
2023-09-06 10:03 [PATCH 0/8] sysctl: Remove sentinel elements from arch Joel Granados via B4 Relay
` (3 preceding siblings ...)
2023-09-06 10:03 ` [PATCH 4/8] x86 vdso: rm sentinel element from ctl_table array Joel Granados via B4 Relay
@ 2023-09-06 10:03 ` Joel Granados via B4 Relay
2023-09-06 10:03 ` [PATCH 6/8] powerpc: Remove sentinel element from ctl_table arrays Joel Granados via B4 Relay
` (2 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-06 10:03 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Iurii Zaikin,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Gerald Schaefer,
Russell King, Catalin Marinas, Will Deacon, Mark Rutland,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Andy Lutomirski, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Guo Ren
Cc: linux-fsdevel, linux-s390, linux-kernel, linux-arm-kernel,
linux-riscv, linuxppc-dev, linux-ia64, linux-csky, Joel Granados
From: Joel Granados <j.granados@samsung.com>
This commit comes at the tail end of a greater effort to remove the
empty elements at the end of the ctl_table arrays (sentinels) which
will reduce the overall build time size of the kernel and run time
memory bloat by ~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
Remove sentinel element from riscv_v_default_vstate_table.
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
arch/riscv/kernel/vector.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/riscv/kernel/vector.c b/arch/riscv/kernel/vector.c
index 8d92fb6c522c..a1ae68b2ac0f 100644
--- a/arch/riscv/kernel/vector.c
+++ b/arch/riscv/kernel/vector.c
@@ -254,8 +254,7 @@ static struct ctl_table riscv_v_default_vstate_table[] = {
.maxlen = sizeof(riscv_v_implicit_uacc),
.mode = 0644,
.proc_handler = proc_dobool,
- },
- { }
+ }
};
static int __init riscv_v_sysctl_init(void)
--
2.30.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 6/8] powerpc: Remove sentinel element from ctl_table arrays
2023-09-06 10:03 [PATCH 0/8] sysctl: Remove sentinel elements from arch Joel Granados via B4 Relay
` (4 preceding siblings ...)
2023-09-06 10:03 ` [PATCH 5/8] riscv: Remove " Joel Granados via B4 Relay
@ 2023-09-06 10:03 ` Joel Granados via B4 Relay
2023-09-06 10:03 ` [PATCH 7/8] ia64: Remove sentinel element from ctl_table array Joel Granados via B4 Relay
2023-09-06 10:03 ` [PATCH 8/8] c-sky: rm sentinel element from ctl_talbe array Joel Granados via B4 Relay
7 siblings, 0 replies; 16+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-06 10:03 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Iurii Zaikin,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Gerald Schaefer,
Russell King, Catalin Marinas, Will Deacon, Mark Rutland,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Andy Lutomirski, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Guo Ren
Cc: linux-fsdevel, linux-s390, linux-kernel, linux-arm-kernel,
linux-riscv, linuxppc-dev, linux-ia64, linux-csky, Joel Granados
From: Joel Granados <j.granados@samsung.com>
This commit comes at the tail end of a greater effort to remove the
empty elements at the end of the ctl_table arrays (sentinels) which
will reduce the overall build time size of the kernel and run time
memory bloat by ~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
Remove sentinel from powersave_nap_ctl_table and
nmi_wd_lpm_factor_ctl_table.
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
arch/powerpc/kernel/idle.c | 3 +--
arch/powerpc/platforms/pseries/mobility.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
index b1c0418b25c8..a8591f5fa70e 100644
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -104,8 +104,7 @@ static struct ctl_table powersave_nap_ctl_table[] = {
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
- },
- {}
+ }
};
static int __init
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index 0161226d8fec..d82b0c802fbb 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -60,8 +60,7 @@ static struct ctl_table nmi_wd_lpm_factor_ctl_table[] = {
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_douintvec_minmax,
- },
- {}
+ }
};
static int __init register_nmi_wd_lpm_factor_sysctl(void)
--
2.30.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 7/8] ia64: Remove sentinel element from ctl_table array
2023-09-06 10:03 [PATCH 0/8] sysctl: Remove sentinel elements from arch Joel Granados via B4 Relay
` (5 preceding siblings ...)
2023-09-06 10:03 ` [PATCH 6/8] powerpc: Remove sentinel element from ctl_table arrays Joel Granados via B4 Relay
@ 2023-09-06 10:03 ` Joel Granados via B4 Relay
2023-09-06 10:03 ` [PATCH 8/8] c-sky: rm sentinel element from ctl_talbe array Joel Granados via B4 Relay
7 siblings, 0 replies; 16+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-06 10:03 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Iurii Zaikin,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Gerald Schaefer,
Russell King, Catalin Marinas, Will Deacon, Mark Rutland,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Andy Lutomirski, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Guo Ren
Cc: linux-fsdevel, linux-s390, linux-kernel, linux-arm-kernel,
linux-riscv, linuxppc-dev, linux-ia64, linux-csky, Joel Granados
From: Joel Granados <j.granados@samsung.com>
This commit comes at the tail end of a greater effort to remove the
empty elements at the end of the ctl_table arrays (sentinels) which
will reduce the overall build time size of the kernel and run time
memory bloat by ~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
Remove sentinel from kdump_ctl_table.
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
arch/ia64/kernel/crash.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c
index 88b3ce3e66cd..fbf8893a570c 100644
--- a/arch/ia64/kernel/crash.c
+++ b/arch/ia64/kernel/crash.c
@@ -231,8 +231,7 @@ static struct ctl_table kdump_ctl_table[] = {
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
- },
- { }
+ }
};
#endif
--
2.30.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 8/8] c-sky: rm sentinel element from ctl_talbe array
2023-09-06 10:03 [PATCH 0/8] sysctl: Remove sentinel elements from arch Joel Granados via B4 Relay
` (6 preceding siblings ...)
2023-09-06 10:03 ` [PATCH 7/8] ia64: Remove sentinel element from ctl_table array Joel Granados via B4 Relay
@ 2023-09-06 10:03 ` Joel Granados via B4 Relay
2023-09-08 9:01 ` Guo Ren
7 siblings, 1 reply; 16+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-06 10:03 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Iurii Zaikin,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Gerald Schaefer,
Russell King, Catalin Marinas, Will Deacon, Mark Rutland,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Andy Lutomirski, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Guo Ren
Cc: linux-fsdevel, linux-s390, linux-kernel, linux-arm-kernel,
linux-riscv, linuxppc-dev, linux-ia64, linux-csky, Joel Granados
From: Joel Granados <j.granados@samsung.com>
This commit comes at the tail end of a greater effort to remove the
empty elements at the end of the ctl_table arrays (sentinels) which
will reduce the overall build time size of the kernel and run time
memory bloat by ~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
Remove sentinel from alignment_tbl ctl_table array.
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
arch/csky/abiv1/alignment.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/csky/abiv1/alignment.c b/arch/csky/abiv1/alignment.c
index b60259daed1b..0d75ce7b0328 100644
--- a/arch/csky/abiv1/alignment.c
+++ b/arch/csky/abiv1/alignment.c
@@ -328,8 +328,7 @@ static struct ctl_table alignment_tbl[5] = {
.maxlen = sizeof(align_usr_count),
.mode = 0666,
.proc_handler = &proc_dointvec
- },
- {}
+ }
};
static int __init csky_alignment_init(void)
--
2.30.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 8/8] c-sky: rm sentinel element from ctl_talbe array
2023-09-06 10:03 ` [PATCH 8/8] c-sky: rm sentinel element from ctl_talbe array Joel Granados via B4 Relay
@ 2023-09-08 9:01 ` Guo Ren
0 siblings, 0 replies; 16+ messages in thread
From: Guo Ren @ 2023-09-08 9:01 UTC (permalink / raw)
To: j.granados
Cc: Luis Chamberlain, willy, josh, Kees Cook, Iurii Zaikin,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Gerald Schaefer,
Russell King, Catalin Marinas, Will Deacon, Mark Rutland,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Andy Lutomirski, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Michael Ellerman, Nicholas Piggin, Christophe Leroy,
linux-fsdevel, linux-s390, linux-kernel, linux-arm-kernel,
linux-riscv, linuxppc-dev, linux-ia64, linux-csky
Acked-by: Guo Ren <guoren@kernel.org>
On Wed, Sep 6, 2023 at 6:04 PM Joel Granados via B4 Relay
<devnull+j.granados.samsung.com@kernel.org> wrote:
>
> From: Joel Granados <j.granados@samsung.com>
>
> This commit comes at the tail end of a greater effort to remove the
> empty elements at the end of the ctl_table arrays (sentinels) which
> will reduce the overall build time size of the kernel and run time
> memory bloat by ~64 bytes per sentinel (further information Link :
> https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
>
> Remove sentinel from alignment_tbl ctl_table array.
>
> Signed-off-by: Joel Granados <j.granados@samsung.com>
> ---
> arch/csky/abiv1/alignment.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/csky/abiv1/alignment.c b/arch/csky/abiv1/alignment.c
> index b60259daed1b..0d75ce7b0328 100644
> --- a/arch/csky/abiv1/alignment.c
> +++ b/arch/csky/abiv1/alignment.c
> @@ -328,8 +328,7 @@ static struct ctl_table alignment_tbl[5] = {
> .maxlen = sizeof(align_usr_count),
> .mode = 0666,
> .proc_handler = &proc_dointvec
> - },
> - {}
> + }
> };
>
> static int __init csky_alignment_init(void)
>
> --
> 2.30.2
>
--
Best Regards
Guo Ren
^ permalink raw reply [flat|nested] 16+ messages in thread