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)
Sat, Nov 2, 11:52 AM
Unknown Object (File)
Oct 19 2024, 9:05 AM
Unknown Object (File)
Oct 19 2024, 9:05 AM
Unknown Object (File)
Oct 19 2024, 9:05 AM
Unknown Object (File)
Oct 19 2024, 8:35 AM
Unknown Object (File)
Sep 26 2024, 10:16 AM
Unknown Object (File)
Sep 24 2024, 9:14 AM
Unknown Object (File)
Sep 20 2024, 12:53 AM
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.