From owner-p4-projects@FreeBSD.ORG Fri Jan 18 18:18:06 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7C11A16A418; Fri, 18 Jan 2008 18:18:06 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28CF216A468 for ; Fri, 18 Jan 2008 18:18:06 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 034A213C4D9 for ; Fri, 18 Jan 2008 18:18:06 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m0III5Pt010677 for ; Fri, 18 Jan 2008 18:18:05 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0III5UH010674 for perforce@freebsd.org; Fri, 18 Jan 2008 18:18:05 GMT (envelope-from scottl@freebsd.org) Date: Fri, 18 Jan 2008 18:18:05 GMT Message-Id: <200801181818.m0III5UH010674@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Cc: Subject: PERFORCE change 133567 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2008 18:18:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=133567 Change 133567 by scottl@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