All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>
Subject: [Xen-devel] [PATCH 6/8] libxl: event: Break out baton_wake
Date: Fri, 10 Jan 2020 13:29:00 +0000	[thread overview]
Message-ID: <20200110132902.29295-7-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <20200110132902.29295-1-ian.jackson@eu.citrix.com>

No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 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 05559cad9a..4d57843cce 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -42,6 +42,18 @@ static void pollers_note_osevent_added(libxl_ctx *ctx) {
         poller->osevents_added = 1;
 }
 
+static void baton_wake(libxl__egc *egc, libxl__poller *wake)
+{
+    libxl__poller_wakeup(egc, 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_cleanup_1_baton(libxl__egc *egc)
 {
     EGC_GC;
@@ -62,14 +74,7 @@ void libxl__egc_cleanup_1_baton(libxl__egc *egc)
         /* no-one in libxl waiting for any events */
         return;
 
-    libxl__poller_wakeup(egc, 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(egc, wake);
 }
 
 /*
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2020-01-10 13:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10 13:28 [Xen-devel] [PATCH 0/8] libxl: event: Fix hang for some applications Ian Jackson
2020-01-10 13:28 ` [Xen-devel] [PATCH 1/8] libxl: event: Rename poller.fds_changed to .fds_deregistered Ian Jackson
2020-01-10 13:28 ` [Xen-devel] [PATCH 2/8] libxl: event: Rename ctx.pollers_fd_changed to .pollers_active Ian Jackson
2020-01-10 13:28 ` [Xen-devel] [PATCH 3/8] libxl: event: Introduce CTX_UNLOCK_EGC_FREE Ian Jackson
2020-01-10 13:28 ` [Xen-devel] [PATCH 4/8] libxl: event: Fix hang when mixing blocking and eventy calls Ian Jackson
2020-01-10 13:28 ` [Xen-devel] [PATCH 5/8] libxl: event: poller pipe optimisation Ian Jackson
2020-01-10 13:29 ` Ian Jackson [this message]
2020-01-10 13:29 ` [Xen-devel] [PATCH 7/8] libxl: event: Fix possible hang with libxl_osevent_beforepoll Ian Jackson
2020-01-10 13:29 ` [Xen-devel] [PATCH 8/8] libxl: event: Move poller pipe emptying to the end of afterpoll Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200110132902.29295-7-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.