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)
Apr 25 2024, 11:27 PM
Unknown Object (File)
Apr 25 2024, 11:27 PM
Unknown Object (File)
Feb 16 2024, 6:18 AM
Unknown Object (File)
Feb 16 2024, 5:18 AM
Unknown Object (File)
Jan 27 2024, 10:15 PM
Unknown Object (File)
Dec 20 2023, 4:28 AM
Unknown Object (File)
Nov 14 2023, 5:40 AM
Unknown Object (File)
Oct 26 2023, 5:17 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.