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

scx: Fix scx_ops_bypass_depth going out of sync #154

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading