From nobody Sun May 5 19:51:05 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 1506446813157811.1328478560132; Tue, 26 Sep 2017 10:26:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 83764C0587F2; Tue, 26 Sep 2017 17:26:51 +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 59E5862463; Tue, 26 Sep 2017 17:26:50 +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 18E16410A9; Tue, 26 Sep 2017 17:26:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v8QH6U6a019250 for ; Tue, 26 Sep 2017 13:06:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 713F868701; Tue, 26 Sep 2017 17:06:30 +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 EDA594140; Tue, 26 Sep 2017 17:06:27 +0000 (UTC) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0BF44C0733F2; Tue, 26 Sep 2017 17:06:27 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id q124so10099977wmb.0; Tue, 26 Sep 2017 10:06:26 -0700 (PDT) Received: from lean.com (bzq-82-81-161-50.red.bezeqint.net. [82.81.161.50]) by smtp.gmail.com with ESMTPSA id x11sm7378565wrb.26.2017.09.26.10.06.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Sep 2017 10:06:25 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 83764C0587F2 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 83764C0587F2 Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rr5lBgXN" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0BF44C0733F2 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=nirsof@gmail.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0BF44C0733F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=X4O4ybIVVgEXQ1kB/Aj5Y7ChJC6lPoHk1k1ByL0fDe4=; b=rr5lBgXN5qTQaZGQgZvHDJ+IyxhVBSxknUR/uvuUXn6mJMUtpWr++MlEdYNm7QiUKT PL6Qr2+cvOozocKMwDoV0XB04QMo7ng5ejRsrK7Sjk1ZrCan9OoufpJYcrveIgMfX5Dt PcxdEBtLY7QEeXlwIqHagIpoktEI0EpsnvfddgUmiTspIVwcM+XFrfIZamN7moE3391M f4eSgKEjMSP69IrkQ36vhEEXv5VUH/hyD1+Ze3V1A/nGjl17uv1x6x8Em8xs/8sf7hIV 1PTaC5tql8qrL/SXXVZkBpCdcyOQPObQXTwdfKsy1GbqdxoizES+6ibGQ9woryHq8bWd j5MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=X4O4ybIVVgEXQ1kB/Aj5Y7ChJC6lPoHk1k1ByL0fDe4=; b=qqhG43qQjZyd8QQ1A77W5OmASs2j16q2+RBdMUVCcxe35OIK7ao6PFJucRbikUBuq/ KGpJ3hnZWr6f9l82IZOXX6wd8s66vpOx1/Zd0d+5HFVM9YkWJXB8kiCfYwihJcGTlF3k 1U6xgzhTDaYYWbT4b8p+I+cpRpSn8Thnbz4DPaxJZa+SpkT0Ib5um+P0lOGZCmYctnAo gzHX+V3WB/msfuz22WzLUa+B7aLDOOsG7inxZIZxc06dBdZqQNnXwYh9WPTQMtQ8Vg6R eufBgakiudBWmiXf0DpL2eVZoY6AZxOTj4gTPoMQ23uwWUaYOibSZRM5XfQaC0iSjLtC V9vg== X-Gm-Message-State: AHPjjUiMpbIYnys5vTKfhwjSRc2qoOXbq40yDt0RKj2EB7BJ7L98cb06 ReiPBmEK1LrL1RBKxYVz9c2c54oL9rU= X-Google-Smtp-Source: AOwi7QCXR4i9KplsDqSmpMbQ4dQjN76SFAy1JGv4XqCSYk+yW6cpFgOyfzL9A37cNovPUHojRKXZ2Q== X-Received: by 10.28.47.200 with SMTP id v191mr3725588wmv.31.1506445585530; Tue, 26 Sep 2017 10:06:25 -0700 (PDT) From: Nir Soffer To: libvir-list@redhat.com Date: Tue, 26 Sep 2017 20:05:59 +0300 Message-Id: <20170926170559.4003-1-nirsof@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 26 Sep 2017 17:06:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 26 Sep 2017 17:06:27 +0000 (UTC) for IP:'74.125.82.66' DOMAIN:'mail-wm0-f66.google.com' HELO:'mail-wm0-f66.google.com' FROM:'nirsof@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.37 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 74.125.82.66 mail-wm0-f66.google.com 74.125.82.66 mail-wm0-f66.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Adam Litke , Pavel Hrdina , Nir Soffer Subject: [libvirt] [PATCH python] Release the GIL during virDomainGetMemoryStats 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 26 Sep 2017 17:26:52 +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" We discovered that the entire python process get stuck for about 30 seconds when calling virDomain.getMemoryStats() if libvirt is stuck in virConnect.getAllDomainStats() on inaccessible storage. This blocking cause a horrible mess in oVirt. This patches adds the standard *_ALLOW_THREADS around the call to avoid this unwanted blocking. Signed-off-by: Nir Soffer Reviewed-by: Daniel P. Berrange --- libvirt-override.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libvirt-override.c b/libvirt-override.c index 9eba4ed..0e33afb 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -363,8 +363,11 @@ libvirt_virDomainMemoryStats(PyObject *self ATTRIBUTE_= UNUSED, return NULL; domain =3D (virDomainPtr) PyvirDomain_Get(pyobj_domain); =20 + LIBVIRT_BEGIN_ALLOW_THREADS; nr_stats =3D virDomainMemoryStats(domain, stats, VIR_DOMAIN_MEMORY_STAT_NR, 0); + LIBVIRT_END_ALLOW_THREADS; + if (nr_stats =3D=3D -1) return VIR_PY_NONE; =20 --=20 2.9.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list