2024-02-25 04:07:33

by Wen Yang

[permalink] [raw]
Subject: [PATCH 0/8] introduce sysctl SYSCTL_U8_MAX and SYSCTL_LONG_S32_MAX

From: Wen Yang <[email protected]>

The boundary check of multiple modules uses these static variables (such as
two_five_five, n_65535, ue_int_max, etc), and they are also not changed.
Therefore, add them to the shared sysctl_vals and sysctl_long_vals to avoid
duplication. This also reduce the size a bit

Wen Yang (8):
sysctl: introduce sysctl SYSCTL_U8_MAX and SYSCTL_LONG_S32_MAX
rxrpc: delete these duplicate static variables n_65535 and four
net: ipv6: delete these duplicate static variables two_five_five and
minus_one
svcrdma: delete the duplicate static variables zero
sysctl: delete these duplicate static variables i_zero and
i_one_hundred
epoll: delete these duplicate static variables long_zero and long_max
fs: inotify: delete these duplicate static variables it_zero and
it_int_max
ucounts: delete these duplicate static variables ue_zero and
ue_int_max

fs/eventpoll.c | 7 ++-----
fs/notify/inotify/inotify_user.c | 11 ++++-------
include/linux/sysctl.h | 15 +++++++++------
kernel/sysctl.c | 4 ++--
kernel/ucount.c | 7 ++-----
lib/test_sysctl.c | 6 ++----
net/ipv6/addrconf.c | 12 +++++-------
net/rxrpc/sysctl.c | 16 +++++++---------
net/sunrpc/xprtrdma/svc_rdma.c | 21 ++++++++++-----------
9 files changed, 43 insertions(+), 56 deletions(-)

Cc: Luis Chamberlain <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Joel Granados <[email protected]>
Cc: Christian Brauner <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: [email protected]
Cc: [email protected]

--
2.25.1



2024-02-25 20:16:17

by Joel Granados

[permalink] [raw]
Subject: Re: [PATCH 0/8] introduce sysctl SYSCTL_U8_MAX and SYSCTL_LONG_S32_MAX

On Sun, Feb 25, 2024 at 12:05:30PM +0800, [email protected] wrote:
> From: Wen Yang <[email protected]>
>
> The boundary check of multiple modules uses these static variables (such as
> two_five_five, n_65535, ue_int_max, etc), and they are also not changed.
> Therefore, add them to the shared sysctl_vals and sysctl_long_vals to avoid
> duplication.

Having a hard time understanding what you are trying to do here: is it
that there are variables that are being defined statically in two (or
more) different files and you want to consolidate them into sysctl
variables?

> This also reduce the size a bit
What size are you referring to? by how much?

The cover letter came separately and the patches are replying to a
non-existent mail. Is this due to some funkiness that Tencent does tot
he outgoing mail?

>
> Wen Yang (8):
> sysctl: introduce sysctl SYSCTL_U8_MAX and SYSCTL_LONG_S32_MAX
> rxrpc: delete these duplicate static variables n_65535 and four
> net: ipv6: delete these duplicate static variables two_five_five and
> minus_one
> svcrdma: delete the duplicate static variables zero
> sysctl: delete these duplicate static variables i_zero and
> i_one_hundred
> epoll: delete these duplicate static variables long_zero and long_max
> fs: inotify: delete these duplicate static variables it_zero and
> it_int_max
> ucounts: delete these duplicate static variables ue_zero and
> ue_int_max
>
> fs/eventpoll.c | 7 ++-----
> fs/notify/inotify/inotify_user.c | 11 ++++-------
> include/linux/sysctl.h | 15 +++++++++------
> kernel/sysctl.c | 4 ++--
> kernel/ucount.c | 7 ++-----
> lib/test_sysctl.c | 6 ++----
> net/ipv6/addrconf.c | 12 +++++-------
> net/rxrpc/sysctl.c | 16 +++++++---------
> net/sunrpc/xprtrdma/svc_rdma.c | 21 ++++++++++-----------
> 9 files changed, 43 insertions(+), 56 deletions(-)
>
> Cc: Luis Chamberlain <[email protected]>
> Cc: Kees Cook <[email protected]>
> Cc: Joel Granados <[email protected]>
> Cc: Christian Brauner <[email protected]>
> Cc: "David S. Miller" <[email protected]>
> Cc: David Ahern <[email protected]>
> Cc: Eric Dumazet <[email protected]>
> Cc: Jakub Kicinski <[email protected]>
> Cc: Paolo Abeni <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
>
> --
> 2.25.1
>

--

Joel Granados


Attachments:
(No filename) (2.48 kB)
signature.asc (673.00 B)
Download all attachments

2024-02-26 15:32:09

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH 0/8] introduce sysctl SYSCTL_U8_MAX and SYSCTL_LONG_S32_MAX

On Sun, 25 Feb 2024 12:05:30 +0800 [email protected] wrote:
> The boundary check of multiple modules uses these static variables (such as
> two_five_five, n_65535, ue_int_max, etc), and they are also not changed.
> Therefore, add them to the shared sysctl_vals and sysctl_long_vals to avoid
> duplication. This also reduce the size a bit

You provide no data on how big the reduction is.
Eric's suggestion to encode the values directly in the table entry
sounds great, please invest your time in that, instead of half measures.

2024-02-28 12:41:17

by Wen Yang

[permalink] [raw]
Subject: Re: [PATCH 0/8] introduce sysctl SYSCTL_U8_MAX and SYSCTL_LONG_S32_MAX



On 2024/2/26 23:28, Jakub Kicinski wrote:
> You provide no data on how big the reduction is.
> Eric's suggestion to encode the values directly in the table entry
> sounds great, please invest your time in that, instead of half measures.


Thanks for your comments. Well, we are making modifications according to
Eric's suggestions, and the RFC patch series will be sent within a few
weeks.

--
Best wishes,
Wen