diff mbox series

[ovs-dev,v1,8/9] conntrack: Do not log empty ct-sweep

Message ID 9940347db5b3f2107001b5c0f89630bcfb9c3898.1613557616.git.grive@u256.net
State New
Headers show
Series conntrack: improve multithread scalability | expand

Commit Message

Gaƫtan Rivet Feb. 17, 2021, 4:34 p.m. UTC
Do not add noise to the DBG log for empty sweeps.
Only log time taken when some connections were cleaned.

Signed-off-by: Gaetan Rivet <grive@u256.net>
Reviewed-by: Eli Britstein <elibr@nvidia.com>
---
 lib/conntrack.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

William Tu Feb. 23, 2021, 10:56 p.m. UTC | #1
On Wed, Feb 17, 2021 at 8:34 AM Gaetan Rivet <grive@u256.net> wrote:
>
> Do not add noise to the DBG log for empty sweeps.
> Only log time taken when some connections were cleaned.
>
> Signed-off-by: Gaetan Rivet <grive@u256.net>
> Reviewed-by: Eli Britstein <elibr@nvidia.com>
> ---

LGTM
Acked-by: William Tu <u9012063@gmail.com>


>  lib/conntrack.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/conntrack.c b/lib/conntrack.c
> index 1b21b79bd..e042683aa 100644
> --- a/lib/conntrack.c
> +++ b/lib/conntrack.c
> @@ -1574,8 +1574,10 @@ ct_sweep(struct conntrack *ct, long long now, size_t limit)
>      }
>
>  out:
> -    VLOG_DBG("conntrack cleanup %"PRIuSIZE" entries in %lld msec", count,
> -             time_msec() - now);
> +    if (count > 0) {
> +        VLOG_DBG("conntrack cleanup %"PRIuSIZE" entries in %lld msec", count,
> +                 time_msec() - now);
> +    }
>      return min_expiration;
>  }
>
> --
> 2.30.0
>
diff mbox series

Patch

diff --git a/lib/conntrack.c b/lib/conntrack.c
index 1b21b79bd..e042683aa 100644
--- a/lib/conntrack.c
+++ b/lib/conntrack.c
@@ -1574,8 +1574,10 @@  ct_sweep(struct conntrack *ct, long long now, size_t limit)
     }
 
 out:
-    VLOG_DBG("conntrack cleanup %"PRIuSIZE" entries in %lld msec", count,
-             time_msec() - now);
+    if (count > 0) {
+        VLOG_DBG("conntrack cleanup %"PRIuSIZE" entries in %lld msec", count,
+                 time_msec() - now);
+    }
     return min_expiration;
 }