diff options
author | Yevgeny Kliteynik <kliteyn@nvidia.com> | 2025-07-03 21:54:30 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2025-07-07 19:12:17 -0700 |
commit | 96e4c4a1a5bc6b6bc1ba48c6dfd2246df24f2f63 (patch) | |
tree | f1d98ce8212637c1d806d6bd9ecf7a727b03d69e /net/unix/af_unix.c | |
parent | 29063103f864fb63f7f7c436e670c5804df1b55b (diff) |
net/mlx5: HWS, Shrink empty matchers
Matcher size is dynamic: it starts at initial size, and then it grows
through rehash as more and more rules are added to this matcher.
When rules are deleted, matcher's size is not decreased. Rehash
approach is greedy. The idea is: if the matcher got to a certain size
at some point, chances are - it will get to this size again, so it is
better to avoid costly rehash operations whenever possible.
However, when all the rules of the matcher are deleted, this should
be viewed as special case. If the matcher actually got to the point
where it has zero rules, it might be an indication that some usecase
from the past is no longer happening. This is where some ICM can be
freed.
This patch handles this case: when a number of rules in a matcher
goes down to zero, the matcher's tables are shrunk to the initial
size.
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Vlad Dogaru <vdogaru@nvidia.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250703185431.445571-10-mbloch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions