Linux HAM/Amateur Radio development
 help / color / mirror / Atom feed
* [PATCH 09/14] ax.25: Update to register_net_sysctl_sz
       [not found] ` <20230726140635.2059334-1-j.granados@samsung.com>
@ 2023-07-26 14:06   ` Joel Granados
  2023-07-26 18:00     ` Luis Chamberlain
  0 siblings, 1 reply; 9+ messages in thread
From: Joel Granados @ 2023-07-26 14:06 UTC (permalink / raw)
  To: mcgrof, Joerg Reuter, Ralf Baechle, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: willy, keescook, josh, Joel Granados, linux-hams, netdev,
	linux-kernel

This is part of the effort to remove the sentinel (last empty) element
from the ctl_table arrays. We update to the new function and pass it the
array size.

Signed-off-by: Joel Granados <j.granados@samsung.com>
---
 net/ax25/sysctl_net_ax25.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c
index 2154d004d3dc..db66e11e7fe8 100644
--- a/net/ax25/sysctl_net_ax25.c
+++ b/net/ax25/sysctl_net_ax25.c
@@ -159,7 +159,8 @@ int ax25_register_dev_sysctl(ax25_dev *ax25_dev)
 		table[k].data = &ax25_dev->values[k];
 
 	snprintf(path, sizeof(path), "net/ax25/%s", ax25_dev->dev->name);
-	ax25_dev->sysheader = register_net_sysctl(&init_net, path, table);
+	ax25_dev->sysheader = register_net_sysctl_sz(&init_net, path, table,
+						     ARRAY_SIZE(ax25_param_table));
 	if (!ax25_dev->sysheader) {
 		kfree(table);
 		return -ENOMEM;
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 09/14] ax.25: Update to register_net_sysctl_sz
  2023-07-26 14:06   ` [PATCH 09/14] ax.25: Update to register_net_sysctl_sz Joel Granados
@ 2023-07-26 18:00     ` Luis Chamberlain
  2023-07-27 12:31       ` Joel Granados
  2023-07-27 15:38       ` Joel Granados
  0 siblings, 2 replies; 9+ messages in thread
From: Luis Chamberlain @ 2023-07-26 18:00 UTC (permalink / raw)
  To: Joel Granados
  Cc: Joerg Reuter, Ralf Baechle, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, willy, keescook, josh, linux-hams,
	netdev, linux-kernel

On Wed, Jul 26, 2023 at 04:06:29PM +0200, Joel Granados wrote:
> This is part of the effort to remove the sentinel (last empty) element
> from the ctl_table arrays. We update to the new function and pass it the
> array size.

The commit log does not explain why. It also does not explain if there
is any delta on size at compile or runtime.

  Luis

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 09/14] ax.25: Update to register_net_sysctl_sz
  2023-07-26 18:00     ` Luis Chamberlain
@ 2023-07-27 12:31       ` Joel Granados
  2023-07-27 15:44         ` Luis Chamberlain
  2023-07-27 15:38       ` Joel Granados
  1 sibling, 1 reply; 9+ messages in thread
From: Joel Granados @ 2023-07-27 12:31 UTC (permalink / raw)
  To: Luis Chamberlain
  Cc: Joerg Reuter, Ralf Baechle, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, willy, keescook, josh, linux-hams,
	netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 688 bytes --]

On Wed, Jul 26, 2023 at 11:00:37AM -0700, Luis Chamberlain wrote:
> On Wed, Jul 26, 2023 at 04:06:29PM +0200, Joel Granados wrote:
> > This is part of the effort to remove the sentinel (last empty) element
> > from the ctl_table arrays. We update to the new function and pass it the
> > array size.
> 
> The commit log does not explain why. It also does not explain if there
I'll add the "why".

> is any delta on size at compile or runtime.
There are no deltas in this patch set. We start seeing the deltas when
we start removing with the next 6 chunks. I'll try to make that more
clear in the commit message.

> 
>   Luis

thx for the feedback

-- 

Joel Granados

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 09/14] ax.25: Update to register_net_sysctl_sz
  2023-07-26 18:00     ` Luis Chamberlain
  2023-07-27 12:31       ` Joel Granados
@ 2023-07-27 15:38       ` Joel Granados
  2023-07-27 15:50         ` Luis Chamberlain
  1 sibling, 1 reply; 9+ messages in thread
From: Joel Granados @ 2023-07-27 15:38 UTC (permalink / raw)
  To: Luis Chamberlain
  Cc: Joerg Reuter, Ralf Baechle, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, willy, keescook, josh, linux-hams,
	netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 680 bytes --]

On Wed, Jul 26, 2023 at 11:00:37AM -0700, Luis Chamberlain wrote:
> On Wed, Jul 26, 2023 at 04:06:29PM +0200, Joel Granados wrote:
> > This is part of the effort to remove the sentinel (last empty) element
> > from the ctl_table arrays. We update to the new function and pass it the
> > array size.
> 
> The commit log does not explain why. It also does not explain if there
> is any delta on size at compile or runtime.
Just to be on the same page:
You mean the specific why for this commit. like for example:
"
We update to register_net_sysctl_sz to prepare for when the ctl_table
array sentinels are removed.
"

right?


> 
>   Luis

-- 

Joel Granados

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 09/14] ax.25: Update to register_net_sysctl_sz
  2023-07-27 12:31       ` Joel Granados
