From 90b8f6ee04e28a0c7a41fff17cbbb04f48715c2e Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Mon, 26 Feb 2024 09:17:01 -1000 Subject: [PATCH] scx: Fix spurious ops verification failure due to missing jiffies conversion 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: https://github.com/sched-ext/scx/issues/151 --- kernel/sched/ext.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index 08cbc3615f846..1466a3238b895 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -4067,7 +4067,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;