From 6814f08e937e846cd25430d7fa500f62fb1c3d67 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 23 Dec 2019 20:22:37 +0100 Subject: [PATCH] flow-manager: only update FlowBucket::next_ts if it changed --- src/flow-manager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/flow-manager.c b/src/flow-manager.c index 83672d48c7..b8bb87acef 100644 --- a/src/flow-manager.c +++ b/src/flow-manager.c @@ -483,7 +483,9 @@ static uint32_t FlowTimeoutHash(struct timeval *ts, uint32_t try_cnt, /* we have a flow, or more than one */ cnt += FlowManagerHashRowTimeout(fb->tail, ts, emergency, counters, &next_ts); - SC_ATOMIC_SET(fb->next_ts, next_ts); + if (SC_ATOMIC_GET(fb->next_ts) != next_ts) { + SC_ATOMIC_SET(fb->next_ts, next_ts); + } next: FBLOCK_UNLOCK(fb); -- 2.47.3