Re: [PATCH] netfilter: nf_conncount: reduce unnecessary GC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



William Tu <u9012063@xxxxxxxxx> wrote:
> @@ -231,6 +236,12 @@ bool nf_conncount_gc_list(struct net *net,
>  	if (!spin_trylock(&list->list_lock))
>  		return false;
>  
> +	/* don't bother if we just done GC */
> +	if (time_after_eq(list->last_gc, jiffies)) {
> +		spin_unlock(&list->list_lock);

Minor nit, I think you could place the time_after_eq test before
the spin_trylock if you do wrap the list->last_gc read with READ_ONCE().

You could also check if changing last_gc to u32 and placing it after
the "list_lock" member prevents growth of the list structure.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux