From patchwork Mon Jan 13 17:08:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11330621 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 5E23492A for ; Mon, 13 Jan 2020 17:10:00 +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 3ACB621739 for ; Mon, 13 Jan 2020 17:10:00 +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="N0R5WWzv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3ACB621739 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 1ir3DC-0008Oj-TG; Mon, 13 Jan 2020 17:09:10 +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 1ir3DB-0008My-1Q for xen-devel@lists.xenproject.org; Mon, 13 Jan 2020 17:09:09 +0000 X-Inumbo-ID: 5dfbe8a7-3627-11ea-82b0-12813bfff9fa Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5dfbe8a7-3627-11ea-82b0-12813bfff9fa; Mon, 13 Jan 2020 17:08:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578935331; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=i/55sdG8xIe88aFcUASAUUGWec9k6tBxqpCiGBrwGIU=; b=N0R5WWzvTedp+Rty+f16ABmZ7ZVgALd0RA5ZfmB9RFe3LU63PnvuBdh5 bqN9693f3+WLsfvIe2FfMnrBUbKoDVDivKJ4qMoFbnqc4tMK59cgl8XMk XNhFN0xEpuVPyCiaORQB097RuVjhe+UvGFfmdbU9TdoE9vP59V7zPsqmq E=; Authentication-Results: esa3.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 (esa3.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=esa3.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="ian.jackson@eu.citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.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=esa3.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 (esa3.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=esa3.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: V7IggCX+hpcQJ1xg5arxneKMdF4QXUncrTwZnqGTFKs3pfd5Geq30vNavlBXdNOXPFX38PpCv+ XFJ9emFmzA7bDrO31udFhffEvkJJ65/U0WDOTQ9df3MKIktKES3w1godrHuUeOSnR5hGtoXqCM vlHS1K2tNUN6X4iYd9YspuJxT2Mpn0BCIZWQ2hRHL7TSuOFmWtWmUu9lwq5qR80A8+lQYPDbVp JpjDqyeu4YleAGn/bX257PtC+7LP1tx8k6wdeNamsLTqF42ilypDMMqc3F75+wlacHhCOpUHN7 188= X-SBRS: 2.7 X-MesageID: 10838969 X-Ironport-Server: esa3.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="10838969" From: Ian Jackson To: Date: Mon, 13 Jan 2020 17:08:41 +0000 Message-ID: <20200113170843.21332-9-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200113170843.21332-1-ian.jackson@eu.citrix.com> References: <20200113170843.21332-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 08/10] libxl: event: Break out baton_wake 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" No functional change. Signed-off-by: Ian Jackson Reviewed-by: George Dunlap --- v2: Now it takes a gc, not an egc. --- tools/libxl/libxl_event.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c index 3e76fa5af5..45cc67942d 100644 --- a/tools/libxl/libxl_event.c +++ b/tools/libxl/libxl_event.c @@ -140,6 +140,18 @@ static void pollers_note_osevent_added(libxl_ctx *ctx) { poller->osevents_added = 1; } +static void baton_wake(libxl__gc *gc, libxl__poller *wake) +{ + libxl__poller_wakeup(gc, wake); + + wake->osevents_added = 0; + /* This serves to make _1_baton idempotent. It is OK even though + * that poller may currently be sleeping on only old osevents, + * because it is going to wake up because we've just prodded it, + * and it pick up new osevents on its next iteration (or pass + * on the baton). */ +} + void libxl__egc_ao_cleanup_1_baton(libxl__gc *gc) /* Any poller we had must have been `put' already. */ { @@ -160,14 +172,7 @@ void libxl__egc_ao_cleanup_1_baton(libxl__gc *gc) /* no-one in libxl waiting for any events */ return; - libxl__poller_wakeup(gc, wake); - - wake->osevents_added = 0; - /* This serves to make _1_baton idempotent. It is OK even though - * that poller may currently be sleeping on only old osevents, - * because it is going to wake up because we've just prodded it, - * and it pick up new osevents on its next iteration (or pass - * on the baton). */ + baton_wake(gc, wake); } /*