2828
2929
3030extern void dtrace_sync_func (void );
31- int in_xcall ;
31+ int in_xcall = -1 ;
3232char nmi_masks [NCPU ];
3333
3434/**********************************************************************/
@@ -294,36 +294,19 @@ void
294294dtrace_xcall1 (processorid_t cpu , dtrace_xcall_t func , void * arg )
295295{
296296
297- /***********************************************/
298- /* We dont disable interrupts whilst doing */
299- /* an xcall. We may have two cpus trying to */
300- /* do this at the same time, so we need to */
301- /* run in a lockless mode. */
302- /* */
303- /* We do run with preempt_disable to avoid */
304- /* any chance of rescheduling the calling */
305- /* process whilst we wait for long periods */
306- /* of time. (Note that disable is not */
307- /* nested; does this matter if we have */
308- /* multiple cpus coming in at the same */
309- /* time? */
310- /***********************************************/
311- // preempt_disable();
312-
313297 /***********************************************/
314298 /* Just track re-entrancy events - we will */
315299 /* be lockless in dtrace_xcall2. */
316300 /***********************************************/
317- if (in_xcall ) {
301+ if (in_xcall >= 0 && (cnt_xcall0 < 500 || (cnt_xcall0 % 50 ) == 0 )) {
302+ dtrace_printf ("x_call: re-entrant call in progress (%d) other=%d.\n" , cnt_xcall0 , in_xcall );
318303 cnt_xcall0 ++ ;
319- if (cnt_xcall0 < 10 || (cnt_xcall0 % 50 ) == 0 )
320- dtrace_printf ("x_call: re-entrant call in progress (%d).\n" , cnt_xcall0 );
321- //dump_all_stacks();
322304 }
323- in_xcall = 1 ;
305+ in_xcall = smp_processor_id ();
306+ //int flags = dtrace_interrupt_disable();
324307 dtrace_xcall2 (cpu , func , arg );
325- in_xcall = 0 ;
326- // preempt_enable() ;
308+ //dtrace_interrupt_enable(flags) ;
309+ in_xcall = -1 ;
327310}
328311void
329312dtrace_xcall2 (processorid_t cpu , dtrace_xcall_t func , void * arg )
@@ -434,6 +417,7 @@ typedef struct cpumask cpumask_t;
434417 dtrace_printf ("[%d] cpu%d in wrong state (state=%d)\n" ,
435418 smp_processor_id (), c , xc -> xc_state );
436419 }
420+ // xcall_slave2();
437421 if (cnt == 100 * 1000 * 1000 ) {
438422 dtrace_printf ("[%d] cpu%d - busting lock\n" ,
439423 smp_processor_id (), c );
@@ -485,7 +469,6 @@ typedef struct cpumask cpumask_t;
485469 /* us whilst we are calling them. */
486470 /***********************************************/
487471 while (cpus_todo > 0 ) {
488- //static int first = 1;
489472 for (c = 0 ; c < nr_cpus && cpus_todo > 0 ; c ++ ) {
490473 xcall_slave2 ();
491474 if (c == cpu_id || (cpu & (1 << c )) == 0 )
@@ -495,17 +478,12 @@ typedef struct cpumask cpumask_t;
495478 /* Wait a little while for this cpu to */
496479 /* respond before going on to the next one. */
497480 /***********************************************/
498- if (ack_wait (c , 1000 )) {
481+ if (ack_wait (c , 100 )) {
499482 cpus_todo -- ;
500483 cpu &= ~(1 << c );
501484 }
502485 }
503- /*if (cpus_todo > 0 && first) {
504- cnt_xcall8++;
505- void dump_all_stacks(void); first = FALSE; dtrace_printf("xcall deadlock:\n"); }
506- */
507486 }
508-
509487// smp_mb();
510488
511489 xcall_levels [cpu_id ]-- ;
0 commit comments