[ovs-dev] [PATCH RFC ovn 3/3] northd: Memory cleanup for thread-local match.

Mark Michelson mmichels at redhat.com
Wed Jun 16 17:56:11 UTC 2021


I forgot to do this in the earlier patches, so I'm adding it here. If
this weren't an RFC series, I'd roll this into earlier commits, but I'm
playing a bit more loosely with it here.

Signed-off-by: Mark Michelson <mmichels at redhat.com>
---
 northd/ovn-northd.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 59e3c5f84..9c1de4969 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -11988,6 +11988,7 @@ build_lflows_thread(void *arg)
     struct ovn_igmp_group *igmp_group;
     int bnum;
 
+    struct ds *match = match_get();
     while (!stop_parallel_processing()) {
         wait_for_work(control);
         workload = (struct lflows_thread_pool *) control->workload;
@@ -11995,7 +11996,7 @@ build_lflows_thread(void *arg)
         if (stop_parallel_processing()) {
             return NULL;
         }
-        struct ds *match = match_get_clear();
+        ds_clear(match);
         if (lsi && workload) {
             /* Iterate over bucket ThreadID, ThreadID+size, ... */
             for (bnum = control->id;
@@ -12050,6 +12051,7 @@ build_lflows_thread(void *arg)
         }
         post_completed_work(control);
     }
+    ds_destroy(match);
     return NULL;
 }
 
@@ -14529,6 +14531,9 @@ main(int argc, char *argv[])
     ovsdb_idl_loop_destroy(&ovnsb_idl_loop);
     service_stop();
 
+    struct ds *match = match_get();
+    ds_destroy(match);
+
     exit(res);
 }
 
-- 
2.31.1



More information about the dev mailing list