Skip to content

Commit

Permalink
Merge pull request torvalds#103 from sched-ext/htejun
Browse files Browse the repository at this point in the history
Implement generic bypass mode and use it while PM operations are in progress
  • Loading branch information
htejun authored Jan 8, 2024
2 parents dd92f1a + a62d59c commit a7150a9
Show file tree
Hide file tree
Showing 7 changed files with 205 additions and 112 deletions.
6 changes: 4 additions & 2 deletions include/linux/sched/ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ enum scx_ent_flags {
SCX_TASK_STATE_0 = 1 << 3, /* first bit encoding the task's current state */
SCX_TASK_STATE_1 = 1 << 4, /* second bit encoding the task's current state */

SCX_TASK_WATCHDOG_RESET = 1 << 16, /* task watchdog counter should be reset */
SCX_TASK_RESET_RUNNABLE_AT = 1 << 16, /* runnable_at should be reset */
SCX_TASK_DEQD_FOR_SLEEP = 1 << 17, /* last dequeue was for SLEEP */

SCX_TASK_CURSOR = 1 << 31, /* iteration cursor, not a task */
Expand Down Expand Up @@ -680,7 +680,6 @@ struct sched_ext_entity {
struct list_head fifo; /* dispatch order */
struct rb_node priq; /* p->scx.dsq_vtime order */
} dsq_node;
struct list_head watchdog_node;
u32 flags; /* protected by rq lock */
u32 dsq_flags; /* protected by dsq lock */
u32 weight;
Expand All @@ -689,7 +688,10 @@ struct sched_ext_entity {
u32 kf_mask; /* see scx_kf_mask above */
struct task_struct *kf_tasks[2]; /* see SCX_CALL_OP_TASK() */
atomic_long_t ops_state;

struct list_head runnable_node; /* rq->scx.runnable_list */
unsigned long runnable_at;

#ifdef CONFIG_SCHED_CORE
u64 core_sched_at; /* see scx_prio_less() */
#endif
Expand Down
2 changes: 1 addition & 1 deletion init/init_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct task_struct init_task
#ifdef CONFIG_SCHED_CLASS_EXT
.scx = {
.dsq_node.fifo = LIST_HEAD_INIT(init_task.scx.dsq_node.fifo),
.watchdog_node = LIST_HEAD_INIT(init_task.scx.watchdog_node),
.runnable_node = LIST_HEAD_INIT(init_task.scx.runnable_node),
.flags = 0,
.sticky_cpu = -1,
.holding_cpu = -1,
Expand Down
1 change: 1 addition & 0 deletions kernel/sched/build_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/cpuidle.h>
#include <linux/jiffies.h>
#include <linux/livepatch.h>
#include <linux/pm.h>
#include <linux/psi.h>
#include <linux/seqlock_api.h>
#include <linux/slab.h>
Expand Down
2 changes: 1 addition & 1 deletion kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4555,7 +4555,7 @@ static void __sched_fork(unsigned long clone_flags, struct task_struct *p)
p->scx.dsq = NULL;
INIT_LIST_HEAD(&p->scx.dsq_node.fifo);
RB_CLEAR_NODE(&p->scx.dsq_node.priq);
INIT_LIST_HEAD(&p->scx.watchdog_node);
INIT_LIST_HEAD(&p->scx.runnable_node);
p->scx.flags = 0;
p->scx.weight = 0;
p->scx.sticky_cpu = -1;
Expand Down
Loading

0 comments on commit a7150a9

Please sign in to comment.