Page MenuHomeFreeBSD

Free TCPPCAP mbufs when under memory pressure
ClosedPublic

Authored by jtl on Jun 23 2016, 1:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 4:01 AM
Unknown Object (File)
Wed, Apr 17, 3:36 AM
Unknown Object (File)
Tue, Apr 16, 4:52 AM
Unknown Object (File)
Mon, Apr 8, 6:26 AM
Unknown Object (File)
Mar 28 2024, 12:14 AM
Unknown Object (File)
Dec 22 2023, 9:56 PM
Unknown Object (File)
Dec 6 2023, 1:43 AM
Unknown Object (File)
Nov 12 2023, 1:25 AM

Details

Reviewers
gnn
novice_techie.com
Group Reviewers
transport
Summary

When the system is under memory pressure, free the mbufs cached as part of the TCPPCAP debugging feature. In some circumstances, this may mean we lose the record of a packet pattern that causes an mbuf leak. However, it also gives the system the best chance of recovering when under memory pressure.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4367
Build 4416: arc lint + arc unit

Event Timeline

jtl retitled this revision from to Free TCPPCAP mbufs when under memory pressure.
jtl updated this object.
jtl edited the test plan for this revision. (Show Details)
jtl added a reviewer: transport.

The gains from this improvement would be highly marginal, but I guess it could help.

novice_techie.com requested changes to this revision.EditedJun 26 2016, 10:15 PM

I would feel better if you did some kind of check against a free list before eliminating debug information like this. If you're stressing a machine to resource contention my feeling is that being able to figure out what's going on takes precedent before you blow stuff away.

If all else fails, you can try doing an mbuf allocation, so if you get a failure then free these?

This revision now requires changes to proceed.Jun 26 2016, 10:15 PM

I would feel better if you did some kind of check against a free list before eliminating debug information like this. If you're stressing a machine to resource contention my feeling is that being able to figure out what's going on takes precedent before you blow stuff away.

As you can probably tell from my change description, I'm sensitive to this balance between maintaining useful debugging information and ensuring that the volume of debugging information itself doesn't cause a stability problem.

The feature is intended to be suitable for use in production to help with debugging problems that are otherwise difficult to debug. My fear is that someone will do that and not realize the scale requirements that the feature imposes, thus causing unexpected problems.

In my opinion, there is no way to determine which packets are "important" for debugging purposes, so you probably need to keep all of them, or none of them. As I considered this prior to proposing the change, I wasn't sure which would be more appropriate, but I decided to err on the side of system stability. However, I am quite open to adding a sysctl to control the behavior, which would allow each sysadmin to decide for themselves which behavior they want. That may be the best solution because it would allow you to achieve the objective (maximize stability or maximize debuggability) most appropriate for your environment.

jtl edited edge metadata.

Conditionally free TCPPCAP mbufs when under memory pressure, depending on the value of a sysctl.

A sysctl is not a bad idea. Don't mind that.

gnn added a reviewer: gnn.
This revision is now accepted and ready to land.Jul 4 2016, 12:29 AM