Page MenuHomeFreeBSD

[iwm] Plug memory leak, and fix error handling in iwm_rx_addbuf().
ClosedPublic

Authored by imre_vdsz.com on Jun 7 2016, 12:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 5, 1:48 PM
Unknown Object (File)
Fri, Apr 25, 10:31 AM
Unknown Object (File)
Mon, Apr 21, 7:44 PM
Unknown Object (File)
Mar 14 2025, 8:26 AM
Unknown Object (File)
Mar 11 2025, 4:39 PM
Unknown Object (File)
Feb 27 2025, 7:42 AM
Unknown Object (File)
Feb 18 2025, 9:08 AM
Unknown Object (File)
Feb 10 2025, 7:27 AM
Subscribers

Details

Summary
  • When allocating a new mbuf or bus_dmamap_load()-ing it fails, we can just keep the old mbuf since we are dropping that packet anyway.
  • Instead of doing bus_dmamap_create() and bus_dmamap_destroy() all the time, create an extra bus_dmamap_t which we can use to safely try bus_dmamap_load()-ing the new mbuf. On success we just swap the spare bus_dmamap_t with the data->map of that ring entry.

Obtained from: DragonFlyBSD cc440b26818b5dfdd9af504d71c1b0e6522b53ef

Test Plan

Tested with Intel AC7260, verified with vmstat -m that new kernel no
longer visibly leaks memory from the M_DEVBUF malloc type.
Before, leakage was 1KB every few seconds while ping(8)-ing over the wlan
connection.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imre_vdsz.com retitled this revision from to [iwm] Plug memory leak, and fix error handling in iwm_rx_addbuf()..
imre_vdsz.com updated this object.
imre_vdsz.com edited the test plan for this revision. (Show Details)
imre_vdsz.com added a reviewer: adrian.

Avoid doing bus_dmamap_create()/_destroy() all the time in iwm_rx_addbuf()

This revision was automatically updated to reflect the committed changes.