[Bug 254333] [tcp] sysctl net.inet.tcp.hostcache.list hangs
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Tue Mar 30 21:20:07 UTC 2021
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254333
--- Comment #18 from Michael Tuexen <tuexen at freebsd.org> ---
(In reply to Richard Scheffenegger from comment #17)
But tcp_hc_purge_internal() decrements the counter when it removes an entry and
frees it. I double checked the code and I think the counter is handled
correctly. I did look for an underflow, but I could not find it...
If the hash buckets are used highly un-symmetric, I wouldn't suggest to use
larger buckets. That results in long processing time. In that case I would
suggest to use a better hash algorithm. But this is not the issue right now.
I do see two problems:
1. Using a large amount of memory when exporting the list.
2. The counter being off.
The first issue is solved by the patches you are working on.
The second issue without your patches results in a memory amount which can't be
allocated and therefor triggers the problem. The second issue with you patches
in place will still result in not adding any new entries to the host cache
anymore, since the number counter is than larger than the limit.
For the counter having such a large value could happen when there is an
underflow. But I don't see how it can happen. For me it looks like the global
and the bucket counter are handled correctly. I also looked at the 11.4 code,
but I see no issue.
Since the statement is that this happens every 3 to 4 month, it must be a rare
event. Or some other code is writing in the memory location where the counter
is...
Richard: Do you see a way how the counter could be off?
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the freebsd-net
mailing list