From nobody Mon Feb 9 11:06:21 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1578662990; cv=none; d=zohomail.com; s=zohoarc; b=KvT2mF5EL1qXJ2Ou9YwFEXd8CmLXcvK3gih2ih+f6U7XQ8I+rLf29z7Sy9l0JheDk4Q4RS/9uLKfhBZz/ivMurqU1M2F63Th+A43nKhZSgHaab1fMetgeJbwqhVK8grVF2IlKG8ptmrdojfELbvixYID0YgPDEfiS0vp8EmYHQI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578662990; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=d0EcR/95fhM2WFPfeNpcR9OKTD2IHlAvKLCXHtreKb0=; b=V6KWHHrYD/qtcBt/gclVxeL7ztrx5y0jmbc6zdQoPcFSUDLpeacCiYOELvcVHYmx1S3R0XK5IEBAFeU8SuSMBH5uIPUue9eyZVa8QnFp3STVaZrz+9ey56r4rf5DyiKKu384tPOdJ9XLiu/2wu/pIVq4nN7vPdDuszcfV9ssgzk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1578662990430579.7051907682464; Fri, 10 Jan 2020 05:29:50 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipuLt-00024G-U4; Fri, 10 Jan 2020 13:29:25 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipuLs-00022a-EZ for xen-devel@lists.xenproject.org; Fri, 10 Jan 2020 13:29:24 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2f2a09d1-33ad-11ea-bf0f-12813bfff9fa; Fri, 10 Jan 2020 13:29:10 +0000 (UTC) X-Inumbo-ID: 2f2a09d1-33ad-11ea-bf0f-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578662951; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=EQKJVYRxuGecgkUPMzOczs+XFPoxrOfmNieB9m2Ck6c=; b=f7pT50aU3vDRJKUOyxgDj0V+DRcF54KAnqrMAgJ/NFU8XbAoZeTokHu0 qU+HlW9HA2yYukeyRdEbnvdwCHloJRM+7x1NpnUOiJ21DlMvc8tfOgOHi QxVawo0xwgDIOZopRl6spR0s0vAJlvTRbI9u6xvVcWmxhw2C1MqVxKtRd A=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ian.jackson@eu.citrix.com; spf=Pass smtp.mailfrom=Ian.Jackson@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of ian.jackson@eu.citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="ian.jackson@eu.citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of Ian.Jackson@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="Ian.Jackson@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: /3Y4gLvuy/92Dv4CGu/0cx1Ik2zFrx69pbn95ugEw5OTYP/7WKyqVo+XFYI4efRG3J9xzvpLh7 vhvgDArV4WQ3UqsyQnKKF5PZK3bI5A5kKZuiur0MMfC8KDmh0pgvyPSw/7MuPi+mrW29F+yuj6 g6ZFNce3XbidnvL96GPs1YBk5lYyOyYwTfaEZaRk+cwD7JUq1FGB3v+o6FVYZwmVkBKS8ixM7I i376A+XKAwmMty8hXVGlxf+JlVB1uGf+spGbEfBdhwy4NoDHxqCIJMblSyFYl+uqbJqdwG7Txy XOI= X-SBRS: 2.7 X-MesageID: 10756446 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,417,1571716800"; d="scan'208";a="10756446" From: Ian Jackson To: Date: Fri, 10 Jan 2020 13:29:01 +0000 Message-ID: <20200110132902.29295-8-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200110132902.29295-1-ian.jackson@eu.citrix.com> References: <20200110132902.29295-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 7/8] libxl: event: Fix possible hang with libxl_osevent_beforepoll X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , George Dunlap , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) If the application uses libxl_osevent_beforepoll, a similar hang is possible to the one described and fixed in libxl: event: Fix hang when mixing blocking and eventy calls Application behaviour would have to be fairly unusual, but it doesn't seem sensible to just leave this latent bug. We fix the latent bug by waking up the "poller_app" pipe every time we add osevents. If the application does not ever call beforepoll, we write one byte to the pipe and set pipe_nonempty and then we ignore it. We only write another byte if beforepoll is called again. Normally in an eventy program there would only be one thread calling libxl_osevent_beforepoll. The effect in such a program is to sometimes needlessly go round the poll loop again if a timeout callback becomes interested in a new osevent. We'll fix that in a moment. Signed-off-by: Ian Jackson --- tools/libxl/libxl_event.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c index 4d57843cce..4314191c3b 100644 --- a/tools/libxl/libxl_event.c +++ b/tools/libxl/libxl_event.c @@ -59,6 +59,9 @@ void libxl__egc_cleanup_1_baton(libxl__egc *egc) EGC_GC; libxl__poller *search, *wake=3D0; =20 + if (CTX->poller_app->osevents_added) + baton_wake(egc, CTX->poller_app); + LIBXL_LIST_FOREACH(search, &CTX->pollers_active, active_entry) { if (search =3D=3D CTX->poller_app) /* This one is special. We can't give it the baton. */ --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel