All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Straub <lukasstraub2@web.de>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: Zhang Chen <chen.zhang@intel.com>,
	Jason Wang <jasowang@redhat.com>,
	Li Zhijian <lizhijian@cn.fujitsu.com>
Subject: [PATCH 2/2] net/colo-compare.c: Optimize removal of secondary packet
Date: Sun, 15 Nov 2020 12:19:06 +0100	[thread overview]
Message-ID: <fa4d5eb0bb2ea3f247af5bb7792499cf9cd56a14.1605438886.git.lukasstraub2@web.de> (raw)
In-Reply-To: <cover.1605438886.git.lukasstraub2@web.de>

[-- Attachment #1: Type: text/plain, Size: 879 bytes --]

g_queue_remove needs to look up the list entry first, but we
already have it as result and can remove it directly with
g_queue_delete_link.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
---
 net/colo-compare.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/colo-compare.c b/net/colo-compare.c
index eed0fbb27b..4e2af8ff00 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -691,7 +691,7 @@ static void colo_compare_packet(CompareState *s, Connection *conn,
         if (result) {
             colo_release_primary_pkt(s, pkt);
             packet_destroy(result->data, NULL);
-            g_queue_remove(&conn->secondary_list, result->data);
+            g_queue_delete_link(&conn->secondary_list, result);
         } else {
             /*
              * If one packet arrive late, the secondary_list or
--
2.20.1

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2020-11-15 11:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-15 11:18 [PATCH 0/2] colo-compare: Fix memory leak for non-tcp packet Lukas Straub
2020-11-15 11:19 ` [PATCH 1/2] net/colo-compare.c: " Lukas Straub
2020-11-16  7:31   ` Zhang, Chen
2020-11-15 11:19 ` Lukas Straub [this message]
2020-11-16  7:31   ` [PATCH 2/2] net/colo-compare.c: Optimize removal of secondary packet Zhang, Chen
2020-11-16  7:32 ` [PATCH 0/2] colo-compare: Fix memory leak for non-tcp packet Zhang, Chen
2021-03-17 21:23   ` Lukas Straub
2021-03-18  1:22     ` Zhang, Chen
2021-03-18  2:41       ` Jason Wang
2021-03-18  3:26         ` Zhang, Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa4d5eb0bb2ea3f247af5bb7792499cf9cd56a14.1605438886.git.lukasstraub2@web.de \
    --to=lukasstraub2@web.de \
    --cc=chen.zhang@intel.com \
    --cc=jasowang@redhat.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.