direct-io.hg

changeset 8422:97d70c793b67

Fix smp_processor_id to be linked to correct processor id under vcpu, which is
the exact one updated by scheduler. Or else easy to think how things get
messed under SMP environment. One phenomenon observed is about softirq.
Exit path on CPU1 checks pending indicator by local_cpu_data, and then
goto do_softirq if pending true. However do_softirq uses cpu_data(cpu)
to query pending bit again. Cpu index is aquired from smp_processor_id,
with thread_info->cpu not cared by scheduler. Finally do_softirq on CPU1
tries to operate percpu data on CPU0 then.

Also disable several prints within critical path, like sending IPI. Due to
slow serial speed, this will slow down overall performance heavily since
event channels among CPUs are in traffic.

This patch is necessary for host SMP.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
author djm@kirby.fc.hp.com
date Wed Dec 21 08:40:16 2005 -0600 (2005-12-21)
parents ff81b875b136
children 663c487a5f2c
files xen/arch/ia64/linux-xen/irq_ia64.c xen/arch/ia64/linux-xen/smp.c xen/arch/ia64/vmx/vmx_irq_ia64.c xen/include/asm-ia64/config.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/irq_ia64.c	Wed Dec 21 08:36:03 2005 -0600
     1.2 +++ b/xen/arch/ia64/linux-xen/irq_ia64.c	Wed Dec 21 08:40:16 2005 -0600
     1.3 @@ -282,7 +282,7 @@ ia64_send_ipi (int cpu, int vector, int 
     1.4  	ipi_addr = ipi_base_addr + ((phys_cpu_id << 4) | ((redirect & 1) << 3));
     1.5  
     1.6  #ifdef XEN
     1.7 -	printf ("send_ipi to %d (%x)\n", cpu, phys_cpu_id);
     1.8 +	//printf ("send_ipi to %d (%x)\n", cpu, phys_cpu_id);
     1.9  #endif
    1.10  	writeq(ipi_data, ipi_addr);
    1.11  }
     2.1 --- a/xen/arch/ia64/linux-xen/smp.c	Wed Dec 21 08:36:03 2005 -0600
     2.2 +++ b/xen/arch/ia64/linux-xen/smp.c	Wed Dec 21 08:40:16 2005 -0600
     2.3 @@ -73,7 +73,7 @@ void smp_send_event_check_mask(cpumask_t
     2.4      if (cpus_empty(mask))
     2.5          return;
     2.6  
     2.7 -    printf("smp_send_event_check_mask called\n");
     2.8 +    //printf("smp_send_event_check_mask called\n");
     2.9  
    2.10      for (cpu = 0; cpu < NR_CPUS; ++cpu)
    2.11          if (cpu_isset(cpu, mask))
     3.1 --- a/xen/arch/ia64/vmx/vmx_irq_ia64.c	Wed Dec 21 08:36:03 2005 -0600
     3.2 +++ b/xen/arch/ia64/vmx/vmx_irq_ia64.c	Wed Dec 21 08:40:16 2005 -0600
     3.3 @@ -117,9 +117,6 @@ vmx_ia64_handle_irq (ia64_vector vector,
     3.4  		local_irq_disable();
     3.5  		ia64_setreg(_IA64_REG_CR_TPR, saved_tpr);
     3.6  	    }
     3.7 -	    else {
     3.8 -                printf("Oops: RESCHEDULE IPI absorbed by HV\n");
     3.9 -            }
    3.10  	    ia64_eoi();
    3.11  	    vector = ia64_get_ivr();
    3.12  	}
     4.1 --- a/xen/include/asm-ia64/config.h	Wed Dec 21 08:36:03 2005 -0600
     4.2 +++ b/xen/include/asm-ia64/config.h	Wed Dec 21 08:40:16 2005 -0600
     4.3 @@ -300,7 +300,7 @@ extern int ht_per_core;
     4.4  
     4.5  // needed for include/xen/smp.h
     4.6  #ifdef CONFIG_SMP
     4.7 -#define __smp_processor_id()	current_thread_info()->cpu
     4.8 +#define __smp_processor_id()	current->processor
     4.9  #else
    4.10  #define __smp_processor_id()	0
    4.11  #endif