From nobody Thu May 9 23:04:26 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1710526048099290.6266759912064; Fri, 15 Mar 2024 11:07:28 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 9D3D61B41; Fri, 15 Mar 2024 14:07:26 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 2AEAD1B4A; Fri, 15 Mar 2024 14:05:40 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 22D801BFD; Wed, 13 Mar 2024 23:23:16 -0400 (EDT) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 3BF0818B1 for ; Wed, 13 Mar 2024 23:23:15 -0400 (EDT) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1de0f92e649so1163475ad.0 for ; Wed, 13 Mar 2024 20:23:15 -0700 (PDT) Received: from localhost.localdomain ([111.108.111.136]) by smtp.gmail.com with ESMTPSA id u3-20020a170902e20300b001dcb654d1a5sm392627plb.21.2024.03.13.20.23.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2024 20:23:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710386593; x=1710991393; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gz9XSFfOx4YCanx0GBHONvUr4yzcy1WwNAT+XMo7rG4=; b=c63lRzvgPKteHx/c6gOJaDWBkTMdA2u4djquyzStOUn+ZfzrRuuW53EYis6+9iJbD7 trUw2bDKE8D9U02uS3/pAqsHqovhi68/kj0XCbPHeNDBACaWRk7akW/NI4ekeW5zJMML 1Q1osug0yZF8X2FMHTlx1njA99ohzUKTKCmIXvbFNfY0Mc8p+6DpALCLGDDW1uInhrI5 5urxWFFNCLTeUMFH5gWbsreFTbJLUq30qJhjJ9d0L7uervLQgIaNFE8UYhSMHzILRv2L eaDuwOGsi1O+GFIEegWEFu7diCLgHOe4ZKTR6dARV6mUK65d4IcDl1iyhSe5aR0sscSc Ne8w== X-Gm-Message-State: AOJu0YwnykoMR1VE4bH33LksD5y/dy7dqQeUogJvcDbw3IjkG8PsZSMT pgYPAw2eYgnsrdCr7B07C3D/bVPQelc98lGhJTy0azX5lwsJsYJ6RdYoql+9 X-Google-Smtp-Source: AGHT+IGFPwVeOmmS6Lz55/A3HU4uE4JK/iuWaPTqKybhmaEg4kcnMQu+4tUGeG6KzDmSRV+zQIm+kg== X-Received: by 2002:a17:902:e54f:b0:1dd:a34:7321 with SMTP id n15-20020a170902e54f00b001dd0a347321mr688084plf.25.1710386593300; Wed, 13 Mar 2024 20:23:13 -0700 (PDT) From: Wei Gong To: devel@lists.libvirt.org Subject: [PATCH] virthreadpool: create threads from the newly expanded workers Date: Thu, 14 Mar 2024 11:23:02 +0800 Message-Id: <20240314032302.2458-1-gongwei833x@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) MIME-Version: 1.0 X-MailFrom: gongwei833x@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 Message-ID-Hash: GRXSLZAOMOYMPMEXFED4KCQMEAMICQEF X-Message-ID-Hash: GRXSLZAOMOYMPMEXFED4KCQMEAMICQEF X-Mailman-Approved-At: Fri, 15 Mar 2024 18:05:33 -0400 CC: Wei Gong X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1710526048687100001 when the thread pool is dynamically expanded, threads should not be created from the existing workers; they should be created from the newly expanded workers Signed-off-by: Wei Gong --- src/util/virthreadpool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virthreadpool.c b/src/util/virthreadpool.c index d45fa92061..6140b7a0a3 100644 --- a/src/util/virthreadpool.c +++ b/src/util/virthreadpool.c @@ -199,7 +199,7 @@ virThreadPoolExpand(virThreadPool *pool, size_t gain, b= ool priority) else name =3D g_strdup(pool->jobName); =20 - if (virThreadCreateFull(&(*workers)[i], + if (virThreadCreateFull(&(*workers)[*curWorkers - gain + i], false, virThreadPoolWorker, name, --=20 2.32.1 (Apple Git-133) _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org