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

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

 



On Tue, May 3, 2022 at 11:07 PM Florian Westphal <fw@xxxxxxxxx> wrote:
>
> 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().

Thanks! will do in v2.

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

make sense, will use u32.
William



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

  Powered by Linux