Module Name:    src
Committed By:   cherry
Date:           Tue Dec 27 07:47:01 UTC 2011

Modified Files:
        src/sys/arch/xen/x86: hypervisor_machdep.c

Log Message:
Optimise branch predict hint for the intended use-case (cross cpu event 
notification)


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/xen/x86/hypervisor_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/x86/hypervisor_machdep.c
diff -u src/sys/arch/xen/x86/hypervisor_machdep.c:1.20 src/sys/arch/xen/x86/hypervisor_machdep.c:1.21
--- src/sys/arch/xen/x86/hypervisor_machdep.c:1.20	Tue Dec 27 07:45:41 2011
+++ src/sys/arch/xen/x86/hypervisor_machdep.c	Tue Dec 27 07:47:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor_machdep.c,v 1.20 2011/12/27 07:45:41 cherry Exp $	*/
+/*	$NetBSD: hypervisor_machdep.c,v 1.21 2011/12/27 07:47:00 cherry Exp $	*/
 
 /*
  *
@@ -54,7 +54,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.20 2011/12/27 07:45:41 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.21 2011/12/27 07:47:00 cherry Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -296,7 +296,7 @@ hypervisor_send_event(struct cpu_info *c
 
 	xen_atomic_set_bit(&s->evtchn_pending[0], ev);
 
-	if (__predict_true(ci == curcpu())) {
+	if (__predict_false(ci == curcpu())) {
 		xen_atomic_set_bit(&vci->evtchn_pending_sel,
 		    ev >> LONG_SHIFT);
 		xen_atomic_set_bit(&vci->evtchn_upcall_pending, 0);

Reply via email to