@ 2023-07-27 15:44         ` Luis Chamberlain
  2023-07-28  7:35           ` Joel Granados
  0 siblings, 1 reply; 9+ messages in thread
From: Luis Chamberlain @ 2023-07-27 15:44 UTC (permalink / raw)
  To: Joel Granados
  Cc: Joerg Reuter, Ralf Baechle, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, willy, keescook, josh, linux-hams,
	netdev, linux-kernel

On Thu, Jul 27, 2023 at 02:31:12PM +0200, Joel Granados wrote:
> There are no deltas in this patch set. We start seeing the deltas when
> we start removing with the next 6 chunks. I'll try to make that more
> clear in the commit message.

Indeed, even if no deltas are created it is importan then to say that.
If there are no deltas the "why" becomes more important. If the why is
to make it easier to apply subsequent patches, that must be said. When
you iterate your new series try to review the patches as if you were not
the person submitting them, and try to think of ways to make it easier
for the patch reviewer to do less work. The less work and easier patch
review is the better for them.

  Luis

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 09/14] ax.25: Update to register_net_sysctl_sz
  2023-07-27 15:38       ` Joel Granados
@ 2023-07-27 15:50         ` Luis Chamberlain
  0 siblings, 0 replies; 9+ messages in thread
From: Luis Chamberlain @ 2023-07-27 15:50 UTC (permalink / raw)
  To: Joel Granados
  Cc: Joerg Reuter, Ralf Baechle, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, willy, keescook, josh, linux-hams,
	netdev, linux-kernel

On Thu, Jul 27, 2023 at 05:38:04PM +0200, Joel Granados wrote:
> On Wed, Jul 26, 2023 at 11:00:37AM -0700, Luis Chamberlain wrote:
> > On Wed, Jul 26, 2023 at 04:06:29PM +0200, Joel Granados wrote:
> > > This is part of the effort to remove the sentinel (last empty) element
> > > from the ctl_table arrays. We update to the new function and pass it the
> > > array size.
> > 
> > The commit log does not explain why. It also does not explain if there
> > is any delta on size at compile or runtime.
> Just to be on the same page:
> You mean the specific why for this commit. like for example:
> "
> We update  to register_net_sysctl_sz

I think it is clearer to just say:

Move from register_net_sysctl() to register_net_sysctl_sz()

> to prepare for when the ctl_table
> array sentinels are removed.

That is not as clear. I think you should just spell it out.

We want to use the syctl ARRAY_SIZE() when possible, and subsequent
patches ... now the register_net_sysctl() <does something> while
register_net_sysctl_sz() <does something else> and <in this case>
this user <does something> and so we must use register_net_sysctl_sz().

> "
> 
> right?

  Luis

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 09/14] ax.25: Update to register_net_sysctl_sz
  2023-07-27 15:44         ` Luis Chamberlain
@ 2023-07-28  7:35           ` Joel Granados
  2023-07-28 18:16             ` Luis Chamberlain
  0 siblings, 1 reply; 9+ messages in thread
From: Joel Granados @ 2023-07-28  7:35 UTC (permalink / raw)
  To: Luis Chamberlain
  Cc: Joerg Reuter, Ralf Baechle, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, willy, keescook, josh, linux-hams,
	netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1346 bytes --]

On Thu, Jul 27, 2023 at 08:44:24AM -0700, Luis Chamberlain wrote:
> On Thu, Jul 27, 2023 at 02:31:12PM +0200, Joel Granados wrote:
> > There are no deltas in this patch set. We start seeing the deltas when
> > we start removing with the next 6 chunks. I'll try to make that more
> > clear in the commit message.
> 
> Indeed, even if no deltas are created it is importan then to say that.
> If there are no deltas the "why" becomes more important. If the why is
> to make it easier to apply subsequent patches, that must be said. When
yes. The why for this patch set in particular is to make it easier to
apply the sentinel removal patches.

I think the difficulty for me comes from having two whys: 1. The one for
this patch set which is to make it easier to apply sentinel removal patches. And 2.
The one for the "big" patch (that actually removes the sentinels) which is to
reduce build time size and run time memory bloat.

> you iterate your new series try to review the patches as if you were not
> the person submitting them, and try to think of ways to make it easier
> for the patch reviewer to do less work. The less work and easier patch
> review is the better for them.
Ack. For all these commits I'll try to weave in the two Whys to make the
review process a bit easier.

> 
>   Luis

-- 

Joel Granados

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 09/14] ax.25: Update to register_net_sysctl_sz
  2023-07-28  7:35           ` Joel Granados
@ 2023-07-28 18:16             ` Luis Chamberlain
  2023-07-31  7:09               ` Joel Granados
  0 siblings, 1 reply; 9+ messages in thread
