* [PATCH 00/15] sysctl: Remove sentinel elements from drivers
@ 2023-09-28 13:21 Joel Granados via B4 Relay
[not found] ` <20230928-jag-sysctl_remove_empty_elem_drive>
` (19 more replies)
0 siblings, 20 replies; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
From: Joel Granados <j.granados@samsung.com>
What?
These commits remove the sentinel element (last empty element) from the
sysctl arrays of all the files under the "drivers/" directory that use a
sysctl array for registration. The merging of the preparation patches
(in https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
to mainline allows us to just remove sentinel elements without changing
behavior (more info here [1]).
These commits are part of a bigger set (here
https://github.com/Joelgranados/linux/tree/tag/sysctl_remove_empty_elem_V4)
that remove the ctl_table sentinel. Make the review process easier by
chunking the commits into manageable pieces. Each chunk can be reviewed
separately without noise from parallel sets.
Now that the architecture chunk has been mostly reviewed [6], we send
the "drivers/" directory. Once this one is done, it will be follwed by
"fs/*", "kernel/*", "net/*" and miscellaneous. The final set will remove
the unneeded check for ->procname == NULL.
Why?
By removing the sysctl sentinel elements we avoid kernel bloat as
ctl_table arrays get moved out of kernel/sysctl.c into their own
respective subsystems. This move was started long ago to avoid merge
conflicts; the sentinel removal bit came after Mathew Wilcox suggested
it to avoid bloating the kernel by one element as arrays moved out. This
patchset will reduce the overall build time size of the kernel and run
time memory bloat by about ~64 bytes per declared ctl_table array. I
have consolidated some links that shed light on the history of this
effort [2].
Testing:
* Ran sysctl selftests (./tools/testing/selftests/sysctl/sysctl.sh)
* Ran this through 0-day with no errors or warnings
Size saving after removing all sentinels:
These are the bytes that we save after removing all the sentinels
(this plus all the other chunks). I included them to get an idea of
how much memory we are talking about.
* bloat-o-meter:
- The "yesall" configuration results save 9158 bytes
https://lore.kernel.org/all/20230621091000.424843-1-j.granados@samsung.com/
- The "tiny" config + CONFIG_SYSCTL save 1215 bytes
https://lore.kernel.org/all/20230809105006.1198165-1-j.granados@samsung.com/
* memory usage:
In memory savings are measured to be 7296 bytes. (here is how to
measure [3])
Size saving after this patchset:
* bloat-o-meter
- The "yesall" config saves 2432 bytes [4]
- The "tiny" config saves 64 bytes [5]
* memory usage:
In this case there were no bytes saved because I do not have any
of the drivers in the patch. To measure it comment the printk in
`new_dir` and uncomment the if conditional in `new_links` [3].
Comments/feedback greatly appreciated
Best
Joel
[1]
We are able to remove a sentinel table without behavioral change by
introducing a table_size argument in the same place where procname is
checked for NULL. The idea is for it to keep stopping when it hits
->procname == NULL, while the sentinel is still present. And when the
sentinel is removed, it will stop on the table_size. You can go to
(https://lore.kernel.org/all/20230809105006.1198165-1-j.granados@samsung.com/)
for more information.
[2]
Links Related to the ctl_table sentinel removal:
* Good summary from Luis sent with the "pull request" for the
preparation patches.
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/
* Another very good summary from Luis.
https://lore.kernel.org/all/ZMFizKFkVxUFtSqa@bombadil.infradead.org/
* This is a patch set that replaces register_sysctl_table with register_sysctl
https://lore.kernel.org/all/20230302204612.782387-1-mcgrof@kernel.org/
* Patch set to deprecate register_sysctl_paths()
https://lore.kernel.org/all/20230302202826.776286-1-mcgrof@kernel.org/
* Here there is an explicit expectation for the removal of the sentinel element.
https://lore.kernel.org/all/20230321130908.6972-1-frank.li@vivo.com
* The "ARRAY_SIZE" approach was mentioned (proposed?) in this thread
https://lore.kernel.org/all/20220220060626.15885-1-tangmeng@uniontech.com
[3]
To measure the in memory savings apply this on top of this patchset.
"
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;
"
and then run the following bash script in the kernel:
accum=0
for n in $(dmesg | grep kzalloc | awk '{print $3}') ; do
echo $n
accum=$(calc "$accum + $n")
done
echo $accum
[4]
add/remove: 0/0 grow/shrink: 0/21 up/down: 0/-2432 (-2432)
Function old new delta
xpc_sys_xpc_hb 192 128 -64
xpc_sys_xpc 128 64 -64
vrf_table 128 64 -64
ucma_ctl_table 128 64 -64
tty_table 192 128 -64
sg_sysctls 128 64 -64
scsi_table 128 64 -64
random_table 448 384 -64
raid_table 192 128 -64
oa_table 192 128 -64
mac_hid_files 256 192 -64
iwcm_ctl_table 128 64 -64
ipmi_table 128 64 -64
hv_ctl_table 128 64 -64
hpet_table 128 64 -64
firmware_config_table 192 128 -64
cdrom_table 448 384 -64
balloon_table 128 64 -64
parport_sysctl_template 912 720 -192
parport_default_sysctl_table 584 136 -448
parport_device_sysctl_template 776 136 -640
Total: Before=429940038, After=429937606, chg -0.00%
[5]
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-64 (-64)
Function old new delta
random_table 448 384 -64
Total: Before=1885527, After=1885463, chg -0.00%
[6] https://lore.kernel.org/all/20230913-jag-sysctl_remove_empty_elem_arch-v2-0-d1bd13a29bae@samsung.com/
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
---
Joel Granados (15):
cdrom: Remove now superfluous sentinel element from ctl_table array
hpet: Remove now superfluous sentinel element from ctl_table array
xen: Remove now superfluous sentinel element from ctl_table array
tty: Remove now superfluous sentinel element from ctl_table array
scsi: Remove now superfluous sentinel element from ctl_table array
parport: Remove the now superfluous sentinel element from ctl_table array
macintosh: Remove the now superfluous sentinel element from ctl_table array
infiniband: Remove the now superfluous sentinel element from ctl_table array
char-misc: Remove the now superfluous sentinel element from ctl_table array
vrf: Remove the now superfluous sentinel element from ctl_table array
sgi-xp: Remove the now superfluous sentinel element from ctl_table array
fw loader: Remove the now superfluous sentinel element from ctl_table array
raid: Remove now superfluous sentinel element from ctl_table array
hyper-v/azure: Remove now superfluous sentinel element from ctl_table array
intel drm: Remove now superfluous sentinel element from ctl_table array
drivers/base/firmware_loader/fallback_table.c | 3 +-
drivers/cdrom/cdrom.c | 3 +-
drivers/char/hpet.c | 3 +-
drivers/char/ipmi/ipmi_poweroff.c | 3 +-
drivers/char/random.c | 3 +-
drivers/gpu/drm/i915/i915_perf.c | 3 +-
drivers/hv/hv_common.c | 3 +-
drivers/infiniband/core/iwcm.c | 3 +-
drivers/infiniband/core/ucma.c | 3 +-
drivers/macintosh/mac_hid.c | 3 +-
drivers/md/md.c | 3 +-
drivers/misc/sgi-xp/xpc_main.c | 6 ++--
drivers/net/vrf.c | 3 +-
drivers/parport/procfs.c | 42 ++++++++++++---------------
drivers/scsi/scsi_sysctl.c | 3 +-
drivers/scsi/sg.c | 3 +-
drivers/tty/tty_io.c | 3 +-
drivers/xen/balloon.c | 3 +-
18 files changed, 36 insertions(+), 60 deletions(-)
---
base-commit: 0e945134b680040b8613e962f586d91b6d40292d
change-id: 20230927-jag-sysctl_remove_empty_elem_drivers-f034962a0d8c
Best regards,
--
Joel Granados <j.granados@samsung.com>
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 01/15] cdrom: Remove now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
[not found] ` <20230928-jag-sysctl_remove_empty_elem_drive>
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
2023-09-28 13:36 ` Greg Kroah-Hartman
2023-09-28 13:21 ` [PATCH 02/15] hpet: " Joel Granados via B4 Relay
` (17 subsequent siblings)
19 siblings, 1 reply; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 cdrom_table
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/cdrom/cdrom.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index cc2839805983..451907ade389 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -3654,8 +3654,7 @@ static struct ctl_table cdrom_table[] = {
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = cdrom_sysctl_handler
- },
- { }
+ }
};
static struct ctl_table_header *cdrom_sysctl_header;
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 02/15] hpet: Remove now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
[not found] ` <20230928-jag-sysctl_remove_empty_elem_drive>
2023-09-28 13:21 ` [PATCH 01/15] cdrom: Remove now superfluous sentinel element from ctl_table array Joel Granados via B4 Relay
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 03/15] xen: " Joel Granados via B4 Relay
` (16 subsequent siblings)
19 siblings, 0 replies; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 last empty element from hpet_table.
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/char/hpet.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index ee71376f174b..11f466fea5ed 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -727,8 +727,7 @@ static struct ctl_table hpet_table[] = {
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
- },
- {}
+ }
};
static struct ctl_table_header *sysctl_header;
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 03/15] xen: Remove now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
` (2 preceding siblings ...)
2023-09-28 13:21 ` [PATCH 02/15] hpet: " Joel Granados via B4 Relay
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 04/15] tty: " Joel Granados via B4 Relay
` (15 subsequent siblings)
19 siblings, 0 replies; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 balloon_table
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/xen/balloon.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 586a1673459e..091eb2931ac4 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -93,8 +93,7 @@ static struct ctl_table balloon_table[] = {
.proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE,
- },
- { }
+ }
};
#else
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 04/15] tty: Remove now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
` (3 preceding siblings ...)
2023-09-28 13:21 ` [PATCH 03/15] xen: " Joel Granados via B4 Relay
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
2023-10-02 8:17 ` Jiri Slaby
2023-09-28 13:21 ` [PATCH 05/15] scsi: " Joel Granados via B4 Relay
` (14 subsequent siblings)
19 siblings, 1 reply; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 tty_table
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/tty/tty_io.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 8a94e5a43c6d..2f925dc54a20 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -3607,8 +3607,7 @@ static struct ctl_table tty_table[] = {
.proc_handler = proc_dointvec,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE,
- },
- { }
+ }
};
/*
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 05/15] scsi: Remove now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
` (4 preceding siblings ...)
2023-09-28 13:21 ` [PATCH 04/15] tty: " Joel Granados via B4 Relay
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 06/15] parport: Remove the " Joel Granados via B4 Relay
` (13 subsequent siblings)
19 siblings, 0 replies; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 scsi_table and sg_sysctls.
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/scsi/scsi_sysctl.c | 3 +--
drivers/scsi/sg.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/scsi_sysctl.c b/drivers/scsi/scsi_sysctl.c
index 7f0914ea168f..c74da88b20d3 100644
--- a/drivers/scsi/scsi_sysctl.c
+++ b/drivers/scsi/scsi_sysctl.c
@@ -17,8 +17,7 @@ static struct ctl_table scsi_table[] = {
.data = &scsi_logging_level,
.maxlen = sizeof(scsi_logging_level),
.mode = 0644,
- .proc_handler = proc_dointvec },
- { }
+ .proc_handler = proc_dointvec }
};
static struct ctl_table_header *scsi_table_header;
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 0d8afffd1683..22a59c5e22eb 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1649,8 +1649,7 @@ static struct ctl_table sg_sysctls[] = {
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = proc_dointvec,
- },
- {}
+ }
};
static struct ctl_table_header *hdr;
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 06/15] parport: Remove the now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
` (5 preceding siblings ...)
2023-09-28 13:21 ` [PATCH 05/15] scsi: " Joel Granados via B4 Relay
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 07/15] macintosh: " Joel Granados via B4 Relay
` (12 subsequent siblings)
19 siblings, 0 replies; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 unneeded ctl_tables that were used to register intermediate
parport directories; only the path is needed at this point. From
parport_device_sysctl_table we removed: devices_root_dir, port_dir,
parport_dir and dev_dir. From parport_default_sysctl_table we removed:
default_dir, parport_dir and dev_dir. Reduce the size by one of the
ctl_table arrays that were not removed
Assign different sizes to the vars array in parport_sysctl_table
depending on CONFIG_PARPORT_1284; this is necessary now that the sysctl
register function uses ARRAY_SIZE to calculate the elements within.
Remove the sentinel element from parport_sysctl_template,
parport_device_sysctl_table and parport_default_sysctl_table.
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/parport/procfs.c | 42 ++++++++++++++++++------------------------
1 file changed, 18 insertions(+), 24 deletions(-)
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
index 4e5b972c3e26..4118b3e52223 100644
--- a/drivers/parport/procfs.c
+++ b/drivers/parport/procfs.c
@@ -259,8 +259,12 @@ PARPORT_MAX_SPINTIME_VALUE;
struct parport_sysctl_table {
struct ctl_table_header *port_header;
struct ctl_table_header *devices_header;
- struct ctl_table vars[12];
- struct ctl_table device_dir[2];
+#ifdef CONFIG_PARPORT_1284
+ struct ctl_table vars[10];
+#else
+ struct ctl_table vars[5];
+#endif /* IEEE 1284 support */
+ struct ctl_table device_dir[1];
};
static const struct parport_sysctl_table parport_sysctl_template = {
@@ -303,9 +307,9 @@ static const struct parport_sysctl_table parport_sysctl_template = {
.maxlen = 0,
.mode = 0444,
.proc_handler = do_hardware_modes
- },
+ }
#ifdef CONFIG_PARPORT_1284
- {
+ , {
.procname = "autoprobe",
.data = NULL,
.maxlen = 0,
@@ -339,9 +343,8 @@ static const struct parport_sysctl_table parport_sysctl_template = {
.maxlen = 0,
.mode = 0444,
.proc_handler = do_autoprobe
- },
+ }
#endif /* IEEE 1284 support */
- {}
},
{
{
@@ -350,20 +353,15 @@ static const struct parport_sysctl_table parport_sysctl_template = {
.maxlen = 0,
.mode = 0444,
.proc_handler = do_active_device
- },
- {}
+ }
},
};
struct parport_device_sysctl_table
{
struct ctl_table_header *sysctl_header;
- struct ctl_table vars[2];
- struct ctl_table device_dir[2];
- struct ctl_table devices_root_dir[2];
- struct ctl_table port_dir[2];
- struct ctl_table parport_dir[2];
- struct ctl_table dev_dir[2];
+ struct ctl_table vars[1];
+ struct ctl_table device_dir[1];
};
static const struct parport_device_sysctl_table
@@ -378,8 +376,7 @@ parport_device_sysctl_template = {
.proc_handler = proc_doulongvec_ms_jiffies_minmax,
.extra1 = (void*) &parport_min_timeslice_value,
.extra2 = (void*) &parport_max_timeslice_value
- },
- {}
+ }
},
{
{
@@ -387,18 +384,14 @@ parport_device_sysctl_template = {
.data = NULL,
.maxlen = 0,
.mode = 0555,
- },
- {}
+ }
}
};
struct parport_default_sysctl_table
{
struct ctl_table_header *sysctl_header;
- struct ctl_table vars[3];
- struct ctl_table default_dir[2];
- struct ctl_table parport_dir[2];
- struct ctl_table dev_dir[2];
+ struct ctl_table vars[2];
};
static struct parport_default_sysctl_table
@@ -422,8 +415,7 @@ parport_default_sysctl_table = {
.proc_handler = proc_dointvec_minmax,
.extra1 = (void*) &parport_min_spintime_value,
.extra2 = (void*) &parport_max_spintime_value
- },
- {}
+ }
}
};
@@ -443,7 +435,9 @@ int parport_proc_register(struct parport *port)
t->vars[0].data = &port->spintime;
for (i = 0; i < 5; i++) {
t->vars[i].extra1 = port;
+#ifdef CONFIG_PARPORT_1284
t->vars[5 + i].extra2 = &port->probe_info[i];
+#endif /* IEEE 1284 support */
}
port_name_len = strnlen(port->name, PARPORT_NAME_MAX_LEN);
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 07/15] macintosh: Remove the now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
` (6 preceding siblings ...)
2023-09-28 13:21 ` [PATCH 06/15] parport: Remove the " Joel Granados via B4 Relay
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 08/15] infiniband: " Joel Granados via B4 Relay
` (11 subsequent siblings)
19 siblings, 0 replies; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 mac_hid_files
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/macintosh/mac_hid.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c
index d8c4d5664145..5a228c7d9aeb 100644
--- a/drivers/macintosh/mac_hid.c
+++ b/drivers/macintosh/mac_hid.c
@@ -235,8 +235,7 @@ static struct ctl_table mac_hid_files[] = {
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
- },
- { }
+ }
};
static struct ctl_table_header *mac_hid_sysctl_header;
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 08/15] infiniband: Remove the now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
` (7 preceding siblings ...)
2023-09-28 13:21 ` [PATCH 07/15] macintosh: " Joel Granados via B4 Relay
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 09/15] char-misc: " Joel Granados via B4 Relay
` (10 subsequent siblings)
19 siblings, 0 replies; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 iwcm_ctl_table and ucma_ctl_table
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/infiniband/core/iwcm.c | 3 +--
drivers/infiniband/core/ucma.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c
index 2b47073c61a6..fefb9ae75789 100644
--- a/drivers/infiniband/core/iwcm.c
+++ b/drivers/infiniband/core/iwcm.c
@@ -110,8 +110,7 @@ static struct ctl_table iwcm_ctl_table[] = {
.maxlen = sizeof(default_backlog),
.mode = 0644,
.proc_handler = proc_dointvec,
- },
- { }
+ }
};
/*
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index bf42650f125b..92ad24ddf12a 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -70,8 +70,7 @@ static struct ctl_table ucma_ctl_table[] = {
.maxlen = sizeof max_backlog,
.mode = 0644,
.proc_handler = proc_dointvec,
- },
- { }
+ }
};
struct ucma_file {
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 09/15] char-misc: Remove the now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
` (8 preceding siblings ...)
2023-09-28 13:21 ` [PATCH 08/15] infiniband: " Joel Granados via B4 Relay
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 10/15] vrf: " Joel Granados via B4 Relay
` (9 subsequent siblings)
19 siblings, 0 replies; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 impi_table and random_table
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/char/ipmi/ipmi_poweroff.c | 3 +--
drivers/char/random.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/char/ipmi/ipmi_poweroff.c b/drivers/char/ipmi/ipmi_poweroff.c
index 870659d91db2..b65ab51bf9fa 100644
--- a/drivers/char/ipmi/ipmi_poweroff.c
+++ b/drivers/char/ipmi/ipmi_poweroff.c
@@ -655,8 +655,7 @@ static struct ctl_table ipmi_table[] = {
.data = &poweroff_powercycle,
.maxlen = sizeof(poweroff_powercycle),
.mode = 0644,
- .proc_handler = proc_dointvec },
- { }
+ .proc_handler = proc_dointvec }
};
static struct ctl_table_header *ipmi_table_header;
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 3cb37760dfec..4040715cba19 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1682,8 +1682,7 @@ static struct ctl_table random_table[] = {
.procname = "uuid",
.mode = 0444,
.proc_handler = proc_do_uuid,
- },
- { }
+ }
};
/*
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 10/15] vrf: Remove the now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
` (9 preceding siblings ...)
2023-09-28 13:21 ` [PATCH 09/15] char-misc: " Joel Granados via B4 Relay
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 11/15] sgi-xp: " Joel Granados via B4 Relay
` (8 subsequent siblings)
19 siblings, 0 replies; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 vrf_table
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/net/vrf.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index a3408e4e1491..94eed8708467 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -1962,8 +1962,7 @@ static const struct ctl_table vrf_table[] = {
.proc_handler = vrf_shared_table_handler,
/* set by the vrf_netns_init */
.extra1 = NULL,
- },
- { },
+ }
};
static int vrf_netns_init_sysctl(struct net *net, struct netns_vrf *nn_vrf)
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 11/15] sgi-xp: Remove the now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
` (10 preceding siblings ...)
2023-09-28 13:21 ` [PATCH 10/15] vrf: " Joel Granados via B4 Relay
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 12/15] fw loader: " Joel Granados via B4 Relay
` (7 subsequent siblings)
19 siblings, 0 replies; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 xpc_sys_xpc_hb and xpc_sys_xpc
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/misc/sgi-xp/xpc_main.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c
index 6da509d692bb..c898092ff3ac 100644
--- a/drivers/misc/sgi-xp/xpc_main.c
+++ b/drivers/misc/sgi-xp/xpc_main.c
@@ -109,8 +109,7 @@ static struct ctl_table xpc_sys_xpc_hb[] = {
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xpc_hb_check_min_interval,
- .extra2 = &xpc_hb_check_max_interval},
- {}
+ .extra2 = &xpc_hb_check_max_interval}
};
static struct ctl_table xpc_sys_xpc[] = {
{
@@ -120,8 +119,7 @@ static struct ctl_table xpc_sys_xpc[] = {
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xpc_disengage_min_timelimit,
- .extra2 = &xpc_disengage_max_timelimit},
- {}
+ .extra2 = &xpc_disengage_max_timelimit}
};
static struct ctl_table_header *xpc_sysctl;
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 12/15] fw loader: Remove the now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
` (11 preceding siblings ...)
2023-09-28 13:21 ` [PATCH 11/15] sgi-xp: " Joel Granados via B4 Relay
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 13/15] raid: Remove " Joel Granados via B4 Relay
` (6 subsequent siblings)
19 siblings, 0 replies; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 firmware_config_table
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/base/firmware_loader/fallback_table.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/base/firmware_loader/fallback_table.c b/drivers/base/firmware_loader/fallback_table.c
index e5ac098d0742..968aef19e118 100644
--- a/drivers/base/firmware_loader/fallback_table.c
+++ b/drivers/base/firmware_loader/fallback_table.c
@@ -43,8 +43,7 @@ static struct ctl_table firmware_config_table[] = {
.proc_handler = proc_douintvec_minmax,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE,
- },
- { }
+ }
};
static struct ctl_table_header *firmware_config_sysct_table_header;
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 13/15] raid: Remove now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
` (12 preceding siblings ...)
2023-09-28 13:21 ` [PATCH 12/15] fw loader: " Joel Granados via B4 Relay
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 14/15] hyper-v/azure: " Joel Granados via B4 Relay
` (5 subsequent siblings)
19 siblings, 0 replies; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 raid_table
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/md/md.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index a104a025084d..3866d8f754a0 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -304,8 +304,7 @@ static struct ctl_table raid_table[] = {
.maxlen = sizeof(int),
.mode = S_IRUGO|S_IWUSR,
.proc_handler = proc_dointvec,
- },
- { }
+ }
};
static int start_readonly;
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 14/15] hyper-v/azure: Remove now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
` (13 preceding siblings ...)
2023-09-28 13:21 ` [PATCH 13/15] raid: Remove " Joel Granados via B4 Relay
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 15/15] intel drm: " Joel Granados via B4 Relay
` (4 subsequent siblings)
19 siblings, 0 replies; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 hv_ctl_table
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/hv/hv_common.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c
index ccad7bca3fd3..bc7d678030aa 100644
--- a/drivers/hv/hv_common.c
+++ b/drivers/hv/hv_common.c
@@ -147,8 +147,7 @@ static struct ctl_table hv_ctl_table[] = {
.proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE
- },
- {}
+ }
};
static int hv_die_panic_notify_crash(struct notifier_block *self,
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 15/15] intel drm: Remove now superfluous sentinel element from ctl_table array
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
` (14 preceding siblings ...)
2023-09-28 13:21 ` [PATCH 14/15] hyper-v/azure: " Joel Granados via B4 Relay
@ 2023-09-28 13:21 ` Joel Granados via B4 Relay
[not found] ` <65157da7.5d0a0220.13b5e.9e95SMTPIN_ADDED_BROKEN@mx.google.com>
` (3 subsequent siblings)
19 siblings, 0 replies; 32+ messages in thread
From: Joel Granados via B4 Relay @ 2023-09-28 13:21 UTC (permalink / raw)
To: Luis Chamberlain, willy, josh, Kees Cook, Phillip Potter,
Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko,
Jiri Slaby, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: Joel Granados, linux-hyperv, linux-scsi, linux-rdma, netdev,
intel-gfx, linux-kernel, dri-devel, linux-raid, linux-serial,
xen-devel, openipmi-developer, linuxppc-dev
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 oa_table
Signed-off-by: Joel Granados <j.granados@samsung.com>
---
drivers/gpu/drm/i915/i915_perf.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 04bc1f4a1115..97ef6d2ad037 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -4895,8 +4895,7 @@ static struct ctl_table oa_table[] = {
.proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO,
.extra2 = &oa_sample_rate_hard_limit,
- },
- {}
+ }
};
static u32 num_perf_groups_per_gt(struct intel_gt *gt)
--
2.30.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH 01/15] cdrom: Remove now superfluous sentinel element from ctl_table array
2023-09-28 13:21 ` [PATCH 01/15] cdrom: Remove now superfluous sentinel element from ctl_table array Joel Granados via B4 Relay
@ 2023-09-28 13:36 ` Greg Kroah-Hartman
2023-09-29 12:17 ` Joel Granados
0 siblings, 1 reply; 32+ messages in thread
From: Greg Kroah-Hartman @ 2023-09-28 13:36 UTC (permalink / raw)
To: j.granados
Cc: Jason A. Donenfeld, Steve Wahl, Clemens Ladisch, linux-hyperv,
dri-devel, Phillip Potter, Song Liu, Eric Dumazet,
K. Y. Srinivasan, Jiri Slaby, Russ Weight, Wei Liu,
Stefano Stabellini, Corey Minyard, Leon Romanovsky, linux-rdma,
Rafael J. Wysocki, Dexuan Cui, willy, Jason Gunthorpe,
linux-serial, Doug Gilbert, Jakub Kicinski, Paolo Abeni,
Haiyang Zhang, Kees Cook, Arnd Bergmann, linux-kernel,
James E.J. Bottomley, intel-gfx, josh, linux-raid, Rodrigo Vivi,
xen-devel, openipmi-developer, Juergen Gross, Tvrtko Ursulin,
Theodore Ts'o, linux-scsi, Martin K. Petersen, netdev,
David Ahern, Robin Holt, Sudip Mukherjee, Oleksandr Tyshchenko,
Luis Chamberlain, linuxppc-dev, David S. Miller
On Thu, Sep 28, 2023 at 03:21:26PM +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 sentinel element from cdrom_table
>
> Signed-off-by: Joel Granados <j.granados@samsung.com>
> ---
> drivers/cdrom/cdrom.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
> index cc2839805983..451907ade389 100644
> --- a/drivers/cdrom/cdrom.c
> +++ b/drivers/cdrom/cdrom.c
> @@ -3654,8 +3654,7 @@ static struct ctl_table cdrom_table[] = {
> .maxlen = sizeof(int),
> .mode = 0644,
> .proc_handler = cdrom_sysctl_handler
> - },
> - { }
> + }
You should have the final entry as "}," so as to make any future
additions to the list to only contain that entry, that's long been the
kernel style for lists like this.
So your patches will just remove one line, not 2 and add 1, making it a
smaller diff.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 13/15] raid: Remove now superfluous sentinel element from ctl_table array
[not found] ` <65157da7.5d0a0220.13b5e.9e95SMTPIN_ADDED_BROKEN@mx.google.com>
@ 2023-09-28 15:20 ` Song Liu
0 siblings, 0 replies; 32+ messages in thread
From: Song Liu @ 2023-09-28 15:20 UTC (permalink / raw)
To: j.granados
Cc: Jason A. Donenfeld, Steve Wahl, Clemens Ladisch, linux-hyperv,
dri-devel, Phillip Potter, Eric Dumazet, K. Y. Srinivasan,
Jiri Slaby, Russ Weight, Wei Liu, Stefano Stabellini,
Corey Minyard, Leon Romanovsky, linux-rdma, Rafael J. Wysocki,
Dexuan Cui, willy, Jason Gunthorpe, linux-serial, Doug Gilbert,
Jakub Kicinski, Paolo Abeni, Haiyang Zhang, Kees Cook,
Arnd Bergmann, linux-kernel, James E.J. Bottomley, intel-gfx,
josh, linux-raid, Rodrigo Vivi, xen-devel, openipmi-developer,
Juergen Gross, Tvrtko Ursulin, Theodore Ts'o, linux-scsi,
Martin K. Petersen, Greg Kroah-Hartman, David Ahern, Robin Holt,
David S. Miller, Oleksandr Tyshchenko, Luis Chamberlain, netdev,
linuxppc-dev, Sudip Mukherjee
On Thu, Sep 28, 2023 at 6:20 AM 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 raid_table
>
> Signed-off-by: Joel Granados <j.granados@samsung.com>
> ---
> drivers/md/md.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index a104a025084d..3866d8f754a0 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -304,8 +304,7 @@ static struct ctl_table raid_table[] = {
> .maxlen = sizeof(int),
> .mode = S_IRUGO|S_IWUSR,
> .proc_handler = proc_dointvec,
> - },
> - { }
> + }
> };
Please keep "}," as Greg suggested. Otherwise,
Acked-by: Song Liu <song@kernel.org>
Thanks,
Song
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 14/15] hyper-v/azure: Remove now superfluous sentinel element from ctl_table array
[not found] ` <65157da8.050a0220.fb263.fdb1SMTPIN_ADDED_BROKEN@mx.google.com>
@ 2023-09-28 15:26 ` Wei Liu
2023-09-29 12:15 ` Joel Granados
2023-09-29 14:03 ` Joel Granados
0 siblings, 2 replies; 32+ messages in thread
From: Wei Liu @ 2023-09-28 15:26 UTC (permalink / raw)
To: j.granados
Cc: Jason A. Donenfeld, Steve Wahl, Clemens Ladisch, linux-hyperv,
dri-devel, Phillip Potter, Song Liu, Eric Dumazet,
K. Y. Srinivasan, Jiri Slaby, Russ Weight, Wei Liu,
Stefano Stabellini, Corey Minyard, Leon Romanovsky, linux-rdma,
Rafael J. Wysocki, Dexuan Cui, willy, Jason Gunthorpe,
linux-serial, Doug Gilbert, Jakub Kicinski, Paolo Abeni,
Haiyang Zhang, Kees Cook, Arnd Bergmann, linux-kernel,
James E.J. Bottomley, intel-gfx, josh, linux-raid, Rodrigo Vivi,
xen-devel, openipmi-developer, Juergen Gross, Tvrtko Ursulin,
Theodore Ts'o, linux-scsi, Martin K. Petersen,
Greg Kroah-Hartman, David Ahern, Robin Holt, David S. Miller,
Oleksandr Tyshchenko, Luis Chamberlain, netdev, linuxppc-dev,
Sudip Mukherjee
Please change the prefix to "Drivers: hv:" in the subject line in the
two patches.
On Thu, Sep 28, 2023 at 03:21:39PM +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 sentinel from hv_ctl_table
>
> Signed-off-by: Joel Granados <j.granados@samsung.com>
> ---
> drivers/hv/hv_common.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c
> index ccad7bca3fd3..bc7d678030aa 100644
> --- a/drivers/hv/hv_common.c
> +++ b/drivers/hv/hv_common.c
> @@ -147,8 +147,7 @@ static struct ctl_table hv_ctl_table[] = {
> .proc_handler = proc_dointvec_minmax,
> .extra1 = SYSCTL_ZERO,
> .extra2 = SYSCTL_ONE
> - },
> - {}
> + }
Please keep the comma at the end.
> };
>
> static int hv_die_panic_notify_crash(struct notifier_block *self,
>
> --
> 2.30.2
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 00/15] sysctl: Remove sentinel elements from drivers
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
` (17 preceding siblings ...)
[not found] ` <65157da8.050a0220.fb263.fdb1SMTPIN_ADDED_BROKEN@mx.google.com>
@ 2023-09-28 16:31 ` Christophe Leroy
2023-10-02 8:47 ` Joel Granados
[not found] ` <=?utf-8?q?=3C20230928-jag-sysctl=5Fremove=5Fempty=5Felem=5Fdrive?=>
19 siblings, 1 reply; 32+ messages in thread
From: Christophe Leroy @ 2023-09-28 16:31 UTC (permalink / raw)
To: j.granados, Luis Chamberlain, willy, josh, Kees Cook,
Phillip Potter, Clemens Ladisch, Arnd Bergmann,
Greg Kroah-Hartman, Juergen Gross, Stefano Stabellini,
Oleksandr Tyshchenko, Jiri Slaby, James E.J. Bottomley,
Martin K. Petersen, Doug Gilbert, Sudip Mukherjee,
Jason Gunthorpe, Leon Romanovsky, Corey Minyard,
Theodore Ts'o, Jason A. Donenfeld, David Ahern,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Robin Holt, Steve Wahl, Russ Weight, Rafael J. Wysocki, Song Liu,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
David Airlie, Daniel Vetter
Cc: linux-hyperv, linux-scsi, linux-rdma, netdev, intel-gfx,
linux-kernel, dri-devel, linux-raid, linux-serial, xen-devel,
openipmi-developer, linuxppc-dev
Le 28/09/2023 à 15:21, Joel Granados via B4 Relay a écrit :
> From: Joel Granados <j.granados@samsung.com>
Automatic test fails on powerpc, see
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20230928-jag-sysctl_remove_empty_elem_drivers-v1-15-e59120fca9f9@samsung.com/
Kernel attempted to read user page (1a111316) - exploit attempt? (uid: 0)
BUG: Unable to handle kernel data access on read at 0x1a111316
Faulting instruction address: 0xc0545338
Oops: Kernel access of bad area, sig: 11 [#1]
BE PAGE_SIZE=4K PowerPC 44x Platform
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Not tainted 6.5.0-rc6-gdef13277bacb #1
Hardware name: amcc,bamboo 440GR Rev. B 0x422218d3 PowerPC 44x Platform
NIP: c0545338 LR: c0548468 CTR: ffffffff
REGS: c084fae0 TRAP: 0300 Not tainted (6.5.0-rc6-gdef13277bacb)
MSR: 00021000 <CE,ME> CR: 84004288 XER: 00000000
DEAR: 1a111316 ESR: 00000000
GPR00: c0548468 c084fbd0 c0888000 c084fc99 00000000 c084fc7c 1a110316
000affff
GPR08: ffffffff c084fd18 1a111316 04ffffff 22000282 00000000 c00027c0
00000000
GPR16: 00000000 00000000 c0040000 c003d544 00000001 c003eb2c 096023d4
00000000
GPR24: c0636502 c0636502 c084fc74 c0588510 c084fc68 c084fc7c c084fc99
00000002
NIP [c0545338] string+0x78/0x148
LR [c0548468] vsnprintf+0x3d8/0x824
Call Trace:
[c084fbd0] [c084fc7c] 0xc084fc7c (unreliable)
[c084fbe0] [c0548468] vsnprintf+0x3d8/0x824
[c084fc30] [c0072dec] vprintk_store+0x17c/0x4c8
[c084fcc0] [c007322c] vprintk_emit+0xf4/0x2a0
[c084fd00] [c0073d04] _printk+0x60/0x88
[c084fd40] [c01ab63c] sysctl_err+0x78/0xa4
[c084fd80] [c01ab404] __register_sysctl_table+0x6a0/0x6c4
[c084fde0] [c06a585c] __register_sysctl_init+0x30/0x78
[c084fe00] [c06a8cc8] tty_init+0x44/0x168
[c084fe30] [c00023c4] do_one_initcall+0x64/0x2a0
[c084fea0] [c068f060] kernel_init_freeable+0x184/0x230
[c084fee0] [c00027e4] kernel_init+0x24/0x124
[c084ff00] [c000f1fc] ret_from_kernel_user_thread+0x14/0x1c
--- interrupt: 0 at 0x0
NIP: 00000000 LR: 00000000 CTR: 00000000
REGS: c084ff10 TRAP: 0000 Not tainted (6.5.0-rc6-gdef13277bacb)
MSR: 00000000 <> CR: 00000000 XER: 00000000
GPR00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
GPR08: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
GPR24: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
NIP [00000000] 0x0
LR [00000000] 0x0
--- interrupt: 0
Code: 91610008 90e1000c 4bffd0b5 80010014 38210010 7c0803a6 4e800020
409d0008 99230000 38630001 38840001 4240ffd0 <7d2a20ae> 7f851840
5528063e 2c080000
---[ end trace 0000000000000000 ]---
note: swapper[1] exited with irqs disabled
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
>
> What?
> These commits remove the sentinel element (last empty element) from the
> sysctl arrays of all the files under the "drivers/" directory that use a
> sysctl array for registration. The merging of the preparation patches
> (in https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
> to mainline allows us to just remove sentinel elements without changing
> behavior (more info here [1]).
>
> These commits are part of a bigger set (here
> https://github.com/Joelgranados/linux/tree/tag/sysctl_remove_empty_elem_V4)
> that remove the ctl_table sentinel. Make the review process easier by
> chunking the commits into manageable pieces. Each chunk can be reviewed
> separately without noise from parallel sets.
>
> Now that the architecture chunk has been mostly reviewed [6], we send
> the "drivers/" directory. Once this one is done, it will be follwed by
> "fs/*", "kernel/*", "net/*" and miscellaneous. The final set will remove
> the unneeded check for ->procname == NULL.
>
> Why?
> By removing the sysctl sentinel elements we avoid kernel bloat as
> ctl_table arrays get moved out of kernel/sysctl.c into their own
> respective subsystems. This move was started long ago to avoid merge
> conflicts; the sentinel removal bit came after Mathew Wilcox suggested
> it to avoid bloating the kernel by one element as arrays moved out. This
> patchset will reduce the overall build time size of the kernel and run
> time memory bloat by about ~64 bytes per declared ctl_table array. I
> have consolidated some links that shed light on the history of this
> effort [2].
>
> Testing:
> * Ran sysctl selftests (./tools/testing/selftests/sysctl/sysctl.sh)
> * Ran this through 0-day with no errors or warnings
>
> Size saving after removing all sentinels:
> These are the bytes that we save after removing all the sentinels
> (this plus all the other chunks). I included them to get an idea of
> how much memory we are talking about.
> * bloat-o-meter:
> - The "yesall" configuration results save 9158 bytes
> https://lore.kernel.org/all/20230621091000.424843-1-j.granados@samsung.com/
> - The "tiny" config + CONFIG_SYSCTL save 1215 bytes
> https://lore.kernel.org/all/20230809105006.1198165-1-j.granados@samsung.com/
> * memory usage:
> In memory savings are measured to be 7296 bytes. (here is how to
> measure [3])
>
> Size saving after this patchset:
> * bloat-o-meter
> - The "yesall" config saves 2432 bytes [4]
> - The "tiny" config saves 64 bytes [5]
> * memory usage:
> In this case there were no bytes saved because I do not have any
> of the drivers in the patch. To measure it comment the printk in
> `new_dir` and uncomment the if conditional in `new_links` [3].
>
> Comments/feedback greatly appreciated
>
> Best
> Joel
>
> [1]
> We are able to remove a sentinel table without behavioral change by
> introducing a table_size argument in the same place where procname is
> checked for NULL. The idea is for it to keep stopping when it hits
> ->procname == NULL, while the sentinel is still present. And when the
> sentinel is removed, it will stop on the table_size. You can go to
> (https://lore.kernel.org/all/20230809105006.1198165-1-j.granados@samsung.com/)
> for more information.
>
> [2]
> Links Related to the ctl_table sentinel removal:
> * Good summary from Luis sent with the "pull request" for the
> preparation patches.
> https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/
> * Another very good summary from Luis.
> https://lore.kernel.org/all/ZMFizKFkVxUFtSqa@bombadil.infradead.org/
> * This is a patch set that replaces register_sysctl_table with register_sysctl
> https://lore.kernel.org/all/20230302204612.782387-1-mcgrof@kernel.org/
> * Patch set to deprecate register_sysctl_paths()
> https://lore.kernel.org/all/20230302202826.776286-1-mcgrof@kernel.org/
> * Here there is an explicit expectation for the removal of the sentinel element.
> https://lore.kernel.org/all/20230321130908.6972-1-frank.li@vivo.com
> * The "ARRAY_SIZE" approach was mentioned (proposed?) in this thread
> https://lore.kernel.org/all/20220220060626.15885-1-tangmeng@uniontech.com
>
> [3]
> To measure the in memory savings apply this on top of this patchset.
>
> "
> 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;
> "
> and then run the following bash script in the kernel:
>
> accum=0
> for n in $(dmesg | grep kzalloc | awk '{print $3}') ; do
> echo $n
> accum=$(calc "$accum + $n")
> done
> echo $accum
>
> [4]
> add/remove: 0/0 grow/shrink: 0/21 up/down: 0/-2432 (-2432)
> Function old new delta
> xpc_sys_xpc_hb 192 128 -64
> xpc_sys_xpc 128 64 -64
> vrf_table 128 64 -64
> ucma_ctl_table 128 64 -64
> tty_table 192 128 -64
> sg_sysctls 128 64 -64
> scsi_table 128 64 -64
> random_table 448 384 -64
> raid_table 192 128 -64
> oa_table 192 128 -64
> mac_hid_files 256 192 -64
> iwcm_ctl_table 128 64 -64
> ipmi_table 128 64 -64
> hv_ctl_table 128 64 -64
> hpet_table 128 64 -64
> firmware_config_table 192 128 -64
> cdrom_table 448 384 -64
> balloon_table 128 64 -64
> parport_sysctl_template 912 720 -192
> parport_default_sysctl_table 584 136 -448
> parport_device_sysctl_template 776 136 -640
> Total: Before=429940038, After=429937606, chg -0.00%
>
> [5]
> add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-64 (-64)
> Function old new delta
> random_table 448 384 -64
> Total: Before=1885527, After=1885463, chg -0.00%
>
> [6] https://lore.kernel.org/all/20230913-jag-sysctl_remove_empty_elem_arch-v2-0-d1bd13a29bae@samsung.com/
>
> Signed-off-by: Joel Granados <j.granados@samsung.com>
>
> ---
>
> ---
> Joel Granados (15):
> cdrom: Remove now superfluous sentinel element from ctl_table array
> hpet: Remove now superfluous sentinel element from ctl_table array
> xen: Remove now superfluous sentinel element from ctl_table array
> tty: Remove now superfluous sentinel element from ctl_table array
> scsi: Remove now superfluous sentinel element from ctl_table array
> parport: Remove the now superfluous sentinel element from ctl_table array
> macintosh: Remove the now superfluous sentinel element from ctl_table array
> infiniband: Remove the now superfluous sentinel element from ctl_table array
> char-misc: Remove the now superfluous sentinel element from ctl_table array
> vrf: Remove the now superfluous sentinel element from ctl_table array
> sgi-xp: Remove the now superfluous sentinel element from ctl_table array
> fw loader: Remove the now superfluous sentinel element from ctl_table array
> raid: Remove now superfluous sentinel element from ctl_table array
> hyper-v/azure: Remove now superfluous sentinel element from ctl_table array
> intel drm: Remove now superfluous sentinel element from ctl_table array
>
> drivers/base/firmware_loader/fallback_table.c | 3 +-
> drivers/cdrom/cdrom.c | 3 +-
> drivers/char/hpet.c | 3 +-
> drivers/char/ipmi/ipmi_poweroff.c | 3 +-
> drivers/char/random.c | 3 +-
> drivers/gpu/drm/i915/i915_perf.c | 3 +-
> drivers/hv/hv_common.c | 3 +-
> drivers/infiniband/core/iwcm.c | 3 +-
> drivers/infiniband/core/ucma.c | 3 +-
> drivers/macintosh/mac_hid.c | 3 +-
> drivers/md/md.c | 3 +-
> drivers/misc/sgi-xp/xpc_main.c | 6 ++--
> drivers/net/vrf.c | 3 +-
> drivers/parport/procfs.c | 42 ++++++++++++---------------
> drivers/scsi/scsi_sysctl.c | 3 +-
> drivers/scsi/sg.c | 3 +-
> drivers/tty/tty_io.c | 3 +-
> drivers/xen/balloon.c | 3 +-
> 18 files changed, 36 insertions(+), 60 deletions(-)
> ---
> base-commit: 0e945134b680040b8613e962f586d91b6d40292d
> change-id: 20230927-jag-sysctl_remove_empty_elem_drivers-f034962a0d8c
>
> Best regards,
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 11/15] sgi-xp: Remove the now superfluous sentinel element from ctl_table array
[not found] ` <=?utf-8?q?=3C20230928-jag-sysctl=5Fremove=5Fempty=5Felem=5Fdrive?=>
@ 2023-09-28 17:51 ` Steve Wahl
2023-09-29 12:14 ` Joel Granados
0 siblings, 1 reply; 32+ messages in thread
From: Steve Wahl @ 2023-09-28 17:51 UTC (permalink / raw)
To: j.granados
Cc: Jason A. Donenfeld, Steve Wahl, Clemens Ladisch, linux-hyperv,
dri-devel, Phillip Potter, Song Liu, Eric Dumazet,
K. Y. Srinivasan, Jiri Slaby, Russ Weight, Wei Liu,
Stefano Stabellini, Corey Minyard, Leon Romanovsky, linux-rdma,
Rafael J. Wysocki, Dexuan Cui, willy, Jason Gunthorpe,
linux-serial, Doug Gilbert, Jakub Kicinski, Paolo Abeni,
Haiyang Zhang, Kees Cook, Arnd Bergmann, linux-kernel,
James E.J. Bottomley, intel-gfx, josh, linux-raid, Rodrigo Vivi,
xen-devel, openipmi-developer, Juergen Gross, Tvrtko Ursulin,
Theodore Ts'o, linux-scsi, Martin K. Petersen,
Greg Kroah-Hartman, David Ahern, Robin Holt, David S. Miller,
Oleksandr Tyshchenko, Luis Chamberlain, netdev, linuxppc-dev,
Sudip Mukherjee
On Thu, Sep 28, 2023 at 03:21:36PM +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 sentinel from xpc_sys_xpc_hb and xpc_sys_xpc
>
> Signed-off-by: Joel Granados <j.granados@samsung.com>
> ---
> drivers/misc/sgi-xp/xpc_main.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c
> index 6da509d692bb..c898092ff3ac 100644
> --- a/drivers/misc/sgi-xp/xpc_main.c
> +++ b/drivers/misc/sgi-xp/xpc_main.c
> @@ -109,8 +109,7 @@ static struct ctl_table xpc_sys_xpc_hb[] = {
> .mode = 0644,
> .proc_handler = proc_dointvec_minmax,
> .extra1 = &xpc_hb_check_min_interval,
> - .extra2 = &xpc_hb_check_max_interval},
> - {}
> + .extra2 = &xpc_hb_check_max_interval}
> };
> static struct ctl_table xpc_sys_xpc[] = {
> {
> @@ -120,8 +119,7 @@ static struct ctl_table xpc_sys_xpc[] = {
> .mode = 0644,
> .proc_handler = proc_dointvec_minmax,
> .extra1 = &xpc_disengage_min_timelimit,
> - .extra2 = &xpc_disengage_max_timelimit},
> - {}
> + .extra2 = &xpc_disengage_max_timelimit}
> };
>
> static struct ctl_table_header *xpc_sysctl;
>
> --
> 2.30.2
>
I assume you'll match the rest of the changes with regards to the
trailing comma.
Reviewed-by: Steve Wahl <steve.wahl@hpe.com>
--
Steve Wahl, Hewlett Packard Enterprise
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 11/15] sgi-xp: Remove the now superfluous sentinel element from ctl_table array
2023-09-28 17:51 ` [PATCH 11/15] sgi-xp: Remove the now superfluous sentinel element from ctl_table array Steve Wahl
@ 2023-09-29 12:14 ` Joel Granados
0 siblings, 0 replies; 32+ messages in thread
From: Joel Granados @ 2023-09-29 12:14 UTC (permalink / raw)
To: Steve Wahl
Cc: Jason A. Donenfeld, Rafael J. Wysocki, Clemens Ladisch,
linux-hyperv, dri-devel, Phillip Potter, Song Liu, Eric Dumazet,
K. Y. Srinivasan, Jiri Slaby, Russ Weight, Wei Liu,
Stefano Stabellini, Corey Minyard, Leon Romanovsky, linux-rdma,
Dexuan Cui, willy, Jason Gunthorpe, linux-serial, Doug Gilbert,
Jakub Kicinski, Paolo Abeni, Haiyang Zhang, Kees Cook,
Arnd Bergmann, linux-kernel, James E.J. Bottomley, intel-gfx,
josh, linux-raid, Rodrigo Vivi, xen-devel, openipmi-developer,
Juergen Gross, Tvrtko Ursulin, Theodore Ts'o, linux-scsi,
Martin K. Petersen, Greg Kroah-Hartman, David Ahern, Robin Holt,
David S. Miller, Oleksandr Tyshchenko, Luis Chamberlain, netdev,
linuxppc-dev, Sudip Mukherjee
[-- Attachment #1: Type: text/plain, Size: 2079 bytes --]
On Thu, Sep 28, 2023 at 12:51:15PM -0500, Steve Wahl wrote:
> On Thu, Sep 28, 2023 at 03:21:36PM +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 sentinel from xpc_sys_xpc_hb and xpc_sys_xpc
> >
> > Signed-off-by: Joel Granados <j.granados@samsung.com>
> > ---
> > drivers/misc/sgi-xp/xpc_main.c | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c
> > index 6da509d692bb..c898092ff3ac 100644
> > --- a/drivers/misc/sgi-xp/xpc_main.c
> > +++ b/drivers/misc/sgi-xp/xpc_main.c
> > @@ -109,8 +109,7 @@ static struct ctl_table xpc_sys_xpc_hb[] = {
> > .mode = 0644,
> > .proc_handler = proc_dointvec_minmax,
> > .extra1 = &xpc_hb_check_min_interval,
> > - .extra2 = &xpc_hb_check_max_interval},
> > - {}
> > + .extra2 = &xpc_hb_check_max_interval}
> > };
> > static struct ctl_table xpc_sys_xpc[] = {
> > {
> > @@ -120,8 +119,7 @@ static struct ctl_table xpc_sys_xpc[] = {
> > .mode = 0644,
> > .proc_handler = proc_dointvec_minmax,
> > .extra1 = &xpc_disengage_min_timelimit,
> > - .extra2 = &xpc_disengage_max_timelimit},
> > - {}
> > + .extra2 = &xpc_disengage_max_timelimit}
> > };
> >
> > static struct ctl_table_header *xpc_sysctl;
> >
> > --
> > 2.30.2
> >
>
> I assume you'll match the rest of the changes with regards to the
> trailing comma.
If you are refering to Greg's comments. yes. I'll send a V2 with the
trailing comma.
Best
>
> Reviewed-by: Steve Wahl <steve.wahl@hpe.com>
>
> --
> Steve Wahl, Hewlett Packard Enterprise
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 14/15] hyper-v/azure: Remove now superfluous sentinel element from ctl_table array
2023-09-28 15:26 ` [PATCH 14/15] hyper-v/azure: " Wei Liu
@ 2023-09-29 12:15 ` Joel Granados
2023-09-29 14:03 ` Joel Granados
1 sibling, 0 replies; 32+ messages in thread
From: Joel Granados @ 2023-09-29 12:15 UTC (permalink / raw)
To: Wei Liu
Cc: Jason A. Donenfeld, Steve Wahl, Clemens Ladisch, linux-hyperv,
dri-devel, Phillip Potter, Song Liu, Eric Dumazet,
K. Y. Srinivasan, Jiri Slaby, Russ Weight, Stefano Stabellini,
Corey Minyard, Leon Romanovsky, linux-rdma, Rafael J. Wysocki,
Dexuan Cui, willy, Jason Gunthorpe, linux-serial, Doug Gilbert,
Jakub Kicinski, Paolo Abeni, Haiyang Zhang, Kees Cook,
Arnd Bergmann, linux-kernel, James E.J. Bottomley, intel-gfx,
josh, linux-raid, Rodrigo Vivi, xen-devel, openipmi-developer,
Juergen Gross, Tvrtko Ursulin, Theodore Ts'o, linux-scsi,
Martin K. Petersen, Greg Kroah-Hartman, David Ahern, Robin Holt,
David S. Miller, Oleksandr Tyshchenko, Luis Chamberlain, netdev,
linuxppc-dev, Sudip Mukherjee
[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]
On Thu, Sep 28, 2023 at 03:26:16PM +0000, Wei Liu wrote:
> Please change the prefix to "Drivers: hv:" in the subject line in the
> two patches.
>
> On Thu, Sep 28, 2023 at 03:21:39PM +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 sentinel from hv_ctl_table
> >
> > Signed-off-by: Joel Granados <j.granados@samsung.com>
> > ---
> > drivers/hv/hv_common.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c
> > index ccad7bca3fd3..bc7d678030aa 100644
> > --- a/drivers/hv/hv_common.c
> > +++ b/drivers/hv/hv_common.c
> > @@ -147,8 +147,7 @@ static struct ctl_table hv_ctl_table[] = {
> > .proc_handler = proc_dointvec_minmax,
> > .extra1 = SYSCTL_ZERO,
> > .extra2 = SYSCTL_ONE
> > - },
> > - {}
> > + }
>
> Please keep the comma at the end.
My V2 will have this.
>
> > };
> >
> > static int hv_die_panic_notify_crash(struct notifier_block *self,
> >
> > --
> > 2.30.2
> >
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 01/15] cdrom: Remove now superfluous sentinel element from ctl_table array
2023-09-28 13:36 ` Greg Kroah-Hartman
@ 2023-09-29 12:17 ` Joel Granados
2023-09-30 16:52 ` Phillip Potter
0 siblings, 1 reply; 32+ messages in thread
From: Joel Granados @ 2023-09-29 12:17 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Jason A. Donenfeld, Steve Wahl, Clemens Ladisch, linux-hyperv,
dri-devel, Phillip Potter, Song Liu, Eric Dumazet,
K. Y. Srinivasan, Jiri Slaby, Russ Weight, Wei Liu,
Stefano Stabellini, Corey Minyard, Leon Romanovsky, linux-rdma,
Rafael J. Wysocki, Dexuan Cui, willy, Jason Gunthorpe,
linux-serial, Doug Gilbert, Jakub Kicinski, Paolo Abeni,
Haiyang Zhang, Kees Cook, Arnd Bergmann, linux-kernel,
James E.J. Bottomley, intel-gfx, josh, linux-raid, Rodrigo Vivi,
xen-devel, openipmi-developer, Juergen Gross, Tvrtko Ursulin,
Theodore Ts'o, linux-scsi, Martin K. Petersen, netdev,
David Ahern, Robin Holt, Sudip Mukherjee, Oleksandr Tyshchenko,
Luis Chamberlain, linuxppc-dev, David S. Miller
[-- Attachment #1: Type: text/plain, Size: 1554 bytes --]
On Thu, Sep 28, 2023 at 03:36:55PM +0200, Greg Kroah-Hartman wrote:
> On Thu, Sep 28, 2023 at 03:21:26PM +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 sentinel element from cdrom_table
> >
> > Signed-off-by: Joel Granados <j.granados@samsung.com>
> > ---
> > drivers/cdrom/cdrom.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
> > index cc2839805983..451907ade389 100644
> > --- a/drivers/cdrom/cdrom.c
> > +++ b/drivers/cdrom/cdrom.c
> > @@ -3654,8 +3654,7 @@ static struct ctl_table cdrom_table[] = {
> > .maxlen = sizeof(int),
> > .mode = 0644,
> > .proc_handler = cdrom_sysctl_handler
> > - },
> > - { }
> > + }
>
> You should have the final entry as "}," so as to make any future
> additions to the list to only contain that entry, that's long been the
> kernel style for lists like this.
Will send a V2 with this included. Thx.
>
> So your patches will just remove one line, not 2 and add 1, making it a
> smaller diff.
indeed.
>
> thanks,
>
> greg k-h
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 14/15] hyper-v/azure: Remove now superfluous sentinel element from ctl_table array
2023-09-28 15:26 ` [PATCH 14/15] hyper-v/azure: " Wei Liu
2023-09-29 12:15 ` Joel Granados
@ 2023-09-29 14:03 ` Joel Granados
1 sibling, 0 replies; 32+ messages in thread
From: Joel Granados @ 2023-09-29 14:03 UTC (permalink / raw)
To: Wei Liu
Cc: Jason A. Donenfeld, Steve Wahl, Clemens Ladisch, linux-hyperv,
dri-devel, Phillip Potter, Song Liu, Eric Dumazet,
K. Y. Srinivasan, Jiri Slaby, Russ Weight, Stefano Stabellini,
Corey Minyard, Leon Romanovsky, linux-rdma, Rafael J. Wysocki,
Dexuan Cui, willy, Jason Gunthorpe, linux-serial, Doug Gilbert,
Jakub Kicinski, Paolo Abeni, Haiyang Zhang, Kees Cook,
Arnd Bergmann, linux-kernel, James E.J. Bottomley, intel-gfx,
josh, linux-raid, Rodrigo Vivi, xen-devel, openipmi-developer,
Juergen Gross, Tvrtko Ursulin, Theodore Ts'o, linux-scsi,
Martin K. Petersen, Greg Kroah-Hartman, David Ahern, Robin Holt,
David S. Miller, Oleksandr Tyshchenko, Luis Chamberlain, netdev,
linuxppc-dev, Sudip Mukherjee
[-- Attachment #1: Type: text/plain, Size: 1610 bytes --]
On Thu, Sep 28, 2023 at 03:26:16PM +0000, Wei Liu wrote:
> Please change the prefix to "Drivers: hv:" in the subject line in the
> two patches.
I'll change the commit message for the 14/15 patch from "hyper-v/azure"
to "Drivers: hv:". But I only see one patch that needs this. Which is
the other one?
best
>
> On Thu, Sep 28, 2023 at 03:21:39PM +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 sentinel from hv_ctl_table
> >
> > Signed-off-by: Joel Granados <j.granados@samsung.com>
> > ---
> > drivers/hv/hv_common.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c
> > index ccad7bca3fd3..bc7d678030aa 100644
> > --- a/drivers/hv/hv_common.c
> > +++ b/drivers/hv/hv_common.c
> > @@ -147,8 +147,7 @@ static struct ctl_table hv_ctl_table[] = {
> > .proc_handler = proc_dointvec_minmax,
> > .extra1 = SYSCTL_ZERO,
> > .extra2 = SYSCTL_ONE
> > - },
> > - {}
> > + }
>
> Please keep the comma at the end.
>
> > };
> >
> > static int hv_die_panic_notify_crash(struct notifier_block *self,
> >
> > --
> > 2.30.2
> >
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 01/15] cdrom: Remove now superfluous sentinel element from ctl_table array
2023-09-29 12:17 ` Joel Granados
@ 2023-09-30 16:52 ` Phillip Potter
2023-10-02 7:39 ` Joel Granados
0 siblings, 1 reply; 32+ messages in thread
From: Phillip Potter @ 2023-09-30 16:52 UTC (permalink / raw)
To: Joel Granados
Cc: Jason A. Donenfeld, Steve Wahl, Clemens Ladisch, linux-hyperv,
dri-devel, linux-kernel, Song Liu, Eric Dumazet,
K. Y. Srinivasan, Jiri Slaby, Russ Weight, Wei Liu,
Stefano Stabellini, Corey Minyard, Leon Romanovsky, linux-rdma,
Rafael J. Wysocki, Dexuan Cui, willy, Jason Gunthorpe,
linux-serial, Doug Gilbert, Jakub Kicinski, Paolo Abeni,
Haiyang Zhang, Kees Cook, Arnd Bergmann, James E.J. Bottomley,
intel-gfx, josh, linux-raid, Rodrigo Vivi, xen-devel,
openipmi-developer, Juergen Gross, Tvrtko Ursulin,
Theodore Ts'o, linux-scsi, Martin K. Petersen, netdev,
David Ahern, Robin Holt, Sudip Mukherjee, Oleksandr Tyshchenko,
Luis Chamberlain, Greg Kroah-Hartman, linuxppc-dev,
David S. Miller
On Fri, Sep 29, 2023 at 02:17:30PM +0200, Joel Granados wrote:
> On Thu, Sep 28, 2023 at 03:36:55PM +0200, Greg Kroah-Hartman wrote:
> > On Thu, Sep 28, 2023 at 03:21:26PM +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 sentinel element from cdrom_table
> > >
> > > Signed-off-by: Joel Granados <j.granados@samsung.com>
> > > ---
> > > drivers/cdrom/cdrom.c | 3 +--
> > > 1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
> > > index cc2839805983..451907ade389 100644
> > > --- a/drivers/cdrom/cdrom.c
> > > +++ b/drivers/cdrom/cdrom.c
> > > @@ -3654,8 +3654,7 @@ static struct ctl_table cdrom_table[] = {
> > > .maxlen = sizeof(int),
> > > .mode = 0644,
> > > .proc_handler = cdrom_sysctl_handler
> > > - },
> > > - { }
> > > + }
> >
> > You should have the final entry as "}," so as to make any future
> > additions to the list to only contain that entry, that's long been the
> > kernel style for lists like this.
> Will send a V2 with this included. Thx.
>
> >
> > So your patches will just remove one line, not 2 and add 1, making it a
> > smaller diff.
> indeed.
>
> >
> > thanks,
> >
> > greg k-h
>
> --
>
> Joel Granados
Hi Joel,
Thank you for your patch. I look forward to seeing V2, and will be happy
to review it.
Regards,
Phil
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 01/15] cdrom: Remove now superfluous sentinel element from ctl_table array
2023-09-30 16:52 ` Phillip Potter
@ 2023-10-02 7:39 ` Joel Granados
0 siblings, 0 replies; 32+ messages in thread
From: Joel Granados @ 2023-10-02 7:39 UTC (permalink / raw)
To: Phillip Potter
Cc: Jason A. Donenfeld, Steve Wahl, Clemens Ladisch, linux-hyperv,
dri-devel, linux-kernel, Song Liu, Eric Dumazet,
K. Y. Srinivasan, Jiri Slaby, Russ Weight, Wei Liu,
Stefano Stabellini, Corey Minyard, Leon Romanovsky, linux-rdma,
Rafael J. Wysocki, Dexuan Cui, willy, Jason Gunthorpe,
linux-serial, Doug Gilbert, Jakub Kicinski, Paolo Abeni,
Haiyang Zhang, Kees Cook, Arnd Bergmann, James E.J. Bottomley,
intel-gfx, josh, linux-raid, Rodrigo Vivi, xen-devel,
openipmi-developer, Juergen Gross, Tvrtko Ursulin,
Theodore Ts'o, linux-scsi, Martin K. Petersen, netdev,
David Ahern, Robin Holt, Sudip Mukherjee, Oleksandr Tyshchenko,
Luis Chamberlain, Greg Kroah-Hartman, linuxppc-dev,
David S. Miller
[-- Attachment #1: Type: text/plain, Size: 2122 bytes --]
On Sat, Sep 30, 2023 at 05:52:17PM +0100, Phillip Potter wrote:
> On Fri, Sep 29, 2023 at 02:17:30PM +0200, Joel Granados wrote:
> > On Thu, Sep 28, 2023 at 03:36:55PM +0200, Greg Kroah-Hartman wrote:
> > > On Thu, Sep 28, 2023 at 03:21:26PM +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 sentinel element from cdrom_table
> > > >
> > > > Signed-off-by: Joel Granados <j.granados@samsung.com>
> > > > ---
> > > > drivers/cdrom/cdrom.c | 3 +--
> > > > 1 file changed, 1 insertion(+), 2 deletions(-)
> > > >
> > > > diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
> > > > index cc2839805983..451907ade389 100644
> > > > --- a/drivers/cdrom/cdrom.c
> > > > +++ b/drivers/cdrom/cdrom.c
> > > > @@ -3654,8 +3654,7 @@ static struct ctl_table cdrom_table[] = {
> > > > .maxlen = sizeof(int),
> > > > .mode = 0644,
> > > > .proc_handler = cdrom_sysctl_handler
> > > > - },
> > > > - { }
> > > > + }
> > >
> > > You should have the final entry as "}," so as to make any future
> > > additions to the list to only contain that entry, that's long been the
> > > kernel style for lists like this.
> > Will send a V2 with this included. Thx.
> >
> > >
> > > So your patches will just remove one line, not 2 and add 1, making it a
> > > smaller diff.
> > indeed.
> >
> > >
> > > thanks,
> > >
> > > greg k-h
> >
> > --
> >
> > Joel Granados
>
> Hi Joel,
>
> Thank you for your patch. I look forward to seeing V2, and will be happy
> to review it.
Am following a reported oops. Once I straighten that out, I'll send out
a V2
Bet
>
> Regards,
> Phil
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 04/15] tty: Remove now superfluous sentinel element from ctl_table array
2023-09-28 13:21 ` [PATCH 04/15] tty: " Joel Granados via B4 Relay
@ 2023-10-02 8:17 ` Jiri Slaby
2023-10-02 8:47 ` Christophe Leroy
0 siblings, 1 reply; 32+ messages in thread
From: Jiri Slaby @ 2023-10-02 8:17 UTC (permalink / raw)
To: j.granados, Luis Chamberlain, willy, josh, Kees Cook,
Phillip Potter, Clemens Ladisch, Arnd Bergmann,
Greg Kroah-Hartman, Juergen Gross, Stefano Stabellini,
Oleksandr Tyshchenko, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: linux-hyperv, linux-scsi, linux-rdma, netdev, intel-gfx,
linux-kernel, dri-devel, linux-raid, linux-serial, xen-devel,
openipmi-developer, linuxppc-dev
On 28. 09. 23, 15:21, 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 sentinel from tty_table
>
> Signed-off-by: Joel Granados <j.granados@samsung.com>
> ---
> drivers/tty/tty_io.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
> index 8a94e5a43c6d..2f925dc54a20 100644
> --- a/drivers/tty/tty_io.c
> +++ b/drivers/tty/tty_io.c
> @@ -3607,8 +3607,7 @@ static struct ctl_table tty_table[] = {
> .proc_handler = proc_dointvec,
> .extra1 = SYSCTL_ZERO,
> .extra2 = SYSCTL_ONE,
> - },
> - { }
> + }
Why to remove the comma? One would need to add one when adding a new entry?
thanks,
--
js
suse labs
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 00/15] sysctl: Remove sentinel elements from drivers
2023-09-28 16:31 ` [PATCH 00/15] sysctl: Remove sentinel elements from drivers Christophe Leroy
@ 2023-10-02 8:47 ` Joel Granados
2023-10-02 9:02 ` Christophe Leroy
0 siblings, 1 reply; 32+ messages in thread
From: Joel Granados @ 2023-10-02 8:47 UTC (permalink / raw)
To: Christophe Leroy
Cc: Jason A. Donenfeld, Steve Wahl, Clemens Ladisch, linux-hyperv,
dri-devel, Phillip Potter, Song Liu, Eric Dumazet,
K. Y. Srinivasan, Jiri Slaby, Russ Weight, Wei Liu,
Stefano Stabellini, Corey Minyard, Leon Romanovsky, linux-rdma,
Rafael J. Wysocki, Dexuan Cui, willy, Jason Gunthorpe,
linux-serial, Doug Gilbert, Jakub Kicinski, Paolo Abeni,
Haiyang Zhang, Kees Cook, Arnd Bergmann, linux-kernel,
James E.J. Bottomley, josh, linux-raid, Rodrigo Vivi, xen-devel,
openipmi-developer, Juergen Gross, Tvrtko Ursulin,
Theodore Ts'o, linux-scsi, Martin K. Petersen,
Greg Kroah-Hartman, David Ahern, linuxppc-dev, Robin Holt,
David S. Miller, Oleksandr Tyshchenko, Luis Chamberlain, netdev,
intel-gfx, Sudip Mukherjee
[-- Attachment #1: Type: text/plain, Size: 5216 bytes --]
On Thu, Sep 28, 2023 at 04:31:30PM +0000, Christophe Leroy wrote:
>
>
> Le 28/09/2023 à 15:21, Joel Granados via B4 Relay a écrit :
> > From: Joel Granados <j.granados@samsung.com>
>
> Automatic test fails on powerpc, see
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20230928-jag-sysctl_remove_empty_elem_drivers-v1-15-e59120fca9f9@samsung.com/
From this I got to this URL
https://github.com/linuxppc/linux-snowpatch/actions/runs/6339718136/job/17221399242
and saw this message "sysctl table check failed: dev/tty/ No proc_handler".
This means that we hit the check for entry->proc_handler in
sysctl_check_table.
>
> Kernel attempted to read user page (1a111316) - exploit attempt? (uid: 0)
> BUG: Unable to handle kernel data access on read at 0x1a111316
> Faulting instruction address: 0xc0545338
> Oops: Kernel access of bad area, sig: 11 [#1]
> BE PAGE_SIZE=4K PowerPC 44x Platform
> Modules linked in:
> CPU: 0 PID: 1 Comm: swapper Not tainted 6.5.0-rc6-gdef13277bacb #1
> Hardware name: amcc,bamboo 440GR Rev. B 0x422218d3 PowerPC 44x Platform
> NIP: c0545338 LR: c0548468 CTR: ffffffff
> REGS: c084fae0 TRAP: 0300 Not tainted (6.5.0-rc6-gdef13277bacb)
> MSR: 00021000 <CE,ME> CR: 84004288 XER: 00000000
> DEAR: 1a111316 ESR: 00000000
> GPR00: c0548468 c084fbd0 c0888000 c084fc99 00000000 c084fc7c 1a110316
> 000affff
> GPR08: ffffffff c084fd18 1a111316 04ffffff 22000282 00000000 c00027c0
> 00000000
> GPR16: 00000000 00000000 c0040000 c003d544 00000001 c003eb2c 096023d4
> 00000000
> GPR24: c0636502 c0636502 c084fc74 c0588510 c084fc68 c084fc7c c084fc99
> 00000002
> NIP [c0545338] string+0x78/0x148
> LR [c0548468] vsnprintf+0x3d8/0x824
> Call Trace:
> [c084fbd0] [c084fc7c] 0xc084fc7c (unreliable)
> [c084fbe0] [c0548468] vsnprintf+0x3d8/0x824
> [c084fc30] [c0072dec] vprintk_store+0x17c/0x4c8
> [c084fcc0] [c007322c] vprintk_emit+0xf4/0x2a0
> [c084fd00] [c0073d04] _printk+0x60/0x88
> [c084fd40] [c01ab63c] sysctl_err+0x78/0xa4
> [c084fd80] [c01ab404] __register_sysctl_table+0x6a0/0x6c4
> [c084fde0] [c06a585c] __register_sysctl_init+0x30/0x78
> [c084fe00] [c06a8cc8] tty_init+0x44/0x168
> [c084fe30] [c00023c4] do_one_initcall+0x64/0x2a0
> [c084fea0] [c068f060] kernel_init_freeable+0x184/0x230
> [c084fee0] [c00027e4] kernel_init+0x24/0x124
> [c084ff00] [c000f1fc] ret_from_kernel_user_thread+0x14/0x1c
I followed this trace and proc_handler is correctly defined in tty_table
(struct ctl_table) in drivers/tty/tty_io.c:tty_init and there is not
path that changes these values.
Additionally, we then fail trying to print instead of continuing with
the initialization. My conjecture is that this might be due to something
different than tht sysctl register call.
Does this happen consistenly or is this just a one off issue?
To what branch are these patches being applied to?
I'm going to post my V2 and keep working on this issue if it pops up
again.
Thx for the report
Best
> --- interrupt: 0 at 0x0
> NIP: 00000000 LR: 00000000 CTR: 00000000
> REGS: c084ff10 TRAP: 0000 Not tainted (6.5.0-rc6-gdef13277bacb)
> MSR: 00000000 <> CR: 00000000 XER: 00000000
>
> GPR00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> 00000000
> GPR08: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> 00000000
> GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> 00000000
> GPR24: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> 00000000
> NIP [00000000] 0x0
> LR [00000000] 0x0
> --- interrupt: 0
> Code: 91610008 90e1000c 4bffd0b5 80010014 38210010 7c0803a6 4e800020
> 409d0008 99230000 38630001 38840001 4240ffd0 <7d2a20ae> 7f851840
> 5528063e 2c080000
> ---[ end trace 0000000000000000 ]---
>
> note: swapper[1] exited with irqs disabled
> Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
>
>
> >
> > What?
> > These commits remove the sentinel element (last empty element) from the
> > sysctl arrays of all the files under the "drivers/" directory that use a
> > sysctl array for registration. The merging of the preparation patches
> > (in https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
> > to mainline allows us to just remove sentinel elements without changing
> > behavior (more info here [1]).
<--- snip --->
> > drivers/macintosh/mac_hid.c | 3 +-
> > drivers/md/md.c | 3 +-
> > drivers/misc/sgi-xp/xpc_main.c | 6 ++--
> > drivers/net/vrf.c | 3 +-
> > drivers/parport/procfs.c | 42 ++++++++++++---------------
> > drivers/scsi/scsi_sysctl.c | 3 +-
> > drivers/scsi/sg.c | 3 +-
> > drivers/tty/tty_io.c | 3 +-
> > drivers/xen/balloon.c | 3 +-
> > 18 files changed, 36 insertions(+), 60 deletions(-)
> > ---
> > base-commit: 0e945134b680040b8613e962f586d91b6d40292d
> > change-id: 20230927-jag-sysctl_remove_empty_elem_drivers-f034962a0d8c
> >
> > Best regards,
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 04/15] tty: Remove now superfluous sentinel element from ctl_table array
2023-10-02 8:17 ` Jiri Slaby
@ 2023-10-02 8:47 ` Christophe Leroy
2023-10-02 9:02 ` Greg Kroah-Hartman
0 siblings, 1 reply; 32+ messages in thread
From: Christophe Leroy @ 2023-10-02 8:47 UTC (permalink / raw)
To: Jiri Slaby, j.granados, Luis Chamberlain, willy, josh, Kees Cook,
Phillip Potter, Clemens Ladisch, Arnd Bergmann,
Greg Kroah-Hartman, Juergen Gross, Stefano Stabellini,
Oleksandr Tyshchenko, James E.J. Bottomley, Martin K. Petersen,
Doug Gilbert, Sudip Mukherjee, Jason Gunthorpe, Leon Romanovsky,
Corey Minyard, Theodore Ts'o, Jason A. Donenfeld,
David Ahern, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Robin Holt, Steve Wahl, Russ Weight,
Rafael J. Wysocki, Song Liu, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
Tvrtko Ursulin, David Airlie, Daniel Vetter
Cc: linux-hyperv, linux-scsi, linux-rdma, netdev, intel-gfx,
linux-kernel, dri-devel, linux-raid, linux-serial, xen-devel,
openipmi-developer, linuxppc-dev
Le 02/10/2023 à 10:17, Jiri Slaby a écrit :
> On 28. 09. 23, 15:21, 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 sentinel from tty_table
>>
>> Signed-off-by: Joel Granados <j.granados@samsung.com>
>> ---
>> drivers/tty/tty_io.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
>> index 8a94e5a43c6d..2f925dc54a20 100644
>> --- a/drivers/tty/tty_io.c
>> +++ b/drivers/tty/tty_io.c
>> @@ -3607,8 +3607,7 @@ static struct ctl_table tty_table[] = {
>> .proc_handler = proc_dointvec,
>> .extra1 = SYSCTL_ZERO,
>> .extra2 = SYSCTL_ONE,
>> - },
>> - { }
>> + }
>
> Why to remove the comma? One would need to add one when adding a new entry?
Does it make any difference at all ?
In one case you have:
@xxxx
something old,
},
+ {
+ something new,
+ },
}
In the other case you have:
@xxxx
something old,
+ },
+ {
+ something new,
}
}
Christophe
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 04/15] tty: Remove now superfluous sentinel element from ctl_table array
2023-10-02 8:47 ` Christophe Leroy
@ 2023-10-02 9:02 ` Greg Kroah-Hartman
0 siblings, 0 replies; 32+ messages in thread
From: Greg Kroah-Hartman @ 2023-10-02 9:02 UTC (permalink / raw)
To: Christophe Leroy
Cc: j.granados, Jason A. Donenfeld, Steve Wahl, Clemens Ladisch,
linux-hyperv, dri-devel, Phillip Potter, Song Liu, Eric Dumazet,
K. Y. Srinivasan, Jiri Slaby, Russ Weight, Wei Liu,
Stefano Stabellini, Corey Minyard, Leon Romanovsky, linux-rdma,
Rafael J. Wysocki, Dexuan Cui, willy, Jason Gunthorpe,
linux-serial, Doug Gilbert, Jakub Kicinski, Paolo Abeni,
Haiyang Zhang, Kees Cook, Arnd Bergmann, linux-kernel,
James E.J. Bottomley, josh, linux-raid, Rodrigo Vivi, xen-devel,
openipmi-developer, Juergen Gross, Tvrtko Ursulin,
Theodore Ts'o, linux-scsi, Martin K. Petersen, netdev,
David Ahern, linuxppc-dev, Robin Holt, David S. Miller,
Oleksandr Tyshchenko, Luis Chamberlain, intel-gfx,
Sudip Mukherjee
On Mon, Oct 02, 2023 at 08:47:53AM +0000, Christophe Leroy wrote:
>
>
> Le 02/10/2023 à 10:17, Jiri Slaby a écrit :
> > On 28. 09. 23, 15:21, 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 sentinel from tty_table
> >>
> >> Signed-off-by: Joel Granados <j.granados@samsung.com>
> >> ---
> >> drivers/tty/tty_io.c | 3 +--
> >> 1 file changed, 1 insertion(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
> >> index 8a94e5a43c6d..2f925dc54a20 100644
> >> --- a/drivers/tty/tty_io.c
> >> +++ b/drivers/tty/tty_io.c
> >> @@ -3607,8 +3607,7 @@ static struct ctl_table tty_table[] = {
> >> .proc_handler = proc_dointvec,
> >> .extra1 = SYSCTL_ZERO,
> >> .extra2 = SYSCTL_ONE,
> >> - },
> >> - { }
> >> + }
> >
> > Why to remove the comma? One would need to add one when adding a new entry?
>
> Does it make any difference at all ?
>
> In one case you have:
>
> @xxxx
> something old,
> },
> + {
> + something new,
> + },
> }
>
> In the other case you have:
>
> @xxxx
> something old,
> + },
> + {
> + something new,
> }
> }
Because that way it is obvious you are only touching the "something new"
lines and never have to touch the "something old" ones.
It's just a long-standing tradition in Linux, don't have an extra
character if you don't need it :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 00/15] sysctl: Remove sentinel elements from drivers
2023-10-02 8:47 ` Joel Granados
@ 2023-10-02 9:02 ` Christophe Leroy
0 siblings, 0 replies; 32+ messages in thread
From: Christophe Leroy @ 2023-10-02 9:02 UTC (permalink / raw)
To: Joel Granados
Cc: Jason A. Donenfeld, Steve Wahl, Clemens Ladisch, linux-hyperv,
dri-devel, Phillip Potter, Song Liu, Eric Dumazet,
K. Y. Srinivasan, Jiri Slaby, Russ Weight, Wei Liu,
Stefano Stabellini, Corey Minyard, Leon Romanovsky, linux-rdma,
Rafael J. Wysocki, Dexuan Cui, willy, Jason Gunthorpe,
linux-serial, Doug Gilbert, Jakub Kicinski, Paolo Abeni,
Haiyang Zhang, Kees Cook, Arnd Bergmann, linux-kernel,
James E.J. Bottomley, josh, linux-raid, Rodrigo Vivi, xen-devel,
openipmi-developer, Juergen Gross, Tvrtko Ursulin,
Theodore Ts'o, linux-scsi, Martin K. Petersen,
Greg Kroah-Hartman, David Ahern, linuxppc-dev, Robin Holt,
David S. Miller, Oleksandr Tyshchenko, Luis Chamberlain, netdev,
intel-gfx, Sudip Mukherjee
Le 02/10/2023 à 10:47, Joel Granados a écrit :
> On Thu, Sep 28, 2023 at 04:31:30PM +0000, Christophe Leroy wrote:
> I followed this trace and proc_handler is correctly defined in tty_table
> (struct ctl_table) in drivers/tty/tty_io.c:tty_init and there is not
> path that changes these values.
> Additionally, we then fail trying to print instead of continuing with
> the initialization. My conjecture is that this might be due to something
> different than tht sysctl register call.
>
> Does this happen consistenly or is this just a one off issue?
Don't know.
>
> To what branch are these patches being applied to?
As far as I understand from
https://github.com/linuxppc/linux-snowpatch/commits/snowpatch/375319,
it's being applied on
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=d774975
>
> I'm going to post my V2 and keep working on this issue if it pops up
> again.
>
Christophe
^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2023-10-02 9:04 UTC | newest]
Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-28 13:21 [PATCH 00/15] sysctl: Remove sentinel elements from drivers Joel Granados via B4 Relay
[not found] ` <20230928-jag-sysctl_remove_empty_elem_drive>
2023-09-28 13:21 ` [PATCH 01/15] cdrom: Remove now superfluous sentinel element from ctl_table array Joel Granados via B4 Relay
2023-09-28 13:36 ` Greg Kroah-Hartman
2023-09-29 12:17 ` Joel Granados
2023-09-30 16:52 ` Phillip Potter
2023-10-02 7:39 ` Joel Granados
2023-09-28 13:21 ` [PATCH 02/15] hpet: " Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 03/15] xen: " Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 04/15] tty: " Joel Granados via B4 Relay
2023-10-02 8:17 ` Jiri Slaby
2023-10-02 8:47 ` Christophe Leroy
2023-10-02 9:02 ` Greg Kroah-Hartman
2023-09-28 13:21 ` [PATCH 05/15] scsi: " Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 06/15] parport: Remove the " Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 07/15] macintosh: " Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 08/15] infiniband: " Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 09/15] char-misc: " Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 10/15] vrf: " Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 11/15] sgi-xp: " Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 12/15] fw loader: " Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 13/15] raid: Remove " Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 14/15] hyper-v/azure: " Joel Granados via B4 Relay
2023-09-28 13:21 ` [PATCH 15/15] intel drm: " Joel Granados via B4 Relay
[not found] ` <65157da7.5d0a0220.13b5e.9e95SMTPIN_ADDED_BROKEN@mx.google.com>
2023-09-28 15:20 ` [PATCH 13/15] raid: " Song Liu
[not found] ` <65157da8.050a0220.fb263.fdb1SMTPIN_ADDED_BROKEN@mx.google.com>
2023-09-28 15:26 ` [PATCH 14/15] hyper-v/azure: " Wei Liu
2023-09-29 12:15 ` Joel Granados
2023-09-29 14:03 ` Joel Granados
2023-09-28 16:31 ` [PATCH 00/15] sysctl: Remove sentinel elements from drivers Christophe Leroy
2023-10-02 8:47 ` Joel Granados
2023-10-02 9:02 ` Christophe Leroy
[not found] ` <=?utf-8?q?=3C20230928-jag-sysctl=5Fremove=5Fempty=5Felem=5Fdrive?=>
2023-09-28 17:51 ` [PATCH 11/15] sgi-xp: Remove the now superfluous sentinel element from ctl_table array Steve Wahl
2023-09-29 12:14 ` Joel Granados
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).