Date: Mon, 15 Jan 2007 23:15:51 GMT From: Paolo Pisati <piso@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 112959 for review Message-ID: <200701152315.l0FNFpsm037970@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=112959 Change 112959 by piso@piso_newluxor on 2007/01/15 23:15:43 Looks like we don't need intr_table_lock while scanning through interrupt_sources[]. While here, do some spacing and indentation according to style. Affected files ... .. //depot/projects/soc2006/intr_filter/amd64/amd64/intr_machdep.c#21 edit Differences ... ==== //depot/projects/soc2006/intr_filter/amd64/amd64/intr_machdep.c#21 (text+ko) ==== @@ -227,10 +227,13 @@ walk_intr_src(void) { struct intsrc *isrc; static int i = 0; + int j; - for (; i<NUM_IO_INTS; ) { - int j = i++; + for (; i < NUM_IO_INTS;) { + j = i++; + mtx_lock_spin(&intr_table_lock); isrc = interrupt_sources[j]; + mtx_unlock_spin(&intr_table_lock); if (isrc != NULL && isrc->is_event != NULL) return (isrc->is_event); } @@ -242,9 +245,8 @@ intr_callout_reset(void) { - mtx_lock_spin(&intr_table_lock); - callout_reset(&stray_callout_handle, hz, &stray_detection, &walk_intr_src); - mtx_unlock_spin(&intr_table_lock); + callout_reset(&stray_callout_handle, hz, &stray_detection, + &walk_intr_src); } void @@ -397,7 +399,7 @@ intrcnt_index = 1; STAILQ_INIT(&pics); mtx_init(&intr_table_lock, "intr table", NULL, MTX_SPIN); - callout_init_mtx(&stray_callout_handle, &intr_table_lock, 0); + callout_init(&stray_callout_handle, 1); } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701152315.l0FNFpsm037970>