Re: [PATCH v3 1/2] fs/proc: optimize exactly register one ctl_table

From: Luis Chamberlain
Date: Wed Mar 02 2022 - 17:51:10 EST


On Wed, Mar 02, 2022 at 10:55:10AM +0800, Meng Tang wrote:
> Sysctls are being moved out of kernel/sysctl.c and out to
> their own respective subsystems / users to help with easier
> maintance and avoid merge conflicts. But when we move just
> one entry and to its own new file the last entry for this
> new file must be empty, so we are essentialy bloating the
> kernel one extra empty entry per each newly moved sysctl.
>
> To help with this, this adds support for registering just
> one ctl_table, therefore not bloating the kernel when we
> move a single ctl_table to its own file.
>
> Since the process of registering just one single table is the
> same as that of registering an array table, so the code is
> similar to registering an array table. The difference between
> registering just one table and registering an array table is
> that we no longer traversal through pointers when registering
> a single table. These lead to that we have to add a complete
> implementation process for register just one ctl_table, so we
> have to add so much code.
>
> Suggested-by: Matthew Wilcox <willy@xxxxxxxxxxxxx>
> Signed-off-by: Meng Tang <tangmeng@xxxxxxxxxxxxx>

Is there really no helpers which you can add to share code?
Now that you did this work, look carefully.

Luis