Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched_ext: Factor out scx_dsq_list_node cursor initialization into INIT_DSQ_LIST_CURSOR

Factor out scx_dsq_list_node cursor initialization into INIT_DSQ_LIST_CURSOR
macro in preparation for additional users.

Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Cc: Dan Schatzberg <schatzberg.dan@gmail.com>
Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

Tejun Heo d2974cc7 c948d9f8

+9 -3
+7
include/linux/sched/ext.h
··· 149 149 u32 priv; /* can be used by iter cursor */ 150 150 }; 151 151 152 + #define INIT_DSQ_LIST_CURSOR(__node, __flags, __priv) \ 153 + (struct scx_dsq_list_node) { \ 154 + .node = LIST_HEAD_INIT((__node).node), \ 155 + .flags = SCX_DSQ_LNODE_ITER_CURSOR | (__flags), \ 156 + .priv = (__priv), \ 157 + } 158 + 152 159 /* 153 160 * The following is embedded in task_struct and contains all fields necessary 154 161 * for a task to be scheduled by SCX.
+2 -3
kernel/sched/ext.c
··· 6253 6253 if (!kit->dsq) 6254 6254 return -ENOENT; 6255 6255 6256 - INIT_LIST_HEAD(&kit->cursor.node); 6257 - kit->cursor.flags = SCX_DSQ_LNODE_ITER_CURSOR | flags; 6258 - kit->cursor.priv = READ_ONCE(kit->dsq->seq); 6256 + kit->cursor = INIT_DSQ_LIST_CURSOR(kit->cursor, flags, 6257 + READ_ONCE(kit->dsq->seq)); 6259 6258 6260 6259 return 0; 6261 6260 }