Page MenuHomeFreeBSD

Dummynet FQ-PIE AQM: Fix potential race conditions in stopping callout and freeing the allocated memory
ClosedPublic

Authored by ralsaadi_swin.edu.au on Jul 11 2016, 1:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 16 2024, 2:30 PM
Unknown Object (File)
Jan 1 2024, 7:22 AM
Unknown Object (File)
Dec 22 2023, 10:31 PM
Unknown Object (File)
Dec 15 2023, 12:07 AM
Unknown Object (File)
Dec 15 2023, 12:06 AM
Unknown Object (File)
Nov 9 2023, 12:29 PM
Unknown Object (File)
Oct 29 2023, 8:32 PM
Unknown Object (File)
Sep 27 2023, 11:25 PM
Subscribers

Details

Summary

There is a chance pie_cleanup() cannot stop fq_calculate_drop_prob() callout and and as consequence fq_pie_free_sched() cannot free flows memory allocation.
Currently, the code that deal with this problem is complex and could cause races.

We simplify the code by resetting pie instance callout to schedule fqpie_callout_cleanup() that destroy its mtx and free flows allocated memory when number of active sub-queues (nr_active_q) becomes zero.
As dummynet destroys the scheduler instance after calling fq_pie_free_sched(), we moved nr_active_q and flows pointer variables to a separated struct (fq_pie_si_extra). An instance of fq_pie_si_extra is allocated when fq_pie_new_sched() is called.

We also removed freemem_mtx lock and some not needed code.

The patch has been tested without problems.

Patch has been suggested by truckman (Don Lewis)

Diff Detail

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

Event Timeline

ralsaadi_swin.edu.au retitled this revision from to Dummynet FQ-PIE AQM: Fix potential race conditions in stopping callout and freeing the allocated memory.
ralsaadi_swin.edu.au updated this object.
ralsaadi_swin.edu.au edited the test plan for this revision. (Show Details)
ralsaadi_swin.edu.au set the repository for this revision to rS FreeBSD src repository - subversion.
truckman edited edge metadata.

Looks fine to me.

This revision is now accepted and ready to land.Jul 12 2016, 5:11 PM
This revision was automatically updated to reflect the committed changes.