Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'sysctl-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux

Pull sysctl updates from Luis Chamberlain:
"To help make the move of sysctls out of kernel/sysctl.c not incur a
size penalty sysctl has been changed to allow us to not require the
sentinel, the final empty element on the sysctl array. Joel Granados
has been doing all this work. On the v6.6 kernel we got the major
infrastructure changes required to support this. For v6.7-rc1 we have
all arch/ and drivers/ modified to remove the sentinel. Both arch and
driver changes have been on linux-next for a bit less than a month. It
is worth re-iterating the value:

- this helps reduce the overall build time size of the kernel and run
time memory consumed by the kernel by about ~64 bytes per array

- the extra 64-byte penalty is no longer inncurred now when we move
sysctls out from kernel/sysctl.c to their own files

For v6.8-rc1 expect removal of all the sentinels and also then the
unneeded check for procname == NULL.

The last two patches are fixes recently merged by Krister Johansen
which allow us again to use softlockup_panic early on boot. This used
to work but the alias work broke it. This is useful for folks who want
to detect softlockups super early rather than wait and spend money on
cloud solutions with nothing but an eventual hung kernel. Although
this hadn't gone through linux-next it's also a stable fix, so we
might as well roll through the fixes now"

* tag 'sysctl-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: (23 commits)
watchdog: move softlockup_panic back to early_param
proc: sysctl: prevent aliased sysctls from getting passed to init
intel drm: Remove now superfluous sentinel element from ctl_table array
Drivers: hv: Remove now superfluous sentinel element from ctl_table array
raid: Remove now superfluous sentinel element from ctl_table array
fw loader: Remove the now superfluous sentinel element from ctl_table array
sgi-xp: Remove the now superfluous sentinel element from ctl_table array
vrf: Remove the now superfluous sentinel element from ctl_table array
char-misc: Remove the now superfluous sentinel element from ctl_table array
infiniband: Remove the now superfluous sentinel element from ctl_table array
macintosh: Remove the now superfluous sentinel element from ctl_table array
parport: Remove the now superfluous sentinel element from ctl_table array
scsi: Remove now superfluous sentinel element from ctl_table array
tty: Remove now superfluous sentinel element from ctl_table array
xen: Remove now superfluous sentinel element from ctl_table array
hpet: Remove now superfluous sentinel element from ctl_table array
c-sky: Remove now superfluous sentinel element from ctl_talbe array
powerpc: Remove now superfluous sentinel element from ctl_table arrays
riscv: Remove now superfluous sentinel element from ctl_table array
x86/vdso: Remove now superfluous sentinel element from ctl_table array
...

