From nobody Sun May 5 18:00:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1515684785362896.054820138725; Thu, 11 Jan 2018 07:33:05 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C641354F78; Thu, 11 Jan 2018 15:32:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3D409CC9; Thu, 11 Jan 2018 15:32:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id ECE5D410B4; Thu, 11 Jan 2018 15:32:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0BFW5lC027872 for ; Thu, 11 Jan 2018 10:32:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id A3CB69CCC; Thu, 11 Jan 2018 15:32:05 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A5A56017B for ; Thu, 11 Jan 2018 15:31:59 +0000 (UTC) Received: from m12-18.163.com (m12-18.163.com [220.181.12.18]) by mx1.redhat.com (Postfix) with ESMTP id 9803DC014170 for ; Thu, 11 Jan 2018 15:31:30 +0000 (UTC) Received: from localhost.localdomain (unknown [223.74.158.251]) by smtp14 (Coremail) with SMTP id EsCowADHzWZCg1dahhToCQ--.9832S2; Thu, 11 Jan 2018 23:31:15 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=JiO7YyTAw5zD6jEAEN OiA+Jlf1E6DyvKurqJovmmwA8=; b=HVR4qAaf22Ga8yZtW1tDOowvH7yadmckZQ sg3Szr1j2xJobi3ACcZpC7M0/GbZIuK3JyUD2fFHOzAx6jkxHrkYt8KoZviZyGm6 ksu/vflTLwlknni+ig7jU/zXxTUWECM1NssqyGzrfWlEhD0y03jlqY/PwxyY2oYB lRXAlbVLA= From: Di Wei To: libvir-list@redhat.com Date: Thu, 11 Jan 2018 23:30:41 +0800 Message-Id: <20180111153041.6047-1-dwlinuxkernel@163.com> X-CM-TRANSID: EsCowADHzWZCg1dahhToCQ--.9832S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jr1DJr1rtr1ftr4rWr45Jrb_yoWfKrc_Zw 48C3WxGFZxtas2vF1jyrW5Zwnaqa909w1jgr4ay348WFW8C39xXa1xZa48Ww17uw1DtFyf J3W8XrWDCw17CjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xREyxRPUUUUU== X-Originating-IP: [223.74.158.251] X-CM-SenderInfo: pgzox0px0nv2xqhoqiywtou0bp/xtbBbAPKL1c7AsJTHAAAsp X-Greylist: Sender passed SPF test, ACL 227 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 11 Jan 2018 15:31:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 11 Jan 2018 15:31:47 +0000 (UTC) for IP:'220.181.12.18' DOMAIN:'m12-18.163.com' HELO:'m12-18.163.com' FROM:'dwlinuxkernel@163.com' RCPT:'' X-RedHat-Spam-Score: 1.991 * (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_PSBL, T_RP_MATCHES_RCVD) 220.181.12.18 m12-18.163.com 220.181.12.18 m12-18.163.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Di Wei Subject: [libvirt] [PATCH] fixed bug:if expand thread pool, will lose some one X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 11 Jan 2018 15:33:03 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- src/util/virthreadpool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/virthreadpool.c b/src/util/virthreadpool.c index 10f2bd2..0983ee2 100644 --- a/src/util/virthreadpool.c +++ b/src/util/virthreadpool.c @@ -186,6 +186,7 @@ virThreadPoolExpand(virThreadPoolPtr pool, size_t gain,= bool priority) size_t *curWorkers =3D priority ? &pool->nPrioWorkers : &pool->nWorker= s; size_t i =3D 0; struct virThreadPoolWorkerData *data =3D NULL; + size_t oldNWorkers =3D *curWorkers; =20 if (VIR_EXPAND_N(*workers, *curWorkers, gain) < 0) return -1; @@ -198,7 +199,7 @@ virThreadPoolExpand(virThreadPoolPtr pool, size_t gain,= bool priority) data->cond =3D priority ? &pool->prioCond : &pool->cond; data->priority =3D priority; =20 - if (virThreadCreateFull(&(*workers)[i], + if (virThreadCreateFull(&(*workers)[i + oldNWorkers], false, virThreadPoolWorker, pool->jobFuncName, --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list