Hi lin jia, thanks for posting to the list. I'll also add Joel, Kees, Luis and the fsdevel lists to Cc, as per "PROC SYSCTL" from the MAINTAINERS file. On 2024-06-29 10:54:15+0000, lin jia wrote: > Hi all: > I've been reading the sysctl part of the Linux kernel source code( 3.3.8) recently and encountered some issues. I'm not sure who I can ask for help. > In sysctl.c , the function of __register_sysctl_paths is to register a sysctl hierarchy, I am confused by the function " try_attach", This is a very old kernel. The function you mention was removed over ten years ago and the way sysctls are registered today is completely different. > /* see if attaching q to p would be an improvement */ > static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q) > > what is the meaning of "improvement", I don’t know the matching standard for the entry in the list > > another question is , why not break when variable is_better and > not_in_parent is true, so as to save time, when I config about 2k~4k > net device objects in system, "register_net_sysctl_table" cost > considerable time. try_attach() was removed in commit 7ec66d06362d ("sysctl: Stop requiring explicit management of sysctl directories") citing performance reasons. This may be same performance issue you are encountering and maybe you can take inspiration from that commit to avoid it. Or even better, upgrade to a newer kernel. > <snip> Thomas