Skip to content

Commit

Permalink
scx: Fix spurious ops verification failure due to missing jiffies con…
Browse files Browse the repository at this point in the history
…version

ops->timeout_ms wasn't being converted to jiffies before testing against
SCX_WATHCDOG_MATX_TIMEOUT which led to spurious verification failures when
with lower HZ kernels. Fix it.

Link: sched-ext/scx#151
(cherry picked from commit 90b8f6e)
  • Loading branch information
htejun authored and Byte-Lab committed Feb 26, 2024
1 parent 6fb3d13 commit 1396c09
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/sched/ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -4057,7 +4057,8 @@ static int bpf_scx_init_member(const struct btf_type *t,
return -EINVAL;
return 1;
case offsetof(struct sched_ext_ops, timeout_ms):
if (*(u32 *)(udata + moff) > SCX_WATCHDOG_MAX_TIMEOUT)
if (msecs_to_jiffies(*(u32 *)(udata + moff)) >
SCX_WATCHDOG_MAX_TIMEOUT)
return -E2BIG;
ops->timeout_ms = *(u32 *)(udata + moff);
return 1;
Expand Down

0 comments on commit 1396c09

Please sign in to comment.