diff options
author | Matt Dunwoodie <ncon@noconroy.net> | 2021-04-21 11:48:58 +1000 |
---|---|---|
committer | Matt Dunwoodie <ncon@noconroy.net> | 2021-04-21 11:48:58 +1000 |
commit | 23dc8e4926e9af068b9e361e8390eda4c1d3c2f7 (patch) | |
tree | c8c7f435b82ab7d6ee7727a6a48d917f53cfbaa0 /TODO.md | |
parent | global: update timer-type comments (diff) | |
download | wireguard-freebsd-23dc8e4926e9af068b9e361e8390eda4c1d3c2f7.tar.xz wireguard-freebsd-23dc8e4926e9af068b9e361e8390eda4c1d3c2f7.zip |
wg_cookie: ensure gc is called regularly
Previously we relied on gc being called when adding a new entry, which
could leave us in a gc "blind spot". With this change, we schedule a
callout to run gc whenever we have entries in the table. The callout
will continue to run every ELEMENT_TIMEOUT seconds until the table is
empty.
Access to rl_gc is locked by rl_lock, so we will never have any threads
racing to callout_{pending,stop,reset}.
The alternative (which Linux does currently) is just to run the callout
every ELEMENT_TIMEOUT (1) second even when no entries are in the table.
However, the callout solution proposed here seems simple enough.
Signed-off-by: Matt Dunwoodie <ncon@noconroy.net>
Diffstat (limited to 'TODO.md')
0 files changed, 0 insertions, 0 deletions