futex_wake(): disable IRQs while iterating plist
Change-Id: I796794b2159816183c6487ef0048f42f97aac73b
This commit is contained in:
committed by
Masamichi Takagi
parent
ab11b168f0
commit
a37f72da0e
@@ -311,6 +311,7 @@ static int futex_wake(uint32_t *uaddr, int fshared, int nr_wake, uint32_t bitset
|
||||
struct plist_head *head;
|
||||
union futex_key key = FUTEX_KEY_INIT;
|
||||
int ret;
|
||||
unsigned long irqstate;
|
||||
|
||||
if (!bitset)
|
||||
return -EINVAL;
|
||||
@@ -320,7 +321,7 @@ static int futex_wake(uint32_t *uaddr, int fshared, int nr_wake, uint32_t bitset
|
||||
goto out;
|
||||
|
||||
hb = hash_futex(&key);
|
||||
ihk_mc_spinlock_lock_noirq(&hb->lock);
|
||||
irqstate = ihk_mc_spinlock_lock(&hb->lock);
|
||||
head = &hb->chain;
|
||||
|
||||
plist_for_each_entry_safe(this, next, head, list) {
|
||||
@@ -337,7 +338,7 @@ static int futex_wake(uint32_t *uaddr, int fshared, int nr_wake, uint32_t bitset
|
||||
}
|
||||
}
|
||||
|
||||
ihk_mc_spinlock_unlock_noirq(&hb->lock);
|
||||
ihk_mc_spinlock_unlock(&hb->lock, irqstate);
|
||||
put_futex_key(fshared, &key);
|
||||
out:
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user