diff options
author | glebius <glebius@FreeBSD.org> | 2013-11-22 19:22:26 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2013-11-22 19:22:26 +0000 |
commit | f889028338d27bce7743ea9cf0a00609d17bc8d5 (patch) | |
tree | 71778636967ed49483d7b20f86d84e9530a89f8d /contrib/gcclibs/libcpp/makeucnid.c | |
parent | c884926273902ab83911a8b89c520ff5a8c58b20 (diff) | |
download | FreeBSD-src-f889028338d27bce7743ea9cf0a00609d17bc8d5.zip FreeBSD-src-f889028338d27bce7743ea9cf0a00609d17bc8d5.tar.gz |
The DIOCKILLSRCNODES operation was implemented with O(m*n) complexity,
where "m" is number of source nodes and "n" is number of states. Thus,
on heavy loaded router its processing consumed a lot of CPU time.
Reimplement it with O(m+n) complexity. We first scan through source
nodes and disconnect matching ones, putting them on the freelist and
marking with a cookie value in their expire field. Then we scan through
the states, detecting references to source nodes with a cookie, and
disconnect them as well. Then the freelist is passed to pf_free_src_nodes().
In collaboration with: Kajetan Staszkiewicz <kajetan.staszkiewicz innogames.de>
PR: kern/176763
Sponsored by: InnoGames GmbH
Sponsored by: Nginx, Inc.
Diffstat (limited to 'contrib/gcclibs/libcpp/makeucnid.c')
0 files changed, 0 insertions, 0 deletions