[ovs-dev] [PATCH] conntrack: set the minimum limit for ct clean

Darrell Ball dlu998 at gmail.com
Fri Mar 29 16:53:18 UTC 2019


good catch Liujiaxin

I sent an alternative patch here

https://mail.openvswitch.org/pipermail/ovs-dev/2019-March/357710.html

Do it make sense to you ?

Darrell

On Fri, Mar 29, 2019 at 2:49 AM Liujiaxin <liujiaxin.5592019 at gmail.com>
wrote:

> From: Liujiaxin <liujiaxin.2019 at bytedance.com>
>
> if pre_count less than 10 and n_conn_limit less than CONNTRACK_BUCKETS *
> 10, the limit for sweep_bucket will be 0, so the expired connections in
> bucket can not be clean.
>
> set the minimum limit to 10.
>
> Signed-off-by: Liujiaxin <liujiaxin.2019 at bytedance.com>
> ---
>  lib/conntrack.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/conntrack.c b/lib/conntrack.c
> index 9eb27ba63..0663c559b 100644
> --- a/lib/conntrack.c
> +++ b/lib/conntrack.c
> @@ -1505,7 +1505,8 @@ conntrack_clean(struct conntrack *ct, long long now)
>           * the bucket is busier than the others, we limit to 10% of its
>           * current size. */
>          min_exp = sweep_bucket(ct, ctb, now,
> -                MAX(prev_count/10, n_conn_limit/(CONNTRACK_BUCKETS*10)));
> +                MAX(10, MAX(prev_count / 10,
> +                n_conn_limit / (CONNTRACK_BUCKETS * 10))));
>          clean_count += prev_count - hmap_count(&ctb->connections);
>
>          if (min_exp > now) {
> --
> 2.11.0
>
>


More information about the dev mailing list