From patchwork Mon Jan 13 17:08:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11330617 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A451B92A for ; Mon, 13 Jan 2020 17:09:59 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7FCE42084D for ; Mon, 13 Jan 2020 17:09:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="FN6bdqHz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FCE42084D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ir3Cs-0008Dl-PP; Mon, 13 Jan 2020 17:08:50 +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 1ir3Cr-0008Df-4S for xen-devel@lists.xenproject.org; Mon, 13 Jan 2020 17:08:49 +0000 X-Inumbo-ID: 5cb7a0b6-3627-11ea-82b0-12813bfff9fa Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5cb7a0b6-3627-11ea-82b0-12813bfff9fa; Mon, 13 Jan 2020 17:08:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578935328; h=from:to:cc:subject:date:message-id:mime-version; bh=lLf35lJacfDCIEk41tvNt61B4xRqmkfjY/8riKTgEig=; b=FN6bdqHzztwJU6r8wVdXEraRylTWagvh0xlZr+8LKxc394gOMfDwySqQ pFI7be9f7kDLOasOp9QxQY9Slvk5vIeySKgzQjTyrpgnqb5f1WUSYfe5f 7Nps5DudtrKx+jkkNDixsKmFX8U1u9SJ2+kfj+kiLawJZ4kqJk6CXuKwv 4=; Authentication-Results: esa1.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 (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="ian.jackson@eu.citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.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=esa1.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 (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: UZu95OfGvKpF5cbY0vfyLH5VZWYmS/krJVaCTEu861cRdC0J0BVahCKZ5nBJlSuo0q+u57dYR4 tDx+NotaZgnn6hqWTvzBSSYwWKHqwuvvIlJMxmi8fntqL3tyPcBrClUjMLGImDC+80ylitukXI 1OP2mlZGTxxtAoL0qFC4ow8NgH+hXD2LEp42A/bS1ETf1/Ocn+D1+DE+LtbfM7nk/U+muM8HA/ 41p4jl7Bqy/vHdTJw86YTZ8VdannGoNQ+AykHjY9szCz+AfCwup4Ad7dUXsYXaOPCTeSjktK31 nj8= X-SBRS: 2.7 X-MesageID: 11009468 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,429,1571716800"; d="scan'208";a="11009468" From: Ian Jackson To: Date: Mon, 13 Jan 2020 17:08:33 +0000 Message-ID: <20200113170843.21332-1-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 00/10] libxl: event: Fix hang for some applications 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: Ian Jackson , George Dunlap Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The meat here, including a description of the bug, is in: libxl: event: Fix hang when mixing blocking and eventy calls Re v1 I wrote: I suggest we try to convince ourselves of its correctness via a second round of code review. I put this into practice by writing an informal proof of correctness. This found a bug, the fixing of which was not entirely trivial. George tells me he tested v1 of this series. As with v1, I have compiled this v2 but not executed it. Ian Jackson (10): libxl: event: Rename poller.fds_changed to .fds_deregistered libxl: event: Rename ctx.pollers_fd_changed to .pollers_active libxl: event: Introduce CTX_UNLOCK_EGC_FREE libxl: event: Make LIBXL__EVENT_DISASTER take a gc, not an egc libxl: event: Make libxl__poller_wakeup take a gc, not an egc libxl: event: Fix hang when mixing blocking and eventy calls libxl: event: poller pipe optimisation libxl: event: Break out baton_wake libxl: event: Fix possible hang with libxl_osevent_beforepoll libxl: event: Move poller pipe emptying to the end of afterpoll tools/libxl/libxl.c | 4 +- tools/libxl/libxl_aoutils.c | 2 +- tools/libxl/libxl_disk.c | 4 +- tools/libxl/libxl_domain.c | 2 +- tools/libxl/libxl_event.c | 286 +++++++++++++++++++++++++++++++++++-------- tools/libxl/libxl_fork.c | 17 ++- tools/libxl/libxl_internal.h | 54 +++++--- 7 files changed, 290 insertions(+), 79 deletions(-) Tested-by: George Dunlap