Fix deadlock on thread->times_update in getrusage()
Set thread->in_kernel properly on exiting interrupt handler when entering it from kernel mode. Conflicts: arch/x86_64/kernel/cpu.c kernel/mem.c
This commit is contained in:
@@ -1225,7 +1225,7 @@ out:
|
||||
check_need_resched();
|
||||
check_signal(0, regs, 0);
|
||||
}
|
||||
set_cputime(0);
|
||||
set_cputime(interrupt_from_user(regs)? 0: 1);
|
||||
#ifdef PROFILE_ENABLE
|
||||
if (thread->profile)
|
||||
profile_event_add(PROFILE_page_fault, (rdtsc() - t_s));
|
||||
|
||||
@@ -407,6 +407,9 @@ clone_thread(struct thread *org, unsigned long pc, unsigned long sp,
|
||||
ihk_atomic_set(&thread->refcount, 2);
|
||||
memcpy(&thread->cpu_set, &org->cpu_set, sizeof(thread->cpu_set));
|
||||
|
||||
/* New thread is in kernel until jumping to enter_user_mode */
|
||||
thread->in_kernel = org->in_kernel;
|
||||
|
||||
/* NOTE: sp is the user mode stack! */
|
||||
ihk_mc_init_user_process(&thread->ctx, &thread->uctx, ((char *)thread) +
|
||||
KERNEL_STACK_NR_PAGES * PAGE_SIZE, pc, sp);
|
||||
|
||||
Reference in New Issue
Block a user