PERFORCE change 133567 for review
Scott Long
scottl at FreeBSD.org
Fri Jan 18 10:18:06 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=133567
Change 133567 by scottl at scottl-ix on 2008/01/18 18:17:17
Reduce the size of the hammer used in the message passer, and
fix some nearby style.
Affected files ...
.. //depot/projects/xen31-xenbus/sys/xen/xenbus/xenbus_xs.c#3 edit
Differences ...
==== //depot/projects/xen31-xenbus/sys/xen/xenbus/xenbus_xs.c#3 (text+ko) ====
@@ -142,41 +142,40 @@
static void *read_reply(enum xsd_sockmsg_type *type, unsigned int *len)
{
- struct xs_stored_msg *msg;
- char *body;
- int i;
-
-
- spin_lock(&xs_state.reply_lock);
+ struct xs_stored_msg *msg;
+ char *body;
+ int i;
+
+ spin_lock(&xs_state.reply_lock);
- while (list_empty(&xs_state.reply_list)) {
- spin_unlock(&xs_state.reply_lock);
- if (scheduler_running == 0) {
- /*
- * Give other domain time to run :-/
- */
- for (i = 0; i < 1000000; i++)
- HYPERVISOR_yield();
- xs_process_msg();
- }
- wait_event_interruptible(&xs_state.reply_waitq,
- !list_empty(&xs_state.reply_list));
- spin_lock(&xs_state.reply_lock);
+ while (list_empty(&xs_state.reply_list)) {
+ spin_unlock(&xs_state.reply_lock);
+ if (scheduler_running == 0) {
+ /*
+ * Give other domain time to run :-/
+ */
+ for (i = 0; i < 1000; i++)
+ HYPERVISOR_yield();
+ xs_process_msg();
}
+ wait_event_interruptible(&xs_state.reply_waitq,
+ !list_empty(&xs_state.reply_list));
+ spin_lock(&xs_state.reply_lock);
+ }
- msg = TAILQ_FIRST(&xs_state.reply_list);
- list_del(&xs_state.reply_list, msg);
+ msg = TAILQ_FIRST(&xs_state.reply_list);
+ list_del(&xs_state.reply_list, msg);
- spin_unlock(&xs_state.reply_lock);
+ spin_unlock(&xs_state.reply_lock);
- *type = msg->hdr.type;
- if (len)
- *len = msg->hdr.len;
- body = msg->u.reply.body;
+ *type = msg->hdr.type;
+ if (len)
+ *len = msg->hdr.len;
+ body = msg->u.reply.body;
- kfree(msg);
+ kfree(msg);
- return body;
+ return body;
}
#if 0
More information about the p4-projects
mailing list