Skip to content

Commit f2fe382

Browse files
committed
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>
1 parent 5ebec44 commit f2fe382

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

kernel/sched/ext.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,18 +174,21 @@ MODULE_PARM_DESC(slice_bypass_us, "bypass slice in microseconds, applied on [un]
174174
static void process_ddsp_deferred_locals(struct rq *rq);
175175
static u32 reenq_local(struct rq *rq);
176176
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,
178178
s64 exit_code, const char *fmt, va_list args);
179179

180-
static __printf(4, 5) void scx_exit(struct scx_sched *sch,
180+
static __printf(4, 5) bool scx_exit(struct scx_sched *sch,
181181
enum scx_exit_kind kind, s64 exit_code,
182182
const char *fmt, ...)
183183
{
184184
va_list args;
185+
bool ret;
185186

186187
va_start(args, fmt);
187-
scx_vexit(sch, kind, exit_code, fmt, args);
188+
ret = scx_vexit(sch, kind, exit_code, fmt, args);
188189
va_end(args);
190+
191+
return ret;
189192
}
190193

191194
#define scx_error(sch, fmt, args...) scx_exit((sch), SCX_EXIT_ERROR, 0, fmt, ##args)
@@ -4400,14 +4403,14 @@ static void scx_error_irq_workfn(struct irq_work *irq_work)
44004403
kthread_queue_work(sch->helper, &sch->disable_work);
44014404
}
44024405

4403-
static void scx_vexit(struct scx_sched *sch,
4406+
static bool scx_vexit(struct scx_sched *sch,
44044407
enum scx_exit_kind kind, s64 exit_code,
44054408
const char *fmt, va_list args)
44064409
{
44074410
struct scx_exit_info *ei = sch->exit_info;
44084411

44094412
if (!scx_claim_exit(sch, kind))
4410-
return;
4413+
return false;
44114414

44124415
ei->exit_code = exit_code;
44134416
#ifdef CONFIG_STACKTRACE
@@ -4424,6 +4427,7 @@ static void scx_vexit(struct scx_sched *sch,
44244427
ei->reason = scx_exit_reason(ei->kind);
44254428

44264429
irq_work_queue(&sch->error_irq_work);
4430+
return true;
44274431
}
44284432

44294433
static int alloc_kick_syncs(void)

0 commit comments

Comments
 (0)