Skip to contentSkip to conversation

lib/win_minmax: export symbol of minmax_running_min

PATCH In review Yixin Shen 5 participants 7 messages Apr 13, 2023 – Apr 14, 2023

Subsystems (3)
lore
Share & tools
lore

Yixin Shen

author
#0 lore raw

PATCH 1/1 lib/win_minmax: export symbol of minmax_running_min

This commit export the symbol of the function minmax_running_min to make it accessible to dynamically loaded modules. It can make this library more general, especially for those congestion control algorithm modules who wants to implement a windowed min filter.

---
 lib/win_minmax.c | 1 +
 1 file changed, 1 insertion(+)
lib/win_minmax.c +1 -0
index ec10506834b6..1682e614309c 100644
@@ -97,3 +97,4 @@ u32 minmax_running_min(struct minmax *m, u32 win, u32 t, u32 meas)
 
 	return minmax_subwin_update(m, win, &val);
 }
+EXPORT_SYMBOL(minmax_running_min);
Signature · 1 line
2.25.1
#1 lore raw
Quoted 16 lines · Yixin Shen

This commit export the symbol of the function minmax_running_min to make it accessible to dynamically loaded modules. It can make this library more general, especially for those congestion control algorithm modules who wants to implement a windowed min filter.

---
 lib/win_minmax.c | 1 +
 1 file changed, 1 insertion(+)
lib/win_minmax.c +0 -0
index ec10506834b6..1682e614309c 100644

lib/win_minmax.c u32 minmax_running_min(struct minmax *m, u32 win, u32 t, u32 meas) · line 100

Quoted 4 lines
lib/win_minmax.c +1 -0
@@ -97,3 +97,4 @@ u32 minmax_running_min(struct minmax *m, u32 win, u32 t, u32 meas)
 
 	return minmax_subwin_update(m, win, &val);
 }
+EXPORT_SYMBOL(minmax_running_min);

Please provide in-tree kernel user for that EXPORT_SYMBOL.

Thanks

Quoted 3 lines
Signature · 1 line
2.25.1
author
#2 lore raw
Quoted 1 line

Please provide in-tree kernel user for that EXPORT_SYMBOL.

It is hard to provide such an in-tree kernel user. We are trying to implement newer congestion control algorithms as dynamically loaded modules. For example, Copa(NSDI'18) which is adopted by Facebook needs to maintain such windowed min filters. Althought it is true that we can just copy-and-paste the code inside lib/win_minmax, it it more convenient to give the same status of minmax_running_min as minmax_running_max. It is confusing that only minmax_running_max is exported.
If this patch is rejected because the changes are too significant, I can also understand.

Thanks.

#3 lore raw
Quoted 3 lines · Yixin Shen
Quoted 1 line

Please provide in-tree kernel user for that EXPORT_SYMBOL.

It is hard to provide such an in-tree kernel user.

So once you overcome it, feel free to send this EXPORT_SYMBOL patch together with in-tree kernel user, but for now it is against kernel policy.

Thanks

#4 lore raw
In reply to Yixin Shen
Quoted 10 lines · Yixin Shen
Quoted 2 lines

Please provide in-tree kernel user for that EXPORT_SYMBOL.

It is hard to provide such an in-tree kernel user. We are trying to implement newer congestion control algorithms as dynamically loaded modules. For example, Copa(NSDI'18) which is adopted by Facebook needs to maintain such windowed min filters. Althought it is true that we can just copy-and-paste the code inside lib/win_minmax, it it more convenient to give the same status of minmax_running_min as minmax_running_max. It is confusing that only minmax_running_max is exported.

This is needed by net/ipv4/tcp_bbr.c , which can be a module.

Quoted 1 line

If this patch is rejected because the changes are too significant,

Well, this path would soon be reverted by people using bots/tools to detect unused functions,
or unused EXPORT symbols.

So there is no point accepting it, before you submit the CC in the official linux tree.

maintainer
#6 lore raw
In reply to Yixin Shen
Quoted 2 lines · On Fri, 14 Apr 2023 02:27:36 +0000 Yixin Shen wrote:

For example, Copa(NSDI'18) which is adopted by Facebook needs to maintain such windowed min filters.

Perhaps an unnecessary comment, but this should not be misread as this patch itself having anything to do with Meta.

maintainer
#5 lore raw
In reply to Eric Dumazet
Quoted 14 lines · On Fri, 14 Apr 2023 16:17:40 +0200 Eric Dumazet <[email protected]> wrote:
Quoted 10 lines · Yixin Shen
Quoted 2 lines

Please provide in-tree kernel user for that EXPORT_SYMBOL.

It is hard to provide such an in-tree kernel user. We are trying to implement newer congestion control algorithms as dynamically loaded modules. For example, Copa(NSDI'18) which is adopted by Facebook needs to maintain such windowed min filters. Althought it is true that we can just copy-and-paste the code inside lib/win_minmax, it it more convenient to give the same status of minmax_running_min as minmax_running_max. It is confusing that only minmax_running_max is exported.

This is needed by net/ipv4/tcp_bbr.c , which can be a module.

Quoted 8 lines
Quoted 1 line

If this patch is rejected because the changes are too significant,

Well, this path would soon be reverted by people using bots/tools to detect unused functions,
or unused EXPORT symbols.

So there is no point accepting it, before you submit the CC in the official linux tree.

It seems pretty darn screwy that we export minmax_running_max() but not minmax_running_min().

I'd be OK taking the patch just so we aren't pretty darn screwy. But it would be perfectly OK to include that one-liner within the patchset which adds a minmax_running_min() user.