Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #154 from sched-ext/htejun
Browse files Browse the repository at this point in the history
scx: Fix scx_ops_bypass_depth going out of sync
  • Loading branch information
Byte-Lab authored Mar 5, 2024
2 parents 6e7c0d4 + 34c6075 commit 272c50f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions kernel/sched/ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -3218,6 +3218,10 @@ static void scx_ops_bypass(bool bypass)
return;
}

mutex_lock(&scx_ops_enable_mutex);
if (!scx_enabled())
goto out_unlock;

/*
* No task property is changing. We just need to make sure all currently
* queued tasks are re-queued according to the new scx_ops_bypassing()
Expand Down Expand Up @@ -3255,6 +3259,9 @@ static void scx_ops_bypass(bool bypass)
/* kick to restore ticks */
resched_cpu(cpu);
}

out_unlock:
mutex_unlock(&scx_ops_enable_mutex);
}

static void free_exit_info(struct scx_exit_info *ei)
Expand Down Expand Up @@ -4408,9 +4415,6 @@ void print_scx_info(const char *log_lvl, struct task_struct *p)

static int scx_pm_handler(struct notifier_block *nb, unsigned long event, void *ptr)
{
if (!scx_enabled())
return NOTIFY_OK;

/*
* SCX schedulers often have userspace components which are sometimes
* involved in critial scheduling paths. PM operations involve freezing
Expand Down

0 comments on commit 272c50f

Please sign in to comment.