freenode
Kernel & Low-Level

Linus Torvalds NAKs SCTP sysctl rewrite over unreadable macros

Alexey Gladkov’s RFC to replace per-namespace table cloning with sysctl_field descriptors is rejected as visually illegible, type-unsafe noise.

Linus Torvalds has rejected an RFC series that would rewrite how the SCTP stack registers its per-network-namespace sysctls, calling the result garbage that humans cannot parse even if the approach made technical sense.

Alexey Gladkov proposed replacing the long-standing pattern in which the SCTP sysctl table is cloned for every network namespace, data pointers are shifted off init_net, and a few entries are then patched by table index so that cross-field limits (rto_min versus rto_max, pf_retrans versus ps_retrans) stay coherent. Under the new scheme, sysctl_field descriptors would derive data and limit pointers from the registration context. The table itself could stay const, and the per-net allocation, offset arithmetic, index patching, and free path would disappear. Custom handlers that already perform special validation would keep that logic.

Torvalds objected on the linux-kernel list not to the goal but to the form. “I detest this series,” he wrote. “Maybe it makes technical sense, but as long as it makes no human visual sense, I’m NAK’ing it as being garbage.” He singled out the dense SYSCTL_FIELD_* macro initializers and their irregular indentation, which he said looked decided “by a rodent on crack who was given an Ouija board,” and insisted the code must be “consistent and visually parseable by humans without asking your dead ancestors for help.”

He also faulted SYSCTL_FIELD_CUSTOM for taking a bare sizeof and a data pointer with no type checking, and suggested the macro should receive the actual type and verify that it matches the pointer. The existing designated-initializer style, he noted, may be ugly, but at least a reader can see procname, data, maxlen, mode, and handler in plain sight.

The series is therefore blocked until the macros and layout are redesigned for legibility and basic type safety.