+41 -60
+2 -2
arch/arm/kernel/isa.c
··· 16 16 17 17 static unsigned int isa_membase, isa_portbase, isa_portshift; 18 18 19 - static struct ctl_table ctl_isa_vars[4] = { 19 + static struct ctl_table ctl_isa_vars[] = { 20 20 { 21 21 .procname = "membase", 22 22 .data = &isa_membase, ··· 35 35 .maxlen = sizeof(isa_portshift), 36 36 .mode = 0444, 37 37 .proc_handler = proc_dointvec, 38 - }, {} 38 + }, 39 39 }; 40 40 41 41 static struct ctl_table_header *isa_sysctl_header;
+3 -5
arch/arm64/kernel/armv8_deprecated.c
··· 52 52 int min; 53 53 int max; 54 54 55 - /* 56 - * sysctl for this emulation + a sentinal entry. 57 - */ 58 - struct ctl_table sysctl[2]; 55 + /* sysctl for this emulation */ 56 + struct ctl_table sysctl; 59 57 }; 60 58 61 59 #define ARM_OPCODE_CONDTEST_FAIL 0 ··· 556 558 update_insn_emulation_mode(insn, INSN_UNDEF); 557 559 558 560 if (insn->status != INSN_UNAVAILABLE) { 559 - sysctl = &insn->sysctl[0]; 561 + sysctl = &insn->sysctl; 560 562 561 563 sysctl->mode = 0644; 562 564 sysctl->maxlen = sizeof(int);
-2
arch/arm64/kernel/fpsimd.c
··· 589 589 .proc_handler = vec_proc_do_default_vl, 590 590 .extra1 = &vl_info[ARM64_VEC_SVE], 591 591 }, 592 - { } 593 592 }; 594 593 595 594 static int __init sve_sysctl_init(void) ··· 612 613 .proc_handler = vec_proc_do_default_vl, 613 614 .extra1 = &vl_info[ARM64_VEC_SME], 614 615 }, 615 - { } 616 616 }; 617 617 618 618 static int __init sme_sysctl_init(void)
-1
arch/arm64/kernel/process.c
··· 724 724 .extra1 = SYSCTL_ZERO, 725 725 .extra2 = SYSCTL_ONE, 726 726 }, 727 - { } 728 727 }; 729 728 730 729 static int __init tagged_addr_init(void)
-1
arch/csky/abiv1/alignment.c
··· 329 329 .mode = 0666, 330 330 .proc_handler = &proc_dointvec 331 331 }, 332 - {} 333 332 }; 334 333 335 334 static int __init csky_alignment_init(void)
-1
arch/powerpc/kernel/idle.c
··· 105 105 .mode = 0644, 106 106 .proc_handler = proc_dointvec, 107 107 }, 108 - {} 109 108 }; 110 109 111 110 static int __init
-1
arch/powerpc/platforms/pseries/mobility.c
··· 61 61 .mode = 0644, 62 62 .proc_handler = proc_douintvec_minmax, 63 63 }, 64 - {} 65 64 }; 66 65 67 66 static int __init register_nmi_wd_lpm_factor_sysctl(void)
-1
arch/riscv/kernel/vector.c
··· 255 255 .mode = 0644, 256 256 .proc_handler = proc_dobool, 257 257 }, 258 - { } 259 258 }; 260 259 261 260 static int __init riscv_v_sysctl_init(void)
+1 -3
arch/s390/appldata/appldata_base.c
··· 63 63 .mode = S_IRUGO | S_IWUSR, 64 64 .proc_handler = appldata_interval_handler, 65 65 }, 66 - { }, 67 66 }; 68 67 69 68 /* ··· 350 351 if (ops->size > APPLDATA_MAX_REC_SIZE) 351 352 return -EINVAL; 352 353 353 - /* The last entry must be an empty one */ 354 - ops->ctl_table = kcalloc(2, sizeof(struct ctl_table), GFP_KERNEL); 354 + ops->ctl_table = kcalloc(1, sizeof(struct ctl_table), GFP_KERNEL); 355 355 if (!ops->ctl_table) 356 356 return -ENOMEM; 357 357
-1
arch/s390/kernel/debug.c
··· 978 978 .mode = S_IRUGO | S_IWUSR, 979 979 .proc_handler = s390dbf_procactive, 980 980 }, 981 - { } 982 981 }; 983 982 984 983 static struct ctl_table_header *s390dbf_sysctl_header;
-1
arch/s390/kernel/topology.c
··· 636 636 .mode = 0644, 637 637 .proc_handler = topology_ctl_handler, 638 638 }, 639 - { }, 640 639 }; 641 640 642 641 static int __init topology_init(void)
-1
arch/s390/mm/cmm.c
··· 332 332 .mode = 0644, 333 333 .proc_handler = cmm_timeout_handler, 334 334 }, 335 - { } 336 335 }; 337 336 338 337 #ifdef CONFIG_CMM_IUCV
-1
arch/s390/mm/pgalloc.c
··· 30 30 .extra1 = SYSCTL_ZERO, 31 31 .extra2 = SYSCTL_ONE, 32 32 }, 33 - { } 34 33 }; 35 34 36 35 static int __init page_table_register_sysctl(void)
-1
arch/x86/entry/vdso/vdso32-setup.c
··· 67 67 .extra1 = SYSCTL_ZERO, 68 68 .extra2 = SYSCTL_ONE, 69 69 }, 70 - {} 71 70 }; 72 71 73 72 static __init int ia32_binfmt_init(void)
-1
arch/x86/kernel/cpu/intel.c
··· 1003 1003 .extra1 = SYSCTL_ZERO, 1004 1004 .extra2 = SYSCTL_ONE, 1005 1005 }, 1006 - {} 1007 1006 }; 1008 1007 1009 1008 static int __init sld_mitigate_sysctl_init(void)
-1
arch/x86/kernel/itmt.c
··· 74 74 .extra1 = SYSCTL_ZERO, 75 75 .extra2 = SYSCTL_ONE, 76 76 }, 77 - {} 78 77 }; 79 78 80 79 static struct ctl_table_header *itmt_sysctl_header;
-1
drivers/base/firmware_loader/fallback_table.c
··· 44 44 .extra1 = SYSCTL_ZERO, 45 45 .extra2 = SYSCTL_ONE, 46 46 }, 47 - { } 48 47 }; 49 48 50 49 static struct ctl_table_header *firmware_config_sysct_table_header;
-1
drivers/char/hpet.c
··· 709 709 .mode = 0644, 710 710 .proc_handler = proc_dointvec, 711 711 }, 712 - {} 713 712 }; 714 713 715 714 static struct ctl_table_header *sysctl_header;
-1
drivers/char/ipmi/ipmi_poweroff.c
··· 656 656 .maxlen = sizeof(poweroff_powercycle), 657 657 .mode = 0644, 658 658 .proc_handler = proc_dointvec }, 659 - { } 660 659 }; 661 660 662 661 static struct ctl_table_header *ipmi_table_header;
-1
drivers/char/random.c
··· 1683 1683 .mode = 0444, 1684 1684 .proc_handler = proc_do_uuid, 1685 1685 }, 1686 - { } 1687 1686 }; 1688 1687 1689 1688 /*
-1
drivers/gpu/drm/i915/i915_perf.c
··· 4836 4836 .extra1 = SYSCTL_ZERO, 4837 4837 .extra2 = &oa_sample_rate_hard_limit, 4838 4838 }, 4839 - {} 4840 4839 }; 4841 4840 4842 4841 static u32 num_perf_groups_per_gt(struct intel_gt *gt)
-1
drivers/hv/hv_common.c
··· 148 148 .extra1 = SYSCTL_ZERO, 149 149 .extra2 = SYSCTL_ONE 150 150 }, 151 - {} 152 151 }; 153 152 154 153 static int hv_die_panic_notify_crash(struct notifier_block *self,
-1
drivers/infiniband/core/iwcm.c
··· 111 111 .mode = 0644, 112 112 .proc_handler = proc_dointvec, 113 113 }, 114 - { } 115 114 }; 116 115 117 116 /*
-1
drivers/infiniband/core/ucma.c
··· 71 71 .mode = 0644, 72 72 .proc_handler = proc_dointvec, 73 73 }, 74 - { } 75 74 }; 76 75 77 76 struct ucma_file {
-1
drivers/macintosh/mac_hid.c
··· 236 236 .mode = 0644, 237 237 .proc_handler = proc_dointvec, 238 238 }, 239 - { } 240 239 }; 241 240 242 241 static struct ctl_table_header *mac_hid_sysctl_header;
-1
drivers/md/md.c
··· 304 304 .mode = S_IRUGO|S_IWUSR, 305 305 .proc_handler = proc_dointvec, 306 306 }, 307 - { } 308 307 }; 309 308 310 309 static int start_readonly;
-2
drivers/misc/sgi-xp/xpc_main.c
··· 110 110 .proc_handler = proc_dointvec_minmax, 111 111 .extra1 = &xpc_hb_check_min_interval, 112 112 .extra2 = &xpc_hb_check_max_interval}, 113 - {} 114 113 }; 115 114 static struct ctl_table xpc_sys_xpc[] = { 116 115 { ··· 120 121 .proc_handler = proc_dointvec_minmax, 121 122 .extra1 = &xpc_disengage_min_timelimit, 122 123 .extra2 = &xpc_disengage_max_timelimit}, 123 - {} 124 124 }; 125 125 126 126 static struct ctl_table_header *xpc_sysctl;
-1
drivers/net/vrf.c
··· 1963 1963 /* set by the vrf_netns_init */ 1964 1964 .extra1 = NULL, 1965 1965 }, 1966 - { }, 1967 1966 }; 1968 1967 1969 1968 static int vrf_netns_init_sysctl(struct net *net, struct netns_vrf *nn_vrf)
+11 -17
drivers/parport/procfs.c
··· 259 259 struct parport_sysctl_table { 260 260 struct ctl_table_header *port_header; 261 261 struct ctl_table_header *devices_header; 262 - struct ctl_table vars[12]; 263 - struct ctl_table device_dir[2]; 262 + #ifdef CONFIG_PARPORT_1284 263 + struct ctl_table vars[10]; 264 + #else 265 + struct ctl_table vars[5]; 266 + #endif /* IEEE 1284 support */ 267 + struct ctl_table device_dir[1]; 264 268 }; 265 269 266 270 static const struct parport_sysctl_table parport_sysctl_template = { ··· 345 341 .proc_handler = do_autoprobe 346 342 }, 347 343 #endif /* IEEE 1284 support */ 348 - {} 349 344 }, 350 345 { 351 346 { ··· 354 351 .mode = 0444, 355 352 .proc_handler = do_active_device 356 353 }, 357 - {} 358 354 }, 359 355 }; 360 356 361 357 struct parport_device_sysctl_table 362 358 { 363 359 struct ctl_table_header *sysctl_header; 364 - struct ctl_table vars[2]; 365 - struct ctl_table device_dir[2]; 366 - struct ctl_table devices_root_dir[2]; 367 - struct ctl_table port_dir[2]; 368 - struct ctl_table parport_dir[2]; 369 - struct ctl_table dev_dir[2]; 360 + struct ctl_table vars[1]; 361 + struct ctl_table device_dir[1]; 370 362 }; 371 363 372 364 static const struct parport_device_sysctl_table ··· 377 379 .extra1 = (void*) &parport_min_timeslice_value, 378 380 .extra2 = (void*) &parport_max_timeslice_value 379 381 }, 380 - {} 381 382 }, 382 383 { 383 384 { ··· 385 388 .maxlen = 0, 386 389 .mode = 0555, 387 390 }, 388 - {} 389 391 } 390 392 }; 391 393 392 394 struct parport_default_sysctl_table 393 395 { 394 396 struct ctl_table_header *sysctl_header; 395 - struct ctl_table vars[3]; 396 - struct ctl_table default_dir[2]; 397 - struct ctl_table parport_dir[2]; 398 - struct ctl_table dev_dir[2]; 397 + struct ctl_table vars[2]; 399 398 }; 400 399 401 400 static struct parport_default_sysctl_table ··· 416 423 .extra1 = (void*) &parport_min_spintime_value, 417 424 .extra2 = (void*) &parport_max_spintime_value 418 425 }, 419 - {} 420 426 } 421 427 }; 422 428 ··· 435 443 t->vars[0].data = &port->spintime; 436 444 for (i = 0; i < 5; i++) { 437 445 t->vars[i].extra1 = port; 446 + #ifdef CONFIG_PARPORT_1284 438 447 t->vars[5 + i].extra2 = &port->probe_info[i]; 448 + #endif /* IEEE 1284 support */ 439 449 } 440 450 441 451 port_name_len = strnlen(port->name, PARPORT_NAME_MAX_LEN);
-1
drivers/perf/arm_pmuv3.c
··· 1175 1175 .extra1 = SYSCTL_ZERO, 1176 1176 .extra2 = SYSCTL_ONE, 1177 1177 }, 1178 - { } 1179 1178 }; 1180 1179 1181 1180 static void armv8_pmu_register_sysctl_table(void)
-1
drivers/scsi/scsi_sysctl.c
··· 18 18 .maxlen = sizeof(scsi_logging_level), 19 19 .mode = 0644, 20 20 .proc_handler = proc_dointvec }, 21 - { } 22 21 }; 23 22 24 23 static struct ctl_table_header *scsi_table_header;
-1
drivers/scsi/sg.c
··· 1650 1650 .mode = 0444, 1651 1651 .proc_handler = proc_dointvec, 1652 1652 }, 1653 - {} 1654 1653 }; 1655 1654 1656 1655 static struct ctl_table_header *hdr;
-1
drivers/tty/tty_io.c
··· 3612 3612 .extra1 = SYSCTL_ZERO, 3613 3613 .extra2 = SYSCTL_ONE, 3614 3614 }, 3615 - { } 3616 3615 }; 3617 3616 3618 3617 /*
-1
drivers/xen/balloon.c
··· 94 94 .extra1 = SYSCTL_ZERO, 95 95 .extra2 = SYSCTL_ONE, 96 96 }, 97 - { } 98 97 }; 99 98 100 99 #else
+7 -1
fs/proc/proc_sysctl.c
··· 1576 1576 {"hung_task_panic", "kernel.hung_task_panic" }, 1577 1577 {"numa_zonelist_order", "vm.numa_zonelist_order" }, 1578 1578 {"softlockup_all_cpu_backtrace", "kernel.softlockup_all_cpu_backtrace" }, 1579 - {"softlockup_panic", "kernel.softlockup_panic" }, 1580 1579 { } 1581 1580 }; 1582 1581 ··· 1589 1590 } 1590 1591 1591 1592 return NULL; 1593 + } 1594 + 1595 + bool sysctl_is_alias(char *param) 1596 + { 1597 + const char *alias = sysctl_find_alias(param); 1598 + 1599 + return alias != NULL; 1592 1600 } 1593 1601 1594 1602 /* Set sysctl value passed on kernel command line. */
+6
include/linux/sysctl.h
··· 242 242 extern struct ctl_table_header *register_sysctl_mount_point(const char *path); 243 243 244 244 void do_sysctl_args(void); 245 + bool sysctl_is_alias(char *param); 245 246 int do_proc_douintvec(struct ctl_table *table, int write, 246 247 void *buffer, size_t *lenp, loff_t *ppos, 247 248 int (*conv)(unsigned long *lvalp, ··· 287 286 288 287 static inline void do_sysctl_args(void) 289 288 { 289 + } 290 + 291 + static inline bool sysctl_is_alias(char *param) 292 + { 293 + return false; 290 294 } 291 295 #endif /* CONFIG_SYSCTL */ 292 296
+4
init/main.c
··· 530 530 { 531 531 size_t len = strlen(param); 532 532 533 + /* Handle params aliased to sysctls */ 534 + if (sysctl_is_alias(param)) 535 + return 0; 536 + 533 537 repair_env_string(param, val); 534 538 535 539 /* Handle obsolete-style parameters */
+7
kernel/watchdog.c
··· 283 283 static DEFINE_PER_CPU(bool, softlockup_touch_sync); 284 284 static unsigned long soft_lockup_nmi_warn; 285 285 286 + static int __init softlockup_panic_setup(char *str) 287 + { 288 + softlockup_panic = simple_strtoul(str, NULL, 0); 289 + return 1; 290 + } 291 + __setup("softlockup_panic=", softlockup_panic_setup); 292 + 286 293 static int __init nowatchdog_setup(char *str) 287 294 { 288 295 watchdog_user_enabled = 0;