Revert "memory_range_lock: Enable interrupt when trylock fails"
This reverts commit 0d3ef65092.
Reason for revert: This fix causes circular dependency with memory_range manipulation and TLB flush. See #1394.
Change-Id: I4774e81ff300c199629e283e538c0a30ad0eeaae
This commit is contained in:
committed by
Ken Sato
parent
41d37bcd30
commit
edd3ea0103
@@ -744,7 +744,7 @@ struct process_vm {
|
||||
void *vvar_addr;
|
||||
|
||||
ihk_spinlock_t page_table_lock;
|
||||
struct ihk_rwlock memory_range_lock;
|
||||
ihk_spinlock_t memory_range_lock;
|
||||
// to protect the followings:
|
||||
// 1. addition of process "memory range" (extend_process_region, add_process_memory_range)
|
||||
// 2. addition of process page table (allocate_pages, update_process_page_table)
|
||||
@@ -778,46 +778,6 @@ static inline int has_cap_sys_admin(struct thread *th)
|
||||
return !(th->proc->euid);
|
||||
}
|
||||
|
||||
static inline void memory_range_read_lock(struct process_vm *vm,
|
||||
unsigned long *flags)
|
||||
{
|
||||
for (;;) {
|
||||
*flags = cpu_disable_interrupt_save();
|
||||
if (ihk_mc_read_trylock(&vm->memory_range_lock)) {
|
||||
break;
|
||||
}
|
||||
cpu_restore_interrupt(*flags);
|
||||
cpu_pause();
|
||||
}
|
||||
}
|
||||
|
||||
static inline void memory_range_write_lock(struct process_vm *vm,
|
||||
unsigned long *flags)
|
||||
{
|
||||
for (;;) {
|
||||
*flags = cpu_disable_interrupt_save();
|
||||
if (ihk_mc_write_trylock(&vm->memory_range_lock)) {
|
||||
break;
|
||||
}
|
||||
cpu_restore_interrupt(*flags);
|
||||
cpu_pause();
|
||||
}
|
||||
}
|
||||
|
||||
static inline void memory_range_read_unlock(struct process_vm *vm,
|
||||
unsigned long *flags)
|
||||
{
|
||||
ihk_mc_read_unlock(&vm->memory_range_lock);
|
||||
cpu_restore_interrupt(*flags);
|
||||
}
|
||||
|
||||
static inline void memory_range_write_unlock(struct process_vm *vm,
|
||||
unsigned long *flags)
|
||||
{
|
||||
ihk_mc_write_unlock(&vm->memory_range_lock);
|
||||
cpu_restore_interrupt(*flags);
|
||||
}
|
||||
|
||||
void hold_address_space(struct address_space *);
|
||||
void release_address_space(struct address_space *);
|
||||
struct thread *create_thread(unsigned long user_pc,
|
||||
|
||||
Reference in New Issue
Block a user