Prevent one CPU from getting chosen by concurrent forks

One CPU could be chosen by concurrent forks because CPU selection and
runq addition are not done atomicly. So this fix makes the two steps
atomic.

Change-Id: Ib6b75ad655789385d13207e0a47fa4717dec854a
This commit is contained in:
Masamichi Takagi
2018-09-04 09:33:10 +09:00
parent 82914c6a2e
commit 0b0b7b03d7
4 changed files with 26 additions and 10 deletions

View File

@@ -275,6 +275,7 @@ extern struct list_head resource_set_list;
extern mcs_rwlock_lock_t resource_set_lock;
extern int idle_halt;
extern int allow_oversubscribe;
extern ihk_spinlock_t runq_reservation_lock; /* To serialize runq reservations for competeing fork()s */
struct process_hash {
struct list_head list[HASH_SIZE];