From: Luis Chamberlain @ 2023-07-28 18:16 UTC (permalink / raw)
  To: Joel Granados
  Cc: Joerg Reuter, Ralf Baechle, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, willy, keescook, josh, linux-hams,
	netdev, linux-kernel

On Fri, Jul 28, 2023 at 09:35:36AM +0200, Joel Granados wrote:
> On Thu, Jul 27, 2023 at 08:44:24AM -0700, Luis Chamberlain wrote:
> > On Thu, Jul 27, 2023 at 02:31:12PM +0200, Joel Granados wrote:
> > > There are no deltas in this patch set. We start seeing the deltas when
> > > we start removing with the next 6 chunks. I'll try to make that more
> > > clear in the commit message.
> > 
> > Indeed, even if no deltas are created it is importan then to say that.
> > If there are no deltas the "why" becomes more important. If the why is
> > to make it easier to apply subsequent patches, that must be said. When
> yes. The why for this patch set in particular is to make it easier to
> apply the sentinel removal patches.
> 
> I think the difficulty for me comes from having two whys: 1. The one for
> this patch set which is to make it easier to apply sentinel removal patches. And 2.
> The one for the "big" patch (that actually removes the sentinels) which is to
> reduce build time size and run time memory bloat.

The 2) is part of the real why, 1) is more of how to do 2) cleanly. But
the real why is the savings in memory because we are moving arrays out
of kernel/sysctl.c so we don't want to incur a size penalty. The
collateral to avoid increasing size in the moves also proves to save us
more memory overall, on the ballpark of about 64 bytes per array in the
kernel both at runtime and build time. The build time gain is mostly
on the __init stuff and so gets freed right away, but since sysctl
code always kzallocs the arrays passed we also save 64 bytes per array
in the end at runtime.

  Luis

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 09/14] ax.25: Update to register_net_sysctl_sz
  2023-07-28 18:16             ` Luis Chamberlain
@ 2023-07-31  7:09               ` Joel Granados
  0 siblings, 0 replies; 9+ messages in thread
From: Joel Granados @ 2023-07-31  7:09 UTC (permalink / raw)
  To: Luis Chamberlain
  Cc: Joerg Reuter, Ralf Baechle, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, willy, keescook, josh, linux-hams,
	netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1987 bytes --]

On Fri, Jul 28, 2023 at 11:16:06AM -0700, Luis Chamberlain wrote:
> On Fri, Jul 28, 2023 at 09:35:36AM +0200, Joel Granados wrote:
> > On Thu, Jul 27, 2023 at 08:44:24AM -0700, Luis Chamberlain wrote:
> > > On Thu, Jul 27, 2023 at 02:31:12PM +0200, Joel Granados wrote:
> > > > There are no deltas in this patch set. We start seeing the deltas when
> > > > we start removing with the next 6 chunks. I'll try to make that more
> > > > clear in the commit message.
> > > 
> > > Indeed, even if no deltas are created it is importan then to say that.
> > > If there are no deltas the "why" becomes more important. If the why is
> > > to make it easier to apply subsequent patches, that must be said. When
> > yes. The why for this patch set in particular is to make it easier to
> > apply the sentinel removal patches.
> > 
> > I think the difficulty for me comes from having two whys: 1. The one for
> > this patch set which is to make it easier to apply sentinel removal patches. And 2.
> > The one for the "big" patch (that actually removes the sentinels) which is to
> > reduce build time size and run time memory bloat.
> 
> The 2) is part of the real why, 1) is more of how to do 2) cleanly. But
> the real why is the savings in memory because we are moving arrays out
> of kernel/sysctl.c so we don't want to incur a size penalty. The
> collateral to avoid increasing size in the moves also proves to save us
> more memory overall, on the ballpark of about 64 bytes per array in the
> kernel both at runtime and build time. The build time gain is mostly
> on the __init stuff and so gets freed right away, but since sysctl
> code always kzallocs the arrays passed we also save 64 bytes per array
> in the end at runtime.
Yes. In my new version I have tried to mention both 1 and 2 and
differentiate between them. I stuck with the "why" for this patch set is
to make it easier to reach 2.

I'll send it out today.
> 
>   Luis

-- 

Joel Granados

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-07-31  7:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20230726140703eucas1p2786577bcc67d5ae434671dac11870c60@eucas1p2.samsung.com>
     [not found] ` <20230726140635.2059334-1-j.granados@samsung.com>
2023-07-26 14:06   ` [PATCH 09/14] ax.25: Update to register_net_sysctl_sz Joel Granados
2023-07-26 18:00     ` Luis Chamberlain
2023-07-27 12:31       ` Joel Granados
2023-07-27 15:44         ` Luis Chamberlain
2023-07-28  7:35           ` Joel Granados
2023-07-28 18:16             ` Luis Chamberlain
2023-07-31  7:09               ` Joel Granados
2023-07-27 15:38       ` Joel Granados
2023-07-27 15:50         ` Luis Chamberlain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox