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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 28, 2022 at 10:42:19AM +0800, tangmeng wrote:
> 
> 
> On 2022/2/28 05:26, Luis Chamberlain wrote:
> 
> > 
> > This effort is trying to save space. But now you are adding a new bool
> > for every single struct ctl_table.... So doesn't the math work out
> > against us if you do a build size comparison?
> > 
> Currently,

You mean after your patch.

> the definition of the ctl_table structure and the size of the
> members are as follows.
> /* In 64-bit system*/
> struct ctl_table {
...
>         bool register_one;               /* 1 bytes */
...
> } __randomize_layout;
> 
> Before 

Before it the bool was not there. How can it be you are not increasing
the size?

> > Can you just instead add a new helper which deals with one entry?
> > Perhaps then make the other caller which loops use that? That way
> > we don't bloat the kernel with an extra bool per ctl_table?
> > 
> I have considered add a new helper which deals with one entry. But
> considered that the code will be similar to array,

That's fine, if we have tons of these.

> > Or can you add a new parameter which specififes the size of the array?
> > 
> When I considered add a new parameter which specififes the size of the
> array. I have encountered the following difficulties.
> 
> The current status is that during the ctl_table registration process, the
> method of traversing the table is implemented by a movement of the pointer
> entry pointing to the struct ctl_table. When entry->procname is empty, it
> considers table traversal.
> 
> This leads to that when the ctl_tables have child tables in the table, it is
> not possible to get the child table's size by ARRAY_SIZE(*entry), so
> transmitting the Child Table Size becomes very difficult.

I see.

A simple routine for dealing with single entries might be best then.
And while at it, see if you can add a DECLARE_SYSCTL_SINGLE or something
which will wrap up all the ugly stuff.

  Luis



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux