IPI: use logical CPU ids in ihk_mc_interrupt_cpu()

Also make remote TLB invalidation arch independent,
removes POSTK_DEBUG_ARCH_DEP_8.

Change-Id: I2b0fbcfa2bfe5da07607863e3e772d8e892e8525
This commit is contained in:
Balazs Gerofi
2019-03-19 16:33:28 +09:00
committed by Dominique Martinet
parent 2cee82673b
commit de042b2cb2
9 changed files with 29 additions and 191 deletions

View File

@@ -996,7 +996,6 @@ void coredump(struct thread *thread, void *regs)
freecore(&coretable);
}
#ifndef POSTK_DEBUG_ARCH_DEP_8
void remote_flush_tlb_cpumask(struct process_vm *vm,
unsigned long addr, int cpu_id)
{
@@ -1053,14 +1052,8 @@ void remote_flush_tlb_array_cpumask(struct process_vm *vm,
dkprintf("remote_flush_tlb_cpumask: flush_ind: %d, addr: 0x%lX, interrupting cpu: %d\n",
flush_ind, addr, cpu);
#ifdef POSTK_DEBUG_ARCH_DEP_8 /* arch depend hide */
/* TODO(pka_idke) Interim support */
ihk_mc_interrupt_cpu(cpu,
ihk_mc_get_vector(flush_ind + IHK_TLB_FLUSH_IRQ_VECTOR_START));
#else /* POSTK_DEBUG_ARCH_DEP_8 */
ihk_mc_interrupt_cpu(get_x86_cpu_local_variable(cpu)->apic_id,
flush_ind + IHK_TLB_FLUSH_IRQ_VECTOR_START);
#endif /* POSTK_DEBUG_ARCH_DEP_8 */
}
#ifdef DEBUG_IC_TLB
@@ -1097,7 +1090,6 @@ void remote_flush_tlb_array_cpumask(struct process_vm *vm,
ihk_mc_spinlock_unlock_noirq(&flush_entry->lock);
}
#endif /* POSTK_DEBUG_ARCH_DEP_8 */
void tlb_flush_handler(int vector)
{

View File

@@ -3518,14 +3518,8 @@ int __sched_wakeup_thread(struct thread *thread,
if (!status && (thread->cpu_id != ihk_mc_get_processor_id())) {
dkprintf("%s: issuing IPI, thread->cpu_id=%d\n",
__FUNCTION__, thread->cpu_id);
#ifdef POSTK_DEBUG_ARCH_DEP_8 /* arch depend hide */
ihk_mc_interrupt_cpu(thread->cpu_id,
ihk_mc_get_vector(IHK_GV_IKC));
#else /* POSTK_DEBUG_ARCH_DEP_8 */
ihk_mc_interrupt_cpu(
get_x86_cpu_local_variable(thread->cpu_id)->apic_id,
0xd1);
#endif /* POSTK_DEBUG_ARCH_DEP_8 */
}
return status;
@@ -3579,15 +3573,11 @@ void sched_request_migrate(int cpu_id, struct thread *thread)
v->status = CPU_STATUS_RUNNING;
ihk_mc_spinlock_unlock(&v->runq_lock, irqstate);
#ifdef POSTK_DEBUG_ARCH_DEP_8 /* arch depend hide */
if (cpu_id != ihk_mc_get_processor_id())
ihk_mc_interrupt_cpu(/* Kick scheduler */
thread->cpu_id, ihk_mc_get_vector(IHK_GV_IKC));
#else /* POSTK_DEBUG_ARCH_DEP_8 */
if (cpu_id != ihk_mc_get_processor_id())
ihk_mc_interrupt_cpu(/* Kick scheduler */
get_x86_cpu_local_variable(cpu_id)->apic_id, 0xd1);
#endif /* POSTK_DEBUG_ARCH_DEP_8 */
if (cpu_id != ihk_mc_get_processor_id()) {
/* Kick scheduler */
ihk_mc_interrupt_cpu(thread->cpu_id,
ihk_mc_get_vector(IHK_GV_IKC));
}
dkprintf("%s: tid: %d -> cpu: %d\n",
__FUNCTION__, thread->tid, cpu_id);
@@ -3640,15 +3630,10 @@ void runq_add_thread(struct thread *thread, int cpu_id)
#endif
/* Kick scheduler */
#ifdef POSTK_DEBUG_ARCH_DEP_8 /* arch depend hide */
if (cpu_id != ihk_mc_get_processor_id())
ihk_mc_interrupt_cpu(
thread->cpu_id, ihk_mc_get_vector(IHK_GV_IKC));
#else /* POSTK_DEBUG_ARCH_DEP_8 */
if (cpu_id != ihk_mc_get_processor_id())
ihk_mc_interrupt_cpu(
get_x86_cpu_local_variable(cpu_id)->apic_id, 0xd1);
#endif /* POSTK_DEBUG_ARCH_DEP_8 */
if (cpu_id != ihk_mc_get_processor_id()) {
ihk_mc_interrupt_cpu(thread->cpu_id,
ihk_mc_get_vector(IHK_GV_IKC));
}
}
/* NOTE: shouldn't remove a running process! */

View File

@@ -5988,11 +5988,8 @@ SYSCALL_DECLARE(getrusage)
child->status == PS_RUNNING &&
!child->in_kernel){
child->times_update = 0;
#ifdef POSTK_DEBUG_ARCH_DEP_8 /* arch depend hide */
ihk_mc_interrupt_cpu(child->cpu_id, ihk_mc_get_vector(IHK_GV_IKC));
#else /* POSTK_DEBUG_ARCH_DEP_8 */
ihk_mc_interrupt_cpu(get_x86_cpu_local_variable(child->cpu_id)->apic_id, 0xd1);
#endif /* POSTK_DEBUG_ARCH_DEP_8 */
ihk_mc_interrupt_cpu(child->cpu_id,
ihk_mc_get_vector(IHK_GV_IKC));
}
else
child->times_update = 1;
@@ -7231,11 +7228,8 @@ SYSCALL_DECLARE(clock_gettime)
child->status == PS_RUNNING &&
!child->in_kernel){
child->times_update = 0;
#ifdef POSTK_DEBUG_ARCH_DEP_8 /* arch depend hide */
ihk_mc_interrupt_cpu(child->cpu_id, ihk_mc_get_vector(IHK_GV_IKC));
#else /* POSTK_DEBUG_ARCH_DEP_8 */
ihk_mc_interrupt_cpu(get_x86_cpu_local_variable(child->cpu_id)->apic_id, 0xd1);
#endif /* POSTK_DEBUG_ARCH_DEP_8 */
ihk_mc_interrupt_cpu(child->cpu_id,
ihk_mc_get_vector(IHK_GV_IKC));
}
}
ats.tv_sec = proc->utime.tv_sec;