Message ID | 20231002-jag-sysctl_remove_empty_elem_arch-v3-0-606da2840a7a@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Dear Joel, On 02.10.23 13:30, Joel Granados via B4 Relay wrote: > [...] I successfully "Build-n-Boot-to-login" tested the following patchset (together with the ia64 patch from V2 changed to: ``` diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c index 88b3ce3e66cd..65b0781f83ab 100644 --- a/arch/ia64/kernel/crash.c +++ b/arch/ia64/kernel/crash.c @@ -232,7 +232,6 @@ static struct ctl_table kdump_ctl_table[] = { .mode = 0644, .proc_handler = proc_dointvec, }, - { } }; #endif ``` ...) on top of v6.6-rc4 on my rx2620. I also applied the measurement patch (commented the printk in `new_dir` and uncommented the if conditional). I used a bash arithmetic expression (`accum=$(( accum + n ))`) in your script to calculate the total memory savings, because `calc` is not available as package for Debian on ia64. There are no memory savings for this configuration. But using the measurement patch with the printk in `new_dir` uncommented and the if conditional also uncommented I see the following savings (I assume this is the same as your measurement patch because the other configuration didn't yield any savings): ``` root@rx2620:~/bin# ./check-mem-savings.bash 64 [...] 64 5888 ``` > Joel Granados (7): > S390: Remove now superfluous sentinel elem from ctl_table arrays > arm: Remove now superfluous sentinel elem from ctl_table arrays > arch/x86: Remove now superfluous sentinel elem from ctl_table arrays > x86/vdso: Remove now superfluous sentinel element from ctl_table array > riscv: Remove now superfluous sentinel element from ctl_table array > powerpc: Remove now superfluous sentinel element from ctl_table arrays > c-sky: Remove now superfluous sentinel element from ctl_talbe array > > arch/arm/kernel/isa.c | 4 ++-- > arch/arm64/kernel/armv8_deprecated.c | 8 +++----- > arch/arm64/kernel/fpsimd.c | 2 -- > arch/arm64/kernel/process.c | 1 - > arch/csky/abiv1/alignment.c | 1 - > arch/powerpc/kernel/idle.c | 1 - > arch/powerpc/platforms/pseries/mobility.c | 1 - > arch/riscv/kernel/vector.c | 1 - > arch/s390/appldata/appldata_base.c | 4 +--- > arch/s390/kernel/debug.c | 1 - > arch/s390/kernel/topology.c | 1 - > arch/s390/mm/cmm.c | 1 - > arch/s390/mm/pgalloc.c | 1 - > arch/x86/entry/vdso/vdso32-setup.c | 1 - > arch/x86/kernel/cpu/intel.c | 1 - > arch/x86/kernel/itmt.c | 1 - > drivers/perf/arm_pmuv3.c | 1 - > 17 files changed, 6 insertions(+), 25 deletions(-) > --- > base-commit: 8a749fd1a8720d4619c91c8b6e7528c0a355c0aa > change-id: 20230904-jag-sysctl_remove_empty_elem_arch-81db0a6e6cc4 Tested-by: Frank Scheiner <frank.scheiner@web.de> # ia64 Cheers, Frank
On Wed, Oct 04, 2023 at 05:12:17PM +0200, Frank Scheiner wrote: > Dear Joel, > > On 02.10.23 13:30, Joel Granados via B4 Relay wrote: > > [...] > > I successfully "Build-n-Boot-to-login" tested the following patchset > (together with the ia64 patch from V2 changed to: > > ``` > diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c > index 88b3ce3e66cd..65b0781f83ab 100644 > --- a/arch/ia64/kernel/crash.c > +++ b/arch/ia64/kernel/crash.c > @@ -232,7 +232,6 @@ static struct ctl_table kdump_ctl_table[] = { > .mode = 0644, > .proc_handler = proc_dointvec, > }, > - { } > }; > #endif > > ``` > > ...) on top of v6.6-rc4 on my rx2620. I also applied the measurement > patch (commented the printk in `new_dir` and uncommented the if > conditional). > > I used a bash arithmetic expression (`accum=$(( accum + n ))`) in your > script to calculate the total memory savings, because `calc` is not > available as package for Debian on ia64. > > There are no memory savings for this configuration. > > But using the measurement patch with the printk in `new_dir` uncommented > and the if conditional also uncommented I see the following savings (I > assume this is the same as your measurement patch because the other > configuration didn't yield any savings): > > ``` > root@rx2620:~/bin# ./check-mem-savings.bash > 64 > [...] > 64 > 5888 > ``` Thankyou very much for all this verification, but the ia64 patch was dropped from the set. Please see https://lore.kernel.org/all/20230921115034.5461f62f@canb.auug.org.au Best > > > Joel Granados (7): > > S390: Remove now superfluous sentinel elem from ctl_table arrays > > arm: Remove now superfluous sentinel elem from ctl_table arrays > > arch/x86: Remove now superfluous sentinel elem from ctl_table arrays > > x86/vdso: Remove now superfluous sentinel element from ctl_table array > > riscv: Remove now superfluous sentinel element from ctl_table array > > powerpc: Remove now superfluous sentinel element from ctl_table arrays > > c-sky: Remove now superfluous sentinel element from ctl_talbe array > > > > arch/arm/kernel/isa.c | 4 ++-- > > arch/arm64/kernel/armv8_deprecated.c | 8 +++----- > > arch/arm64/kernel/fpsimd.c | 2 -- > > arch/arm64/kernel/process.c | 1 - > > arch/csky/abiv1/alignment.c | 1 - > > arch/powerpc/kernel/idle.c | 1 - > > arch/powerpc/platforms/pseries/mobility.c | 1 - > > arch/riscv/kernel/vector.c | 1 - > > arch/s390/appldata/appldata_base.c | 4 +--- > > arch/s390/kernel/debug.c | 1 - > > arch/s390/kernel/topology.c | 1 - > > arch/s390/mm/cmm.c | 1 - > > arch/s390/mm/pgalloc.c | 1 - > > arch/x86/entry/vdso/vdso32-setup.c | 1 - > > arch/x86/kernel/cpu/intel.c | 1 - > > arch/x86/kernel/itmt.c | 1 - > > drivers/perf/arm_pmuv3.c | 1 - > > 17 files changed, 6 insertions(+), 25 deletions(-) > > --- > > base-commit: 8a749fd1a8720d4619c91c8b6e7528c0a355c0aa > > change-id: 20230904-jag-sysctl_remove_empty_elem_arch-81db0a6e6cc4 > > Tested-by: Frank Scheiner <frank.scheiner@web.de> # ia64 > > Cheers, > Frank
On Mon, Oct 02, 2023 at 01:30:35PM +0200, Joel Granados via B4 Relay wrote: > V3: > * Removed the ia64 patch to avoid conflicts with the ia64 removal > * Rebased onto v6.6-rc4 > * Kept/added the trailing comma for the ctl_table arrays. This was a comment > that we received "drivers/*" patch set. > * Link to v2: https://lore.kernel.org/r/20230913-jag-sysctl_remove_empty_elem_arch-v2-0-d1bd13a29bae@samsung.com Thanks! I replaced the v2 with this v3 on sysctl-next. Luis
On Tue, Oct 10, 2023 at 03:22:34PM -0700, Luis Chamberlain wrote: > On Mon, Oct 02, 2023 at 01:30:35PM +0200, Joel Granados via B4 Relay wrote: > > V3: > > * Removed the ia64 patch to avoid conflicts with the ia64 removal > > * Rebased onto v6.6-rc4 > > * Kept/added the trailing comma for the ctl_table arrays. This was a comment > > that we received "drivers/*" patch set. > > * Link to v2: https://lore.kernel.org/r/20230913-jag-sysctl_remove_empty_elem_arch-v2-0-d1bd13a29bae@samsung.com > > Thanks! I replaced the v2 with this v3 on sysctl-next. perfect > > Luis
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index c88854df0b62..e0073a627bac 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -976,6 +976,8 @@ static struct ctl_dir *new_dir(struct ctl_table_set *set, table[0].procname = new_name; table[0].mode = S_IFDIR|S_IRUGO|S_IXUGO; init_header(&new->header, set->dir.header.root, set, node, table, 1); + // Counts additional sentinel used for each new dir. + printk("%ld sysctl saved mem kzalloc \n", sizeof(struct ctl_table)); return new; } @@ -1199,6 +1201,9 @@ static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table_ link_name += len; link++; } + // Counts additional sentinel used for each new registration + //if ((head->ctl_table + head->ctl_table_size)->procname) + printk("%ld sysctl saved mem kzalloc \n", sizeof(struct ctl_table)); init_header(links, dir->header.root, dir->header.set, node, link_table, head->ctl_table_size); links->nreg = nr_entries;