Kip Macy
2005-Mar-24 21:22 UTC
[Xen-devel] [patch] small accounting and lockup fix for xenfreebsd on -unstable
# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/03/23 18:27:49-08:00 kmacy@shemp.lab.netapp.com # only bump tmpindex by NKPT-1 once # release sched lock on upcall # Signed-off-by: Kip Macy <kmacy@fsmware.com> # # freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c # 2005/03/23 18:24:47-08:00 kmacy@shemp.lab.netapp.com +0 -4 # remove extra bump of tmpindex # # freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c # 2005/03/23 18:24:47-08:00 kmacy@shemp.lab.netapp.com +7 -3 # release sched lock on upcall # diff -Nru a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c --- a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c 2005-03-24 13:19:58 -08:00 +++ b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c 2005-03-24 13:19:58 -08:00 @@ -54,16 +54,16 @@ { unsigned long l1, l2; unsigned int l1i, l2i, port; - int irq; + int irq, owned; unsigned long flags; shared_info_t *s = HYPERVISOR_shared_info; vcpu_info_t *vcpu_info = &s->vcpu_data[smp_processor_id()]; local_irq_save(flags); - while ( s->vcpu_data[0].evtchn_upcall_pending ) + while ( vcpu_info->evtchn_upcall_pending ) { - s->vcpu_data[0].evtchn_upcall_pending = 0; + vcpu_info->evtchn_upcall_pending = 0; /* NB. No need for a barrier here -- XCHG is a barrier on x86. */ l1 = xen_xchg(&vcpu_info->evtchn_pending_sel, 0); while ( (l1i = ffs(l1)) != 0 ) @@ -78,12 +78,16 @@ l2 &= ~(1 << l2i); port = (l1i << 5) + l2i; + if ((owned = mtx_recursed(&sched_lock)) != 0) + mtx_unlock_spin_flags(&sched_lock, MTX_QUIET); if ( (irq = evtchn_to_irq[port]) != -1 ) { struct intsrc *isrc = intr_lookup_source(irq); intr_execute_handlers(isrc, frame); } else { evtchn_device_upcall(port); } + if (owned) + mtx_lock_spin_flags(&sched_lock, MTX_QUIET); } } } diff -Nru a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c --- a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c 2005-03-24 13:19:58 -08:00 +++ b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c 2005-03-24 13:19:58 -08:00 @@ -1454,10 +1454,6 @@ for (i = 0; i < NKPT-1; i++, tmpindex++) xpq_queue_pt_update(IdlePTD + KPTDI + i + 1, xpmap_ptom((tmpindex << PAGE_SHIFT))| PG_M | PG_RW | PG_V | PG_A); tmpindex += NKPT-1; - - - - tmpindex += NKPT-1; PT_UPDATES_FLUSH(); HYPERVISOR_shared_info = (shared_info_t *)(KERNBASE + (tmpindex << PAGE_SHIFT)); ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel