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: Make scx_exit() and scx_vexit() return bool

Make scx_exit() and scx_vexit() return bool indicating whether the calling
thread successfully claimed the exit. This will be used by the abort mechanism
added in a later patch.

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

Tejun Heo f2fe382e 5ebec443

+9 -5
+9 -5
kernel/sched/ext.c
··· 174 174 static void process_ddsp_deferred_locals(struct rq *rq); 175 175 static u32 reenq_local(struct rq *rq); 176 176 static void scx_kick_cpu(struct scx_sched *sch, s32 cpu, u64 flags); 177 - static void scx_vexit(struct scx_sched *sch, enum scx_exit_kind kind, 177 + static bool scx_vexit(struct scx_sched *sch, enum scx_exit_kind kind, 178 178 s64 exit_code, const char *fmt, va_list args); 179 179 180 - static __printf(4, 5) void scx_exit(struct scx_sched *sch, 180 + static __printf(4, 5) bool scx_exit(struct scx_sched *sch, 181 181 enum scx_exit_kind kind, s64 exit_code, 182 182 const char *fmt, ...) 183 183 { 184 184 va_list args; 185 + bool ret; 185 186 186 187 va_start(args, fmt); 187 - scx_vexit(sch, kind, exit_code, fmt, args); 188 + ret = scx_vexit(sch, kind, exit_code, fmt, args); 188 189 va_end(args); 190 + 191 + return ret; 189 192 } 190 193 191 194 #define scx_error(sch, fmt, args...) scx_exit((sch), SCX_EXIT_ERROR, 0, fmt, ##args) ··· 4403 4400 kthread_queue_work(sch->helper, &sch->disable_work); 4404 4401 } 4405 4402 4406 - static void scx_vexit(struct scx_sched *sch, 4403 + static bool scx_vexit(struct scx_sched *sch, 4407 4404 enum scx_exit_kind kind, s64 exit_code, 4408 4405 const char *fmt, va_list args) 4409 4406 { 4410 4407 struct scx_exit_info *ei = sch->exit_info; 4411 4408 4412 4409 if (!scx_claim_exit(sch, kind)) 4413 - return; 4410 + return false; 4414 4411 4415 4412 ei->exit_code = exit_code; 4416 4413 #ifdef CONFIG_STACKTRACE ··· 4427 4424 ei->reason = scx_exit_reason(ei->kind); 4428 4425 4429 4426 irq_work_queue(&sch->error_irq_work); 4427 + return true; 4430 4428 } 4431 4429 4432 4430 static int alloc_kick_syncs(void)