Skip to content

Commit

Permalink
netfilter: conntrack: restart gc immediately if GC_MAX_EVICTS is reached
Browse files Browse the repository at this point in the history
When the maximum evictions number is reached, do not wait 5 seconds before
the next run.

CC: Florian Westphal <[email protected]>
Signed-off-by: Nicolas Dichtel <[email protected]>
Acked-by: Florian Westphal <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
  • Loading branch information
NicolasDichtel authored and ummakynes committed Oct 20, 2016
1 parent 1ecc281 commit 7bb6615
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nf_conntrack_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ static void gc_worker(struct work_struct *work)
return;

ratio = scanned ? expired_count * 100 / scanned : 0;
if (ratio >= 90)
if (ratio >= 90 || expired_count == GC_MAX_EVICTS)
next_run = 0;

gc_work->last_bucket = i;
Expand Down

0 comments on commit 7bb6615

Please sign in to comment.