hv: sched: disable interrupt when grab schedule spinlock

After moving softirq to following interrupt path, softirq handler might
break in the schedule spinlock context and try to grab the lock again,
then deadlock.

Disable interrupt with schedule spinlock context.
For the IRQ disable/restore operations:
  CPU_INT_ALL_DISABLE(&rflag)
  CPU_INT_ALL_RESTORE(rflag)
each takes 50~60 cycles.

renaming: get_schedule_lock -> obtain_schedule_lock

Tracked-On: #3813
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Conghui Chen
2019-09-04 19:39:54 +00:00
committed by wenlingz
parent 15c6a3e31f
commit 810305be98
2 changed files with 23 additions and 16 deletions

View File

@@ -88,8 +88,8 @@ struct thread_object *sched_get_current(uint16_t pcpu_id);
void init_sched(uint16_t pcpu_id);
void deinit_sched(uint16_t pcpu_id);
void get_schedule_lock(uint16_t pcpu_id);
void release_schedule_lock(uint16_t pcpu_id);
void obtain_schedule_lock(uint16_t pcpu_id, uint64_t *rflag);
void release_schedule_lock(uint16_t pcpu_id, uint64_t rflag);
void init_thread_data(struct thread_object *obj);
void deinit_thread_data(struct thread_object *obj);